telepathy-salut-0.8.1/0000755000175000017500000000000012051456454014345 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/m4/0000755000175000017500000000000012051456454014665 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/m4/libtool.m40000644000175000017500000105754212051456030016577 0ustar00wjtwjt00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # 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) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])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_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_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${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # 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. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[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 ;; *-*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*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/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 -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # 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* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) 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 max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_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 <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if 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_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_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* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it 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="-ldld"], [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="-ldld"]) ]) ]) ]) ]) ]) ;; 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_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_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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_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 .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_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 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_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 _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_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_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) 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" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[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]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_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 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_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])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 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (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 : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # 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]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # 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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_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_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_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_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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_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_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_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_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 ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_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_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_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_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]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_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_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX([$1]) _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_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' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_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_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_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' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_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_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$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_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl 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_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # 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 ;; aix[[4-9]]*) 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]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl 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 else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_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_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_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_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 -v "^Configured with:" | $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_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do 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_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' 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 : else # We have old collect2 _LT_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_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX([$1]) _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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_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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_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_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_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; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-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_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_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | 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_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_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; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # 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_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_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' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_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::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_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_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_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_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 -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_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_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_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 -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$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_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([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. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= 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... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); 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 for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${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 fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # 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. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then 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 ;; aix[[4-9]]*) 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]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then 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 ;; aix[[4-9]]*) 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]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # 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. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # 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. # ############################################################ m4_defun([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 IFS=$as_save_IFS 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_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS telepathy-salut-0.8.1/m4/ax_config_dir.m40000644000175000017500000000725512050201776017725 0ustar00wjtwjt00000000000000dnl Copied from Audacity 1.3.10 which itself is licensed under the GPL v2 or dnl any later version dnl Function to configure a sub-library now, because we need to know the result dnl of the configuration now in order to take decisions. dnl We don't worry about whether the configuration worked or not - it is dnl assumed that the next thing after this will be a package-specific check to dnl see if the package is actually available. (Hint: use pkg-config and dnl -uninstalled.pc files if available). dnl code based on a simplification of _AC_OUTPUT_SUBDIRS in dnl /usr/share/autoconf/autoconf/status.m4 which implements part of dnl AC_CONFIG_SUBDIRS AC_DEFUN([AX_CONFIG_DIR], [AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])] [m4_append([_AC_LIST_SUBDIRS], [$1], [])] [ # Remove --cache-file and --srcdir arguments so they do not pile up. ax_sub_configure_args= ax_prev= eval "set x $ac_configure_args" shift for ax_arg do if test -n "$ax_prev"; then ax_prev= continue fi case $ax_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ax_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) ax_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ax_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; *) case $ax_arg in *\'*) ax_arg=`echo "$ax_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ax_sub_configure_args="$ax_sub_configure_args '$ax_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ax_arg="--prefix=$prefix" case $ax_arg in *\'*) ax_arg=`echo "$ax_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ax_sub_configure_args="'$ax_arg' $ax_sub_configure_args" # Pass --silent if test "$silent" = yes; then ax_sub_configure_args="--silent $ax_sub_configure_args" fi ax_popdir=`pwd` AC_MSG_NOTICE([Configuring sources in $1]) dnl for out-of-place builds srcdir and builddir will be different, and dnl builddir may not exist, so we must create it AS_MKDIR_P(["$1"]) dnl and also set the variables. As this isn't autoconf, the following may be dnl risky: _AC_SRCDIRS(["$1"]) cd "$1" # Check for guested configure; otherwise get Cygnus style configure. if test -f "configure.gnu"; then ax_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ax_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ax_sub_configure=$ac_aux_dir/configure else AC_MSG_WARN([no configuration information is in $1]) ax_sub_configure= fi # The recursion is here. if test -n "$ax_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [[\\/]]* | ?:[[\\/]]* ) ax_sub_cache_file=$cache_file ;; *) # Relative name. ax_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac AC_MSG_NOTICE([running $SHELL $ax_sub_configure $ax_sub_configure_args --cache-file=$ax_sub_cache_file --srcdir=$ac_srcdir]) # The eval makes quoting arguments work. eval "\$SHELL \"\$ax_sub_configure\" $ax_sub_configure_args \ --cache-file=\"\$ax_sub_cache_file\" --srcdir=\"\$ax_srcdir\"" fi cd "$ax_popdir" AC_MSG_NOTICE([Done configuring in $1]) ]) telepathy-salut-0.8.1/m4/salut-valgrind.m40000644000175000017500000000147111106006506020053 0ustar00wjtwjt00000000000000dnl Detect Valgrind location and flags AC_DEFUN([SALUT_VALGRIND], [ enable=$1 if test -n "$2"; then valgrind_req=$2 else valgrind_req="2.1" fi PKG_CHECK_MODULES(VALGRIND, valgrind > "$valgrind_req", have_valgrind_runtime="yes", have_valgrind_runtime="no") AC_PATH_PROG(VALGRIND_PATH, valgrind) # Compile the instrumentation for valgrind only if the valgrind # libraries are installed and the valgrind executable is found if test "x$enable" = xyes && test "$have_valgrind_runtime" = yes && test -n "$VALGRIND_PATH" ; then AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) AC_MSG_NOTICE(using compile-time instrumentation for valgrind) fi AC_SUBST(VALGRIND_CFLAGS) AC_SUBST(VALGRIND_LIBS) AM_CONDITIONAL(HAVE_VALGRIND, test -n "$VALGRIND_PATH") ]) telepathy-salut-0.8.1/m4/salut-lcov.m40000644000175000017500000000104211106006506017202 0ustar00wjtwjt00000000000000dnl Check for lcov utility AC_DEFUN([SALUT_LCOV], [ enable=$1 AC_CHECK_PROGS(LCOV_PATH, lcov) if test -n "$LCOV_PATH" ; then AC_MSG_CHECKING([whether lcov accepts --compat-libtool]) if $LCOV_PATH --compat-libtool --help > /dev/null 2>&1 ; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(no) AC_MSG_WARN([lcov option --compat-libtool is not supported]) AC_MSG_WARN([update lcov to version > 1.5]) LCOV_PATH="" fi fi AM_CONDITIONAL(HAVE_LCOV, test -n "$LCOV_PATH" && test "x$enable" = xyes) ]) telepathy-salut-0.8.1/m4/tp-compiler-flag.m40000644000175000017500000000170411145320043020256 0ustar00wjtwjt00000000000000dnl A version of AS_COMPILER_FLAG that supports both C and C++. dnl Based on: dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS and CXXFLAGS. dnl dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([TP_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS $1" CXXFLAGS="$CXXFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) telepathy-salut-0.8.1/m4/tp-compiler-warnings.m40000644000175000017500000000240111145320043021170 0ustar00wjtwjt00000000000000dnl TP_COMPILER_WARNINGS(VARIABLE, WERROR_BY_DEFAULT, DESIRABLE, UNDESIRABLE) dnl $1 (VARIABLE): the variable to put flags into dnl $2 (WERROR_BY_DEFAULT): a command returning true if -Werror should be the dnl default dnl $3 (DESIRABLE): warning flags we want (e.g. all extra shadow) dnl $4 (UNDESIRABLE): warning flags we don't want (e.g. dnl missing-field-initializers unused-parameter) AC_DEFUN([TP_COMPILER_WARNINGS], [ AC_REQUIRE([AC_ARG_ENABLE])dnl AC_REQUIRE([AC_HELP_STRING])dnl AC_REQUIRE([TP_COMPILER_FLAG])dnl tp_warnings="" for tp_flag in $3; do TP_COMPILER_FLAG([-W$tp_flag], [tp_warnings="$tp_warnings -W$tp_flag"]) done tp_error_flags="-Werror" TP_COMPILER_FLAG([-Werror], [tp_werror=yes], [tp_werror=no]) for tp_flag in $4; do TP_COMPILER_FLAG([-Wno-$tp_flag], [tp_warnings="$tp_warnings -Wno-$tp_flag"]) TP_COMPILER_FLAG([-Wno-error=$tp_flag], [tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no]) done AC_ARG_ENABLE([Werror], AC_HELP_STRING([--disable-Werror], [compile without -Werror (normally enabled in development builds)]), tp_werror=$enableval, :) if test "x$tp_werror" = xyes && $2; then $1="$tp_warnings $tp_error_flags" else $1="$tp_warnings" fi ]) telepathy-salut-0.8.1/m4/salut-args.m40000644000175000017500000000247211106006506017203 0ustar00wjtwjt00000000000000dnl configure-time options for Telepathy Salut dnl SALUT_ARG_DEBUG dnl SALUT_ARG_VALGRIND dnl SALUT_ARG_COVERAGE AC_DEFUN([SALUT_ARG_DEBUG], [ dnl debugging stuff AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile without debug code]), [ case "${enableval}" in yes|no) enable="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac ], [enable=yes]) if test "$enable" = yes; then AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code]) fi ]) AC_DEFUN([SALUT_ARG_VALGRIND], [ dnl valgrind inclusion AC_ARG_ENABLE(valgrind, AC_HELP_STRING([--enable-valgrind],[enable valgrind checking and run-time detection]), [ case "${enableval}" in yes|no) enable="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; esac ], [enable=no]) SALUT_VALGRIND($enable, [2.1]) ]) AC_DEFUN([SALUT_ARG_COVERAGE], [ AC_ARG_ENABLE(coverage, AC_HELP_STRING([--enable-coverage], [compile with coverage profiling instrumentation (gcc only)]), [ case "${enableval}" in yes|no) enable="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-coverage) ;; esac ], [enable=no]) SALUT_GCOV($enable) SALUT_LCOV($enable) ]) telepathy-salut-0.8.1/m4/Makefile.am0000644000175000017500000000004311106006506016703 0ustar00wjtwjt00000000000000EXTRA_DIST = \ as-compiler-flag.m4 telepathy-salut-0.8.1/m4/as-compiler-flag.m40000644000175000017500000000136311132412517020243 0ustar00wjtwjt00000000000000dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS. dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, dnl and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([AS_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) telepathy-salut-0.8.1/m4/ltoptions.m40000644000175000017500000003007312051456030017153 0ustar00wjtwjt00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # 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 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_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=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_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=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_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=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) telepathy-salut-0.8.1/m4/ltsugar.m40000644000175000017500000001042412051456030016577 0ustar00wjtwjt00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) telepathy-salut-0.8.1/m4/ltversion.m40000644000175000017500000000126212051456030017143 0ustar00wjtwjt00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) telepathy-salut-0.8.1/m4/salut-gcov.m40000644000175000017500000000267711106006506017214 0ustar00wjtwjt00000000000000dnl Detect and set flags for gcov AC_DEFUN([SALUT_GCOV], [ enable=$1 GCOV=`echo $CC | sed s/gcc/gcov/g` AC_CHECK_PROG(have_gcov, $GCOV, yes, no) AS_COMPILER_FLAG(["-fprofile-arcs"], [flag_profile_arcs=yes], [flag_profile_arcs=no]) AS_COMPILER_FLAG(["-ftest-coverage"], [flag_test_coverage=yes], [flag_test_coverage=no]) if test "x$enable" = xyes && test "x$GCC" = "xyes" && test "$flag_profile_arcs" = yes && test "$flag_test_coverage" = yes ; then GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs -ftest-coverage" dnl remove any -O flags - FIXME: is this needed ? GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[[0-9]]*//g'` dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags dnl passed to the linker, which is a bug; -fprofile-arcs implicitly dnl links in -lgcov, so we do it explicitly here for the same effect GCOV_LIBS=-lgcov AC_SUBST([MOSTLYCLEANFILES], "*.bb *.bbg *.da *.gcov *.gcda *.gcno") AC_DEFINE_UNQUOTED(HAVE_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing]) CFLAGS="-O0" AC_SUBST(CFLAGS) CXXFLAGS="-O0" AC_SUBST(CXXFLAGS) FFLAGS="-O0" AC_SUBST(FFLAGS) CCASFLAGS="-O0" AC_SUBST(CCASFLAGS) AC_MSG_NOTICE([gcov enabled, setting CFLAGS and friends to $CFLAGS]) fi AC_SUBST(GCOV_CFLAGS) AC_SUBST(GCOV_LIBS) AC_SUBST(GCOV) AM_CONDITIONAL(HAVE_GCOV, test x$have_gcov = xyes) ]) telepathy-salut-0.8.1/m4/lt~obsolete.m40000644000175000017500000001375612051456030017503 0ustar00wjtwjt00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) telepathy-salut-0.8.1/m4/Makefile.in0000644000175000017500000003127412051456037016736 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/ax_config_dir.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/salut-args.m4 $(top_srcdir)/m4/salut-gcov.m4 \ $(top_srcdir)/m4/salut-lcov.m4 \ $(top_srcdir)/m4/salut-valgrind.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.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 = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BONJOUR_CFLAGS = @BONJOUR_CFLAGS@ BONJOUR_LIBS = @BONJOUR_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ENABLE_OLPC = @ENABLE_OLPC@ ENABLE_PLUGINS = @ENABLE_PLUGINS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GIO_WINDOWS_CFLAGS = @GIO_WINDOWS_CFLAGS@ GIO_WINDOWS_LIBS = @GIO_WINDOWS_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ LIBSOUP_LIBS = @LIBSOUP_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_GLIB_CFLAGS = @TELEPATHY_GLIB_CFLAGS@ TELEPATHY_GLIB_LIBS = @TELEPATHY_GLIB_LIBS@ TEST_PYTHON = @TEST_PYTHON@ USE_BACKEND_AVAHI = @USE_BACKEND_AVAHI@ USE_BACKEND_BONJOUR = @USE_BACKEND_BONJOUR@ USE_BACKEND_DUMMY = @USE_BACKEND_DUMMY@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VALGRIND_PATH = @VALGRIND_PATH@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ WOCKY_LIBS = @WOCKY_LIBS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginexecdir = @pluginexecdir@ pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ as-compiler-flag.m4 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: telepathy-salut-0.8.1/README0000644000175000017500000000530612050201776015223 0ustar00wjtwjt00000000000000=============== telepathy-salut =============== Salut is a link-local XMPP (XEP-0174) connection manager for the Telepathy framework, currently supporting presence and single-user chats with iChat interoperability, and multi-user chats and Tubes using the Clique protocol . Telepathy is a D-Bus framework for unifying real time communication, including instant messaging, voice calls and video calls. It abstracts differences between protocols to provide a unified interface for applications. Requirements ============ telepathy-salut requires: telepathy-glib libxml2 GLib, GObject libdbus The D-Bus GLib bindings and optionally uses: libasyncns For the Avahi backend on Linux: avahi-gobject For the Bonjour backend on Windows/mingw32: dns-sd client library with mingw support At build time, it also requires: GNU make pkg-config libxslt, xsltproc Python See configure.ac for full details, including versions required. Building from Git also requires the GNU build system (Autoconf, Automake, libtool). Bugs, feature requests and to-do list ===================================== Report all bugs, feature requests and "to-do" items here: Versioning policy ================= We use an "odd/even" versioning scheme where the minor version (the y in x.y.z) determines stability - stable branches have y even, development branches have y odd. Unreleased builds straight from Darcs identify themselves as version "x.y.z.1". These are compiled with -Werror, so they might stop working if your gcc version issues more warnings than ours. If this is a problem for you, use a release tarball. Contact info ============ This package is maintained by the Telepathy project: Telepathy development is supported by Collabora Ltd. . Hacking ======= The current version of telepathy-salut is always available from: Please follow in new code. telepathy-salut-0.8.1/config.guess0000755000175000017500000012743212051456037016673 0ustar00wjtwjt00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-salut-0.8.1/configure.ac0000644000175000017500000002537212051455315016637 0ustar00wjtwjt00000000000000AC_PREREQ([2.59]) # Making releases: # set the new version number: # odd minor -> development series # even minor -> stable series # increment micro for each release within a series # set salut_nano_version to 0. m4_define([salut_major_version], [0]) m4_define([salut_minor_version], [8]) m4_define([salut_micro_version], [1]) m4_define([salut_nano_version], [0]) # Some magic m4_define([salut_base_version], [salut_major_version.salut_minor_version.salut_micro_version]) m4_define([salut_version], [m4_if(salut_nano_version, 0, [salut_base_version], [salut_base_version].[salut_nano_version])])dnl AC_INIT([Telepathy Salut], [salut_version], [https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=telepathy-salut]) AC_CONFIG_MACRO_DIR([m4]) AC_LANG([C]) AM_INIT_AUTOMAKE([1.9 -Wno-portability tar-ustar]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AM_PROG_LIBTOOL AM_CONFIG_HEADER(config.h) dnl check for tools AC_PROG_CC AC_PROG_CC_STDC AM_PROG_AS AM_PROG_MKDIR_P dnl add common command line switches SALUT_ARG_DEBUG SALUT_ARG_VALGRIND SALUT_ARG_COVERAGE dnl Detect Windows Verion AC_MSG_CHECKING([for operating system]) case "$host" in *-*-*mingw*|*-*-*cygwin*) platform=win32 ;; *) platform=generic ;; esac AC_MSG_RESULT($platform) AM_CONDITIONAL([OS_WINDOWS], [test "$platform" = "win32"]) dnl decide error flags ifelse(salut_nano_version, 0, [ official_release=yes ], [ official_release=no ]) TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$official_release" = xno], [all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self], [missing-field-initializers \ unused-parameter \ deprecated-declarations]) AC_SUBST([ERROR_CFLAGS]) ifelse(salut_nano_version, 0, [ # Salut is version x.y.z - disable coding style checks by default AC_ARG_ENABLE(coding-style-checks, AC_HELP_STRING([--enable-coding-style-checks], [check coding style using grep]), [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=no] ) ], [ # Salut is version x.y.z.1 - enable coding style checks by default AC_ARG_ENABLE(coding-style-checks, AC_HELP_STRING([--disable-coding-style-checks], [do not check coding style using grep]), [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes]) ]) if test x$enable_debug = xyes; then AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code]) fi AC_SUBST([ENABLE_CODING_STYLE_CHECKS]) dnl Check for code generation tools XSLTPROC= AC_CHECK_PROGS([XSLTPROC], [xsltproc]) if test -z "$XSLTPROC"; then AC_MSG_ERROR([xsltproc (from the libxslt source package) is required]) fi AM_PATH_PYTHON([2.5]) # Check for a python >= 2.5 with twisted to run python tests AC_MSG_CHECKING([for Python with Avahi, Twisted and XMPP protocol support]) if $PYTHON -c "import twisted.words.xish.domish, twisted.words.protocols.jabber, twisted.internet.reactor, avahi" >/dev/null 2>&1; then TEST_PYTHON="$PYTHON" else TEST_PYTHON=false fi AC_MSG_RESULT([$TEST_PYTHON]) AC_SUBST(TEST_PYTHON) AM_CONDITIONAL([WANT_TWISTED_TESTS], test false != "$TEST_PYTHON") dnl enable avahi tests AC_ARG_ENABLE(avahi-tests, AC_HELP_STRING([ --enable-avahi-tests], [Enable tests that use the system avahi to hit the network ]), enable_avahi_tests=$enableval, enable_avahi_tests=yes) if test x$enable_avahi_tests = xyes; then if test false = "$TEST_PYTHON"; then AC_MSG_ERROR( [Python with twisted support is needed for avahi twisted tests]) fi fi AM_CONDITIONAL(WANT_TWISTED_AVAHI_TESTS, test "x$enable_avahi_tests" = "xyes") dnl olpc specific code switch AC_ARG_ENABLE(olpc, AC_HELP_STRING([--enable-olpc],[compile with olpc specific code]), enable_olpc=$enableval, enable_olpc=no ) if test x$enable_olpc = xyes; then AC_DEFINE(ENABLE_OLPC, [], [Enable olpc code]) fi AM_CONDITIONAL(ENABLE_OLPC, test "x$enable_olpc" = "xyes") AC_SUBST(ENABLE_OLPC) AC_HEADER_STDC([]) AC_C_INLINE AC_CHECK_HEADERS_ONCE([ arpa/inet.h arpa/nameser.h fcntl.h ifaddrs.h netdb.h netinet/in.h sys/ioctl.h sys/un.h unistd.h ]) # on Darwin, these headers are interdependent, according to autoconf.info AC_CHECK_HEADERS([sys/socket.h], [], [], [ #include #include #include ]) # Autoconf has a handy macro for this, since it tends to have dependencies AC_HEADER_RESOLV dnl GTK docs GTK_DOC_CHECK dnl Check for Glib PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.24, gobject-2.0 >= 2.16, gthread-2.0 >= 2.4, gio-2.0]) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) if test "$platform" = "win32"; then PKG_CHECK_MODULES(GIO_WINDOWS, [gio-windows-2.0]) AC_SUBST(GIO_WINDOWS_CFLAGS) AC_SUBST(GIO_WINDOWS_LIBS) else PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0]) AC_SUBST(GIO_UNIX_CFLAGS) AC_SUBST(GIO_UNIX_LIBS) fi GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) dnl Check for D-Bus PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.1.0, dbus-glib-1 >= 0.61]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) dnl Check for libxml2 PKG_CHECK_MODULES(LIBXML2, [libxml-2.0]) AC_SUBST(LIBXML2_CFLAGS) AC_SUBST(LIBXML2_LIBS) dnl Check for telepathy-glib PKG_CHECK_MODULES(TELEPATHY_GLIB, [telepathy-glib >= 0.17.1]) AC_SUBST(TELEPATHY_GLIB_CFLAGS) AC_SUBST(TELEPATHY_GLIB_LIBS) dnl check the backend to use if test "$platform" = "win32"; then AC_ARG_WITH(backend, AC_HELP_STRING([--with-backend=[bonjour/no]], [Zeroconf backend to use]), [], [with_backend=bonjour]) else AC_ARG_WITH(backend, AC_HELP_STRING([--with-backend=[avahi/bonjour/no]], [Zeroconf backend to use]), [], [with_backend=avahi]) fi AM_CONDITIONAL(USE_BACKEND_AVAHI, [test "x$with_backend" = "xavahi"]) AM_CONDITIONAL(USE_BACKEND_BONJOUR, [test "x$with_backend" = "xbonjour"]) AM_CONDITIONAL(USE_BACKEND_DUMMY, [test "x$with_backend" = "xno"]) dnl Check for Avahi if test x$with_backend = xavahi; then PKG_CHECK_MODULES(AVAHI, [avahi-gobject, avahi-client]) AC_DEFINE(USE_BACKEND_AVAHI, [], [Use Avahi backend]) AC_SUBST(AVAHI_CFLAGS) AC_SUBST(AVAHI_LIBS) AC_SUBST(USE_BACKEND_AVAHI) fi dnl Check for Bonjour Client Library libdns_sd if test x$with_backend = xbonjour; then PKG_CHECK_MODULES(BONJOUR, [libdns_sd]) AC_DEFINE(USE_BACKEND_BONJOUR, [], [Use Bonjour backend]) AC_SUBST(BONJOUR_CFLAGS) AC_SUBST(BONJOUR_LIBS) AC_SUBST(USE_BACKEND_BONJOUR) fi if test x$with_backend = xno; then AC_DEFINE(USE_BACKEND_DUMMY, [], [Use dummy backend]) AC_SUBST(USE_BACKEND_DUMMY) fi dnl Check for libsoup PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4]) AC_SUBST(LIBSOUP_CFLAGS) AC_SUBST(LIBSOUP_LIBS) dnl check for libuuid PKG_CHECK_MODULES([UUID], [uuid], [HAVE_UUID=yes], [HAVE_UUID=no]) AC_SUBST([UUID_CFLAGS]) AC_SUBST([UUID_LIBS]) if test x"$HAVE_UUID" = xyes; then AC_DEFINE([HAVE_UUID], [1], [Define if libuuid is available]) else AC_MSG_WARN([libuuid not found, falling back to generating random IDs]) fi AC_ARG_ENABLE(submodules, AS_HELP_STRING([--disable-submodules], [Use system version of Wocky rather than a submodule]), build_submodules=$enableval, build_submodules=yes ) # These must contain "exec" for automake to work right (install-exec, # not install-data). # # Private directory for Wocky and the salut-plugins library if test "x$pluginexeclibdir" = x; then pluginexeclibdir='${libdir}/telepathy/salut-0/lib' fi AC_ARG_VAR([pluginexeclibdir]) # The actual plugins if test "x$pluginexecdir" = x; then pluginexecdir='${libdir}/telepathy/salut-0/plugins' fi AC_ARG_VAR([pluginexecdir]) dnl plugins AC_ARG_ENABLE(plugins, AC_HELP_STRING([--disable-plugins], [disable plugin loader]), [enable_plugins=$enableval], [enable_plugins=yes]) if test x$enable_plugins = xyes; then AC_DEFINE(ENABLE_PLUGINS, [], [Enable plugins]) PKG_CHECK_MODULES(GMODULE, [gmodule-2.0]) AC_ARG_ENABLE(plugin-api, AC_HELP_STRING([--enable-plugin-api], [install headers for third-party plugins (experimental)]), [ enable_plugin_api=$enableval wocky_install_headers_dir="${includedir}/telepathy-salut-0" ], [enable_plugin_api=no]) fi AC_SUBST(GMODULE_CFLAGS) AC_SUBST(GMODULE_LIBS) AM_CONDITIONAL(ENABLE_PLUGINS, test x$enable_plugins = xyes) AC_SUBST(ENABLE_PLUGINS) AM_CONDITIONAL(ENABLE_PLUGIN_API, test x$enable_plugin_api = xyes) # We have to run Wocky's configure *before* looking for it with # PKG_CHECK_MODULES so wocky-uninstalled.pc has been generated # If you don't specify --prefix, it starts off as NONE. Autoconf # would normally do this defaulting for us later, but that's too # late to help Wocky. if test "x${prefix}" = "xNONE"; then prefix=/usr/local fi # We tell Wocky to install its headers alongside gabble's so that an actual # separate Wocky installation won't clash with them. This is a bit of a hack. # AX_CONFIG_DIR doesn't make it very easy to pass extra arguments to the # submodule's configure. prev_ac_configure_args=$ac_configure_args ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_headers_dir} --enable-shared-suffix=${PACKAGE}-${VERSION} --libdir=${pluginexeclibdir}" if test "x$ENABLE_CODING_STYLE_CHECKS" = xyes ; then ac_configure_args="$ac_configure_args --enable-coding-style-checks" else ac_configure_args="$ac_configure_args --disable-coding-style-checks" fi if test "x$tp_werror" = xyes && test "x$official_release" = xno; then ac_configure_args="$ac_configure_args --enable-Werror" else ac_configure_args="$ac_configure_args --disable-Werror" fi prev_top_build_prefix=$ac_top_build_prefix AX_CONFIG_DIR([lib/ext/wocky]) ac_top_build_prefix=$prev_top_build_prefix ac_configure_args=$prev_ac_configure_args PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+"$PKG_CONFIG_PATH:"}${ac_abs_top_builddir}/lib/ext/wocky/wocky" export PKG_CONFIG_PATH PKG_CHECK_MODULES([WOCKY], [wocky >= 0.0.0]) AC_SUBST([WOCKY_CFLAGS]) AC_SUBST([WOCKY_LIBS]) AC_SUBST(PACKAGE_STRING) AC_OUTPUT( Makefile \ docs/Makefile \ lib/Makefile \ lib/ext/Makefile \ lib/gibber/Makefile \ lib/gibber/tests/Makefile \ src/Makefile \ m4/Makefile \ data/Makefile \ extensions/Makefile \ tools/Makefile \ tests/Makefile \ tests/twisted/Makefile \ tests/twisted/tools/Makefile \ plugins/Makefile \ salut/Makefile \ salut/telepathy-salut-uninstalled.pc \ salut/telepathy-salut.pc ) telepathy-salut-0.8.1/plugins/0000755000175000017500000000000012051456454016026 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/plugins/test.c0000644000175000017500000001005412051447732017150 0ustar00wjtwjt00000000000000#include "config.h" #include "test.h" #include #include #include "extensions/extensions.h" #define DEBUG(msg, ...) \ g_debug ("%s: " msg, G_STRFUNC, ##__VA_ARGS__) static void plugin_iface_init ( gpointer g_iface, gpointer data); #define IFACE_TEST "org.freedesktop.Telepathy.Salut.Plugin.Test" static const gchar * const sidecar_interfaces[] = { IFACE_TEST, NULL }; G_DEFINE_TYPE_WITH_CODE (TestPlugin, test_plugin, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (SALUT_TYPE_PLUGIN, plugin_iface_init); ) static void test_plugin_init (TestPlugin *object) { DEBUG ("%p", object); } static void test_plugin_class_init (TestPluginClass *klass) { } static void initialize (SalutPlugin *plugin, TpBaseConnectionManager *connection_manager, const SalutPluginInitializeCallbacks *callbacks) { DEBUG ("%p on connection manager %p", plugin, connection_manager); /* If you wanted to add another protocol you could do it here by * creating the protocol object with callbacks->create_protocol * and then calling tp_base_connection_manager_add_protocol(). */ } static GPtrArray * create_channel_managers (SalutPlugin *plugin, SalutPluginConnection *plugin_connection) { DEBUG ("%p on connection %p", plugin, plugin_connection); return NULL; } static void test_plugin_create_sidecar_async ( SalutPlugin *plugin, const gchar *sidecar_interface, SalutPluginConnection *connection, WockySession *session, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin), callback, user_data, test_plugin_create_sidecar_async); SalutSidecar *sidecar = NULL; if (!tp_strdiff (sidecar_interface, IFACE_TEST)) { sidecar = g_object_new (TEST_TYPE_SIDECAR, NULL); } else { g_simple_async_result_set_error (result, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, "'%s' not implemented", sidecar_interface); } if (sidecar != NULL) g_simple_async_result_set_op_res_gpointer (result, sidecar, g_object_unref); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static SalutSidecar * test_plugin_create_sidecar_finish ( SalutPlugin *plugin, GAsyncResult *result, GError **error) { SalutSidecar *sidecar; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (plugin), test_plugin_create_sidecar_async), NULL); sidecar = SALUT_SIDECAR (g_simple_async_result_get_op_res_gpointer ( G_SIMPLE_ASYNC_RESULT (result))); return g_object_ref (sidecar); } static void plugin_iface_init ( gpointer g_iface, gpointer data G_GNUC_UNUSED) { SalutPluginInterface *iface = g_iface; iface->api_version = SALUT_PLUGIN_CURRENT_VERSION; iface->name = "Salut test plugin"; iface->version = PACKAGE_VERSION; iface->sidecar_interfaces = sidecar_interfaces; iface->create_sidecar_async = test_plugin_create_sidecar_async; iface->create_sidecar_finish = test_plugin_create_sidecar_finish; iface->initialize = initialize; iface->create_channel_managers = create_channel_managers; } SalutPlugin * salut_plugin_create () { return g_object_new (test_plugin_get_type (), NULL); } /****************************** * TestSidecar implementation * ******************************/ static void sidecar_iface_init ( gpointer g_iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (TestSidecar, test_sidecar, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (SALUT_TYPE_SIDECAR, sidecar_iface_init); G_IMPLEMENT_INTERFACE (SALUT_TYPE_SVC_SALUT_PLUGIN_TEST, NULL); ) static void test_sidecar_init (TestSidecar *object) { DEBUG ("%p", object); } static void test_sidecar_class_init (TestSidecarClass *klass) { } static void sidecar_iface_init ( gpointer g_iface, gpointer data) { SalutSidecarInterface *iface = g_iface; iface->interface = IFACE_TEST; iface->get_immutable_properties = NULL; } telepathy-salut-0.8.1/plugins/test.h0000644000175000017500000000330612050201776017152 0ustar00wjtwjt00000000000000#include /* plugin */ typedef struct _TestPluginClass TestPluginClass; typedef struct _TestPlugin TestPlugin; struct _TestPluginClass { GObjectClass parent; }; struct _TestPlugin { GObject parent; }; GType test_plugin_get_type (void); #define TEST_TYPE_PLUGIN \ (test_plugin_get_type ()) #define TEST_PLUGIN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_PLUGIN, TestPlugin)) #define TEST_PLUGIN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TEST_TYPE_PLUGIN, \ TestPluginClass)) #define TEST_IS_PLUGIN(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TEST_TYPE_PLUGIN)) #define TEST_IS_PLUGIN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TEST_TYPE_PLUGIN)) #define TEST_PLUGIN_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_PLUGIN, \ TestPluginClass)) /* Sidecar */ typedef struct _TestSidecarClass TestSidecarClass; typedef struct _TestSidecar TestSidecar; struct _TestSidecarClass { GObjectClass parent; }; struct _TestSidecar { GObject parent; }; GType test_sidecar_get_type (void); #define TEST_TYPE_SIDECAR \ (test_sidecar_get_type ()) #define TEST_SIDECAR(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_SIDECAR, TestSidecar)) #define TEST_SIDECAR_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TEST_TYPE_SIDECAR, \ TestSidecarClass)) #define TEST_IS_SIDECAR(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TEST_TYPE_SIDECAR)) #define TEST_IS_SIDECAR_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TEST_TYPE_SIDECAR)) #define TEST_SIDECAR_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_SIDECAR, \ TestSidecarClass)) telepathy-salut-0.8.1/plugins/Makefile.am0000644000175000017500000000145012050201776020054 0ustar00wjtwjt00000000000000# testing-only plugins noinst_LTLIBRARIES = \ test.la installable_plugins = $(NULL) if ENABLE_PLUGINS pluginexec_LTLIBRARIES = $(installable_plugins) else # we still compile the plugin (just to make sure it compiles!) but we don't # install it noinst_LTLIBRARIES += $(installable_plugins) endif AM_LDFLAGS = -module -avoid-version -shared test_la_SOURCES = \ test.c \ test.h # because test.la is not installed, libtool will want to compile it as static # despite -shared (a convenience library), unless we also use -rpath test_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(pluginexecdir) AM_CFLAGS = $(ERROR_CFLAGS) \ -I $(top_srcdir) -I $(top_builddir) \ @GLIB_CFLAGS@ @TELEPATHY_GLIB_CFLAGS@ @WOCKY_CFLAGS@ \ -I $(top_srcdir)/salut -I $(top_builddir)/salut \ -I $(top_srcdir)/plugins telepathy-salut-0.8.1/plugins/Makefile.in0000644000175000017500000005266012051456037020101 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ # we still compile the plugin (just to make sure it compiles!) but we don't # install it @ENABLE_PLUGINS_FALSE@am__append_1 = $(installable_plugins) subdir = plugins DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/ax_config_dir.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/salut-args.m4 $(top_srcdir)/m4/salut-gcov.m4 \ $(top_srcdir)/m4/salut-lcov.m4 \ $(top_srcdir)/m4/salut-valgrind.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.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 = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pluginexecdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pluginexec_LTLIBRARIES) test_la_LIBADD = am_test_la_OBJECTS = test.lo test_la_OBJECTS = $(am_test_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(test_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(test_la_SOURCES) DIST_SOURCES = $(test_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BONJOUR_CFLAGS = @BONJOUR_CFLAGS@ BONJOUR_LIBS = @BONJOUR_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ENABLE_OLPC = @ENABLE_OLPC@ ENABLE_PLUGINS = @ENABLE_PLUGINS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GIO_WINDOWS_CFLAGS = @GIO_WINDOWS_CFLAGS@ GIO_WINDOWS_LIBS = @GIO_WINDOWS_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ LIBSOUP_LIBS = @LIBSOUP_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_GLIB_CFLAGS = @TELEPATHY_GLIB_CFLAGS@ TELEPATHY_GLIB_LIBS = @TELEPATHY_GLIB_LIBS@ TEST_PYTHON = @TEST_PYTHON@ USE_BACKEND_AVAHI = @USE_BACKEND_AVAHI@ USE_BACKEND_BONJOUR = @USE_BACKEND_BONJOUR@ USE_BACKEND_DUMMY = @USE_BACKEND_DUMMY@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VALGRIND_PATH = @VALGRIND_PATH@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ WOCKY_LIBS = @WOCKY_LIBS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginexecdir = @pluginexecdir@ pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # testing-only plugins noinst_LTLIBRARIES = test.la $(am__append_1) installable_plugins = @ENABLE_PLUGINS_TRUE@pluginexec_LTLIBRARIES = $(installable_plugins) AM_LDFLAGS = -module -avoid-version -shared test_la_SOURCES = \ test.c \ test.h # because test.la is not installed, libtool will want to compile it as static # despite -shared (a convenience library), unless we also use -rpath test_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(pluginexecdir) AM_CFLAGS = $(ERROR_CFLAGS) \ -I $(top_srcdir) -I $(top_builddir) \ @GLIB_CFLAGS@ @TELEPATHY_GLIB_CFLAGS@ @WOCKY_CFLAGS@ \ -I $(top_srcdir)/salut -I $(top_builddir)/salut \ -I $(top_srcdir)/plugins all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pluginexecLTLIBRARIES: $(pluginexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pluginexec_LTLIBRARIES)'; test -n "$(pluginexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pluginexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pluginexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pluginexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pluginexecdir)"; \ } uninstall-pluginexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pluginexec_LTLIBRARIES)'; test -n "$(pluginexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginexecdir)/$$f"; \ done clean-pluginexecLTLIBRARIES: -test -z "$(pluginexec_LTLIBRARIES)" || rm -f $(pluginexec_LTLIBRARIES) @list='$(pluginexec_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 test.la: $(test_la_OBJECTS) $(test_la_DEPENDENCIES) $(EXTRA_test_la_DEPENDENCIES) $(AM_V_CCLD)$(test_la_LINK) $(test_la_OBJECTS) $(test_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pluginexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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-noinstLTLIBRARIES \ clean-pluginexecLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pluginexecLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(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-pluginexecLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES \ clean-pluginexecLTLIBRARIES 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-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pluginexecLTLIBRARIES install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-pluginexecLTLIBRARIES $(NULL) # 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: telepathy-salut-0.8.1/AUTHORS0000644000175000017500000000004011106006517015376 0ustar00wjtwjt00000000000000Sjoerd Simons telepathy-salut-0.8.1/aclocal.m40000644000175000017500000015356112051456033016211 0ustar00wjtwjt00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) fi fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # 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|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 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. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have 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_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) 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 AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [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])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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 .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # 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 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # (`yes' being less verbose, `no' or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0')]) case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few `make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using `$V' instead of `$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/as-compiler-flag.m4]) m4_include([m4/ax_config_dir.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/salut-args.m4]) m4_include([m4/salut-gcov.m4]) m4_include([m4/salut-lcov.m4]) m4_include([m4/salut-valgrind.m4]) m4_include([m4/tp-compiler-flag.m4]) m4_include([m4/tp-compiler-warnings.m4]) telepathy-salut-0.8.1/NEWS0000644000175000017500000003567512051455270015057 0ustar00wjtwjt00000000000000telepathy-salut 0.8.1 (2012-11-16) ================================== Here are some crash fixes, and a pretty important fix which means we can talk to iChat again. • Fix an assertion failure in the OLPC activity manager on disconnect. (Jonny) • Check parsing tube messages in a MUC succeeds, to avoid using an uninitialized variable. (Will) • Don't crash when closing a roomlist channel. (Will) • fd.o#51527: fix interoperability with iChat (oops). This also fixes fd.o#51528, a crash when messaged by a malformed JID such as "wjt@bael (2)". (Will) telepathy-salut 0.8.0 (2012-04-04) ================================== This is the start of a new stable branch. Changes since 0.7.2: • Fix build with OLPC code enabled. (Jonny) • Fix MUC code to announce the user as a member of the MUC if it is the creator. (Jonny) • Fix race in file transfer code which was giving the IO channel to Gibber before it knew how to deal with it.. (Jonny) Summary of particularly noteworthy changes since 0.6.x: • The FileTransfer Metadata interface has been implemented. • Salut now builds on Android using 'androgenizer'. • Salut can now be built and used on Windows/MinGW32. telepathy-salut 0.7.2 (2012-03-26) ================================== Enhancements • fd.o#46345 - Salut can now be built on Windows/MinGW32 (siraj) • fd.o#18530 - Support for IPv4 and IPv6 types for the local socket for file transfer (tdfischer) • fd.o#47072 - Salut can now advertise itself on the network on Windows using Apple's mDNSResponder (siraj) • fd.o#45716 - The plugin interface has been further adjusted to comply with requirements of real-world plugins on Windows (Hei_Ku, oggis) • fd.o#47429 - Can discover remote contacts from the network on Windows using Apple's mDNSResponder (siraj) • fd.o#47729 - File transfer support is now enabled on Windows (siraj) Fixes: • fd.o#31729 - The ContactList interface is now actually advertised as supported telepathy-salut 0.7.1 (2012-02-20) ================================== The "y u no fill news file and leave it between me and git log" release. Enhancements: • fd.o#45716 - Salut now has a salut-plugins.so library, similarly to mission-control. This enables plugins to link correctly as DLLs on Windows. This also means that plugins don't directly access SalutConnections anymore, but instead invoke the same functionality through a SalutPluginConnection GInterface. (siraj) • fd.o#42515 - Support for building on Android (Hei_Ku) • fd.o#45703 - Support for One Big Header Wocky (wjt) Fixes: • fd.o#44020 - Unix socket paths for MUC stream tubes too long • Almost all unit tests failing if IPv6 is not enabled in the kernel telepathy-salut 0.7.0 (2011-11-16) ================================== This is the start of a new development branch that will lead to 0.8 in roughly 6 months. Enhancements: • fd.o#42348: the Chan.I.FileTransfer.Metadata interface has been implemented. (jonny) • Updated Wocky: · The SASL auth server test now builds with new and old versions of libsasl2. telepathy-salut 0.6.0 (2011-10-18) ================================== The “the cleaning lady… cleans up… dust. She dusts. And she has weekends off, so… Monday. Right?” release. Please enjoy this refreshing stable branch. Enhancements since 0.5.2: • Salut implements the ContactList interface, which makes TP_CONNECTION_FEATURE_CONTACT_LIST in telepathy-glib work with Salut! (xclaesse) Big changes since 0.4.0: • Salut now mostly uses the Wocky XMPP library. • Protocol, ContactCapabilities and (half of) ContactInfo are implemented. • Salut has grown a plugin API, rather like Gabble's. telepathy-salut 0.5.2 (2011-10-05) ================================== Enhancements: • fd.o#40035: the ContactInfo Connection interface has been implemented, so extra information about contacts, like first and last names, are now exposed in a nice way and can be shown in clients. (wjt) Fixes: • Ensure OLPC tests are included in releases. (jonny) • Fix send_ll_pep_event public utility function to construct PEP messages correctly. (jonny) Dependencies: • xmldiff is no longer required for tests. telepathy-salut 0.5.1 (2011-07-07) ================================== The “nyanit.com is high up in the referrals list” release. This release fixes a crash triggered by recent versions of telepathy-glib, and a crash triggered by portscanning yourself. Enhancements: • More bits and pieces of Gibber have been replaced by Wocky. (jonny) Fixes: • Assumptions made about the default value of TpChannelIface:handle-type (which changed in a recent telepathy-glib release) are now less specific, fixing assertion failures. (jonny, sjoerd) • Salut no longer crashes if you 'nmap localhost'. (fd.o#39018, jonny) • The tests now pass with telepathy-glib >= 0.14.6, which corrected a longstanding bug in MembersChangedDetailed which saluttest.py was relying on. The tests should still work with older versions, too. (wjt) telepathy-salut 0.5.0 (2011-05-03) ================================== Enhancements: * The wocky library used in telepathy-gabble has been added as a submodule and is starting to replace bits of Gibber such As GibberXmppNode → WockyNode, and GibberXmppStanza → WockyStanza. Keep on reading for more. (smcv, jonny) * The test suite now has a mock Avahi service, so running the tests no longer uses the system avahi and therefore doesn't pop up contacts on other users' contact lists. You can hit the actual network if you want though, see tests/README. (tomeu, smcv, jonny) * Implement ofdT.Protocol objects for exposed protocols. (smcv) * Replace the capability channel manager interfaces with the new ones already used in Gabble which make the caps situation a lot more sane. (smcv) * Implement ContactCapabilities. (jonny) * fd.o#33833: Implement FileTransfer.FileURI (cassidy) * Use Wocky's caps hashing code, and so throw out Salut's own code for this. (jonny) * Give Salut a plugin API, based on the Gabble one. The API consists of a little bit of Salut, Wocky and tp-glib. Plugins can expose new protocols and can add channel managers. Brill. (jonny) * The C tests now use GLib instead of check. (stefw) * Salut's XMPP connection manager has been replaced with Wocky's Meta Porter. This is better in many ways. (jonny) * Add salut_send_ll_pep_event() function to send a pep message (this is basically the only step needed for link-local PEP support). (jonny) Fixes: * Ensure to reply to disco requests with the same id attribute and other test reliability fixes. (smcv) * fd.o#31665: use TpDBusDaemon, not tp_get_bus(). (smcv) Dependencies: * xmldiff is now a required dependency otherwise the gibber tests fail. It has always been required but it was never checked at configure time. * GLib ≥ 2.24 is now required. * telepathy-glib ≥ 0.13.12 is now required. telepathy-salut 0.4.0 (2010-09-06) =================================== The "a stable branch that doesn't go anywhere is the most stable of all" release. Fixes: * Remove the GibberResolver and all its infrastructure (smcv) * Use the normal, safer telepathy-glib priv idioms (smcv) * Add salut_connection_get_implemented_interfaces (smcv) * Make tests more robust (smcv) * Remove examples and OpenSSL support from libgibber (smcv) * remove SASL support (smcv) * remove now-unused MD5 implementation (smcv) * Remove the activity when its channel has been closed, as Gabble does (tomeu) telepathy-salut 0.3.13 (2010-08-19) =================================== The "treitter has a list somewhere on the telepathy wiki if you're stuck" release. Enhancements: * Implement avatar requirements properties (Zdra) * Add a ActivityProperties.GetActivity method for retrieving an activity's room handle from its id (tomeu) * Add a BuddyInfo.AddActivity method so activities can advertise themselves without having to track all the other shared activities (tomeu) Fixes: * Update with-session-bus.sh from telepathy-glib, fixing a bashism (smcv) telepathy-salut 0.3.12 (2010-05-20) =================================== The "maybe your browser has turned religious" release. Enhancements: * Merge back most of the portability improvements from Gabble's copy of Gibber (smcv) * Use automake silent rules (--enable-silent-rules) instead of shave (smcv) Fixes: * fd.o #22970, Debian #565154: don't try to support credential-passing on non-Linux platforms, fixing compilation there (smcv) * fd.o #27289: set the Properties flag on group channels for round-trip reduction (cassidy) * fd.o #20732 (partial): allow the user to leave MUCs with RemoveMembers() (smcv) * Implement the error path for ContactList channel requests correctly (smcv) * Fix compilation in the tr_TR.UTF-8 locale (Maiku) * Use the right timestamps on message delivery reports (Jonny) * Stop working around fd.o #15092, which was fixed in telepathy-glib (cassidy) * fd.o #26152: make critical warnings fatal by default (smcv) telepathy-salut 0.3.11 (2010-03-25) =================================== The "Not really" release. Enhancements: * Implement TpMessageMixin and therefore the Channel.Interface.Messages. Fixes: * Fix strict aliasing warnings from gcc. * Fix assertion due to g_set_prgname being called twice. telepathy-salut 0.3.10 (2009-09-10) =================================== The "The lampshade of doom" release. Requirements: * telepathy-glib >= 0.7.36 is now required so Salut emits the correct D-Bus errors. This version is also requiered as we implement the new tube API and the Debug interface. Enhancements: * Implement the final, stable new API for tubes. The NewConnection signal has been renamed to NewRemoteConnection and now has a Connection_ID argument. The StreamTube channel type now implements the NewLocalConnection and ConnectionClosed signals. DBusTube.{Offer,Accept} now have an access_control argument. * Use ContactCapabilities draft to communicate tube support. * In StreamTube, UNIX sockets created with the Localhost access control are usable by any user of the system. * Implement Debug interface. Fixes: * Include muc tube channels in Requests's Channels property. * Implement setting presence before the connection is established. This allows salut to be used with mission control >= 5.2.2. * Make the "dnd" presence actually correspond to the correct telepathy presence type. telepathy-salut 0.3.9 (2009-04-02) ================================== The "My, what big branches you have, Grandma!" release. Enhancements: * Implement Connection.Interface.ContactCapabilities.DRAFT * Implement tube service specific contact capabilities. * Implement file transfer contact capabilities. * Implement Channel.Type.StreamTube.DRAFT Fixes: * As defined in the spec, {Accept,Provide}File should return an 'ay' and not a string as UNIX socket address. * Fix a crash with newer versions of libsoup * Fix file transfer over IPv6 (b.fd.o #19163) telepathy-salut 0.3.8 (2009-02-17) ================================== The "Thursday as if I walked in the dessert" release. Enhancements: * Switched to the stable version of the FileTransfer interface. Clients (Empathy, Sugar...) have to be modified to use the stable interface instead of the DRAFT one. Just the interface name has been renamed so changes should be trivial. Fixes: * Fix a crash when receiving an incoming XMPP connection from a IPv6 address. telepathy-salut 0.3.7 (2009-01-05) ================================== The "Post-Waffle Hibernation" release. Requirements: * libsoup-2.4 (instead of libsoup-2.2) Enhancements: * State of pending file transfer channels is now automatically changed to "Cancelled" if peer is disconnected. Fixes: * Uses libsoup 2.4 instead of the obsolete 2.2 version (b.fd.o #18891). * Don't crash if the XMPP connection is disconnected during a file transfer. * Fix a race in stream tubes causing potential data lost. * Fix various leaks including one leading to a crash (b.fd.o #19181). telepathy-salut 0.3.6 (2008-12-02) ================================== The "I accidentally 93MB of .rar files" release. Requirements: * glib >= 2.16 * dbus >= 1.1.0 * telepathy-glib >= 0.7.17 * libsoup-2.2 Enhancements: * Implement org.freedesktop.Telepathy.Channel.Type.FileTransfer.DRAFT. This means you can now send files to your Salut contacts. Current implementation uses OOB (XEP-0066) and is fully compatible with iChat. * All channels are now requestable using the new org.freedesktop.Telepathy.Connection.Interface.Requests interface. Fixes: * Assertion failed in gibber_multicast_transport_disconnect when closing a local pending room (b.fd.o #18552). telepathy-salut 0.3.5 (2008-09-17) ================================== The "Please don't flood my network" release. This release fixes an annoying bug causing Salut announcing all the OLPC activities which are present on the network. You should consider upgrading if they are OLPC XO's running on your network. Enhancements: * Add a test framework Fixes: * Only announce OLPC activity we actually joined (dev.laptop.org #8441) telepathy-salut 0.3.4 (2008-08-20) ================================== The "a ball of hair" release. Requirements: * telepathy-glib >= 0.7.14 Enhancements: * Implement the Contacts interface * Implement the SimplePresence interface * Implement spec 0.17.9 (Add various properties to all channels) telepathy-salut 0.3.3 (2008-06-05) ================================== This unstable release mainly brings an abstraction of the avahi layer making it easier to use different implementions of mdns or other completely different service discovery implementations. Furthermore various small bugfixes has been done and the complete code-base has been converted to telepathy coding style. telepathy-salut 0.3.2 (2008-04-09) ================================== This unstable release doesn't contain any new features or major changes but fixes various Clique and tube bugs. These are basically the same fixes as in the 0.2.3 stable release. telepathy-salut 0.3.1 (2008-02-15) ================================== This unstable release fixes few Clique crashers and some others issues. Most of these bugs were discovered thanks to hyperactivity, a collaboration stress testing tool we are developing for the OLPC project. This new version also introduces a new DNS resolver in Gibber but it's not used in Salut yet. telepathy-salut 0.3.0 (2008-01-08) ================================== This is the first release in the unstable 0.3 series. Apart from some small bugfixes this updates the Avatar interface to comply with the current telepathy spec and uses avahi-gobject instead of the internal avahi gobject wrappers. This means at least avahi 0.6.22 is needed for this version. As salut doesn't have persistent avatar storage, the clients need to ensure the avatar is set upon each connection. See sf bug #1825366 [0] for the suggested changes to telepathy-mission-control. [0] http://sourceforge.net/tracker/index.php?func=detail&aid=1825366&group_id=190214&atid=932444 telepathy-salut-0.8.1/missing0000755000175000017500000002415212051456037015745 0ustar00wjtwjt00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi 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' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-salut-0.8.1/Makefile.am0000644000175000017500000000104012050201776016366 0ustar00wjtwjt00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS = tools extensions lib src data m4 salut plugins tests docs DISTCHECK_CONFIGURE_FLAGS = --disable-debug --enable-gtk-doc valgrind: cd tests && $(MAKE) valgrind torture: cd tests && $(MAKE) torture forever: cd tests && $(MAKE) forever include $(top_srcdir)/rules/lcov.mak # There doesn't seem to be a telepathy-salut-0.4.0 tag! :o CHANGELOG_RANGE = 22651d24.. CHECK_FOR_UNRELEASED = \ $(srcdir)/NEWS \ $(wildcard $(srcdir)/salut/*.[ch]) \ $(wildcard $(srcdir)/src/*.[ch]) include tools/telepathy.am telepathy-salut-0.8.1/depcomp0000755000175000017500000005064312051456040015721 0ustar00wjtwjt00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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 outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" 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 ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" 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 ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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 -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. 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 "X$1" != 'X--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:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi 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. -arch) eat=yes ;; -*|$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" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 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 "X$1" != 'X--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. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # 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 ;; 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-salut-0.8.1/tools/0000755000175000017500000000000012051456451015502 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/tools/check-whitespace.sh0000644000175000017500000000032311605347146021247 0ustar00wjtwjt00000000000000#!/bin/sh fail=0 if grep -n ' $' "$@" then echo "^^^ The above files contain unwanted trailing spaces" fail=1 fi if grep -n ' ' "$@" then echo "^^^ The above files contain tabs" fail=1 fi exit $fail telepathy-salut-0.8.1/tools/glib-client-marshaller-gen.py0000644000175000017500000000272411622447311023147 0ustar00wjtwjt00000000000000#!/usr/bin/python import sys import xml.dom.minidom from string import ascii_letters, digits from libglibcodegen import signal_to_marshal_name NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix): self.dom = dom self.marshallers = {} self.prefix = prefix def do_signal(self, signal): marshaller = signal_to_marshal_name(signal, self.prefix) assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def __call__(self): signals = self.dom.getElementsByTagName('signal') for signal in signals: self.do_signal(signal) print 'void' print '%s_register_dbus_glib_marshallers (void)' % self.prefix print '{' all = self.marshallers.keys() all.sort() for marshaller in all: rhs = self.marshallers[marshaller] print ' dbus_g_object_register_marshaller (%s,' % marshaller print ' G_TYPE_NONE, /* return */' for type in rhs: print ' G_TYPE_%s,' % type.replace('VOID', 'NONE') print ' G_TYPE_INVALID);' print '}' def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) Generator(dom, argv[1])() telepathy-salut-0.8.1/tools/glib-interfaces-body-generator.xsl0000644000175000017500000000360111106006512024174 0ustar00wjtwjt00000000000000 GQuark _iface_quark_ (void) { static GQuark quark = 0; if (G_UNLIKELY (quark == 0)) { quark = g_quark_from_static_string (" "); } return quark; } telepathy-salut-0.8.1/tools/check-misc.sh0000644000175000017500000000036011605347146020047 0ustar00wjtwjt00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-whitespace.sh ) || fail=$? if egrep '(Free\s*Software\s*Foundation.*02139|02111-1307)' "$@" then echo "^^^ The above files contain the FSF's old address in GPL headers" fail=1 fi exit $fail telepathy-salut-0.8.1/tools/glib-signals-marshal-gen.py0000644000175000017500000000254111622447311022623 0ustar00wjtwjt00000000000000#!/usr/bin/python import sys import xml.dom.minidom from string import ascii_letters, digits from libglibcodegen import signal_to_marshal_name, method_to_glue_marshal_name class Generator(object): def __init__(self, dom): self.dom = dom self.marshallers = {} def do_method(self, method): marshaller = method_to_glue_marshal_name(method, 'PREFIX') assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def do_signal(self, signal): marshaller = signal_to_marshal_name(signal, 'PREFIX') assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def __call__(self): methods = self.dom.getElementsByTagName('method') for method in methods: self.do_method(method) signals = self.dom.getElementsByTagName('signal') for signal in signals: self.do_signal(signal) all = self.marshallers.keys() all.sort() for marshaller in all: rhs = self.marshallers[marshaller] if not marshaller.startswith('g_cclosure'): print 'VOID:' + ','.join(rhs) if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) Generator(dom)() telepathy-salut-0.8.1/tools/libglibcodegen.py0000644000175000017500000002447411605347700021020 0ustar00wjtwjt00000000000000"""Library code for GLib/D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006, 2007 Collabora Limited # # 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 from string import ascii_letters, digits NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" _ASCII_ALNUM = ascii_letters + digits def camelcase_to_lower(s): out =""; out += s[0].lower() last_upper=False if s[0].isupper(): last_upper=True for i in range(1,len(s)): if s[i].isupper(): if last_upper: if (i+1) < len(s) and s[i+1].islower(): out += "_" + s[i].lower() else: out += s[i].lower() else: out += "_" + s[i].lower() last_upper=True else: out += s[i] last_upper=False return out def camelcase_to_upper(s): return camelcase_to_lower(s).upper() def cmp_by_name(node1, node2): return cmp(node1.getAttributeNode("name").nodeValue, node2.getAttributeNode("name").nodeValue) def dbus_gutils_wincaps_to_uscore(s): """Bug-for-bug compatible Python port of _dbus_gutils_wincaps_to_uscore which gets sequences of capital letters wrong in the same way. (e.g. in Telepathy, SendDTMF -> send_dt_mf) """ ret = '' for c in s: if c >= 'A' and c <= 'Z': length = len(ret) if length > 0 and (length < 2 or ret[length-2] != '_'): ret += '_' ret += c.lower() else: ret += c return ret def escape_as_identifier(identifier): """Escape the given string to be a valid D-Bus object path or service name component, using a reversible encoding to ensure uniqueness. The reversible encoding is as follows: * The empty string becomes '_' * Otherwise, each non-alphanumeric character is replaced by '_' plus two lower-case hex digits; the same replacement is carried out on the first character, if it's a digit """ # '' -> '_' if not identifier: return '_' # A bit of a fast path for strings which are already OK. # We deliberately omit '_' because, for reversibility, that must also # be escaped. if (identifier.strip(_ASCII_ALNUM) == '' and identifier[0] in ascii_letters): return identifier # The first character may not be a digit if identifier[0] not in ascii_letters: ret = ['_%02x' % ord(identifier[0])] else: ret = [identifier[0]] # Subsequent characters may be digits or ASCII letters for c in identifier[1:]: if c in _ASCII_ALNUM: ret.append(c) else: ret.append('_%02x' % ord(c)) return ''.join(ret) def get_docstring(element): docstring = None for x in element.childNodes: if x.namespaceURI == NS_TP and x.localName == 'docstring': docstring = x if docstring is not None: docstring = docstring.toxml().replace('\n', ' ').strip() if docstring.startswith(''): docstring = docstring[14:].lstrip() if docstring.endswith(''): docstring = docstring[:-15].rstrip() if docstring in ('', ''): docstring = '' return docstring def signal_to_marshal_type(signal): """ return a list of strings indicating the marshalling type for this signal. """ mtype=[] for i in signal.getElementsByTagName("arg"): name =i.getAttribute("name") type = i.getAttribute("type") mtype.append(type_to_gtype(type)[2]) return mtype _glib_marshallers = ['VOID', 'BOOLEAN', 'CHAR', 'UCHAR', 'INT', 'STRING', 'UINT', 'LONG', 'ULONG', 'ENUM', 'FLAGS', 'FLOAT', 'DOUBLE', 'STRING', 'PARAM', 'BOXED', 'POINTER', 'OBJECT', 'UINT_POINTER'] def signal_to_marshal_name(signal, prefix): mtype = signal_to_marshal_type(signal) if len(mtype): name = '_'.join(mtype) else: name = 'VOID' if name in _glib_marshallers: return 'g_cclosure_marshal_VOID__' + name else: return prefix + '_marshal_VOID__' + name def method_to_glue_marshal_name(method, prefix): mtype = [] for i in method.getElementsByTagName("arg"): if i.getAttribute("direction") != "out": type = i.getAttribute("type") mtype.append(type_to_gtype(type)[2]) mtype.append('POINTER') name = '_'.join(mtype) if name in _glib_marshallers: return 'g_cclosure_marshal_VOID__' + name else: return prefix + '_marshal_VOID__' + name class _SignatureIter: """Iterator over a D-Bus signature. Copied from dbus-python 0.71 so we can run genginterface in a limited environment with only Python (like Scratchbox). """ def __init__(self, string): self.remaining = string def next(self): if self.remaining == '': raise StopIteration signature = self.remaining block_depth = 0 block_type = None end = len(signature) for marker in range(0, end): cur_sig = signature[marker] if cur_sig == 'a': pass elif cur_sig == '{' or cur_sig == '(': if block_type == None: block_type = cur_sig if block_type == cur_sig: block_depth = block_depth + 1 elif cur_sig == '}': if block_type == '{': block_depth = block_depth - 1 if block_depth == 0: end = marker break elif cur_sig == ')': if block_type == '(': block_depth = block_depth - 1 if block_depth == 0: end = marker break else: if block_depth == 0: end = marker break end = end + 1 self.remaining = signature[end:] return Signature(signature[0:end]) class Signature(str): """A string, iteration over which is by D-Bus single complete types rather than characters. """ def __iter__(self): return _SignatureIter(self) def type_to_gtype(s): if s == 'y': #byte return ("guchar ", "G_TYPE_UCHAR","UCHAR", False) elif s == 'b': #boolean return ("gboolean ", "G_TYPE_BOOLEAN","BOOLEAN", False) elif s == 'n': #int16 return ("gint ", "G_TYPE_INT","INT", False) elif s == 'q': #uint16 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'i': #int32 return ("gint ", "G_TYPE_INT","INT", False) elif s == 'u': #uint32 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'x': #int64 return ("gint64 ", "G_TYPE_INT64","INT64", False) elif s == 't': #uint64 return ("guint64 ", "G_TYPE_UINT64","UINT64", False) elif s == 'd': #double return ("gdouble ", "G_TYPE_DOUBLE","DOUBLE", False) elif s == 's': #string return ("gchar *", "G_TYPE_STRING", "STRING", True) elif s == 'g': #signature - FIXME return ("gchar *", "DBUS_TYPE_G_SIGNATURE", "STRING", True) elif s == 'o': #object path return ("gchar *", "DBUS_TYPE_G_OBJECT_PATH", "BOXED", True) elif s == 'v': #variant return ("GValue *", "G_TYPE_VALUE", "BOXED", True) elif s == 'as': #array of strings return ("gchar **", "G_TYPE_STRV", "BOXED", True) elif s == 'ay': #byte array return ("GArray *", "dbus_g_type_get_collection (\"GArray\", G_TYPE_UCHAR)", "BOXED", True) elif s == 'au': #uint array return ("GArray *", "DBUS_TYPE_G_UINT_ARRAY", "BOXED", True) elif s == 'ai': #int array return ("GArray *", "DBUS_TYPE_G_INT_ARRAY", "BOXED", True) elif s == 'ax': #int64 array return ("GArray *", "DBUS_TYPE_G_INT64_ARRAY", "BOXED", True) elif s == 'at': #uint64 array return ("GArray *", "DBUS_TYPE_G_UINT64_ARRAY", "BOXED", True) elif s == 'ad': #double array return ("GArray *", "DBUS_TYPE_G_DOUBLE_ARRAY", "BOXED", True) elif s == 'ab': #boolean array return ("GArray *", "DBUS_TYPE_G_BOOLEAN_ARRAY", "BOXED", True) elif s == 'ao': #object path array return ("GPtrArray *", "DBUS_TYPE_G_OBJECT_ARRAY", "BOXED", True) elif s == 'a{ss}': #hash table of string to string return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) elif s[:2] == 'a{': #some arbitrary hash tables if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): raise Exception, "can't index a hashtable off non-basic type " + s first = type_to_gtype(s[2]) second = type_to_gtype(s[3:-1]) return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) elif s[:2] in ('a(', 'aa'): # array of structs or arrays, recurse gtype = type_to_gtype(s[1:])[1] return ("GPtrArray *", "(dbus_g_type_get_collection (\"GPtrArray\", "+gtype+"))", "BOXED", True) elif s[:1] == '(': #struct gtype = "(dbus_g_type_get_struct (\"GValueArray\", " for subsig in Signature(s[1:-1]): gtype = gtype + type_to_gtype(subsig)[1] + ", " gtype = gtype + "G_TYPE_INVALID))" return ("GValueArray *", gtype, "BOXED", True) # we just don't know .. raise Exception, "don't know the GType for " + s def xml_escape(s): s = s.replace('&', '&').replace("'", ''').replace('"', '"') return s.replace('<', '<').replace('>', '>') telepathy-salut-0.8.1/tools/check-c-style.sh0000644000175000017500000000376412050201776020500 0ustar00wjtwjt00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-misc.sh ) || fail=$? if grep -n '^ *GError *\*[[:alpha:]_][[:alnum:]_]* *;' "$@" then echo "^^^ The above files contain uninitialized GError*s - they should be" echo " initialized to NULL" fail=1 fi # The first regex finds function calls like foo() (as opposed to foo ()). # It attempts to ignore string constants (may cause false negatives). # The second and third ignore block comments (gtkdoc uses foo() as markup). # The fourth ignores cpp so you can # #define foo(bar) (_real_foo (__FUNC__, bar)) (cpp insists on foo() style). if grep -n '^[^"]*[[:lower:]](' "$@" \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: */\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *#' then echo "^^^ Our coding style is to use function calls like foo (), not foo()" fail=1 fi if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then echo "^^^ Our coding style is to have a space between a cast and the " echo " thing being cast" fail=1 fi # this only spots casts if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 1)" fail=1 fi # ... and this only spots variable declarations and function return types if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \ "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 2)" fail=1 fi if grep -n 'g_hash_table_destroy' "$@"; then echo "^^^ Our coding style is to use g_hash_table_unref" fail=1 fi for p in "" "ptr_" "byte_"; do if grep -En "g_${p}array_free \(([^ ,]+), TRUE\)" "$@"; then echo "^^^ Our coding style is to use g_${p}array_unref in the case " echo " the underlying C array is not used" fail=1 fi done if test -n "$CHECK_FOR_LONG_LINES" then if egrep -n '.{80,}' "$@" then echo "^^^ The above files contain long lines" fail=1 fi fi exit $fail telepathy-salut-0.8.1/tools/glib-interfaces-generator.xsl0000644000175000017500000000437411106006512023251 0ustar00wjtwjt00000000000000 /** * _IFACE_QUARK_ : * * Expands to a call to a function that returns a quark for the interface name " " */ #define _IFACE_QUARK_ \ ( _iface_quark_ ()) GQuark _iface_quark_ (void); telepathy-salut-0.8.1/tools/Makefile.am0000644000175000017500000000256612050201776017544 0ustar00wjtwjt00000000000000EXTRA_DIST = \ c-constants-generator.xsl \ c-interfaces-generator.xsl \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ doc-generator.xsl \ glib-client-marshaller-gen.py \ glib-errors-enum-body.xsl \ glib-errors-enum-header.xsl \ glib-interfaces-generator.xsl \ glib-interfaces-body-generator.xsl \ glib-ginterface-gen.py \ glib-gtypes-generator.py \ glib-signals-marshal-gen.py \ identity.xsl \ libglibcodegen.py \ make-release-mail.py \ telepathy.am \ xep.xsl glib-client-marshaller-gen.py: libglibcodegen.py @touch $@ glib-ginterface-gen.py: libglibcodegen.py @touch $@ glib-gtypes-generator.py: libglibcodegen.py @touch $@ glib-signals-marshal-gen.py: libglibcodegen.py @touch $@ glib-interfaces-generator.xsl: c-interfaces-generator.xsl @touch $@ glib-interfaces-body-generator.xsl: c-interfaces-generator.xsl @touch $@ maintainer-update-from-xmpp.org: set -e; \ uri=svn://svn.xmpp.org:7938/xmpp/trunk/extensions/xep.xsl; \ svn info $$uri; \ svn cat $$uri > xep.xsl.tmp mv xep.xsl.tmp xep.xsl TELEPATHY_GLIB_SRCDIR = $(top_srcdir)/../telepathy-glib maintainer-update-from-telepathy-glib: set -e && cd $(srcdir) && \ for x in $(EXTRA_DIST); do \ if test -f $(TELEPATHY_GLIB_SRCDIR)/tools/$$x; then \ cp $(TELEPATHY_GLIB_SRCDIR)/tools/$$x $$x; \ fi; \ done telepathy-salut-0.8.1/tools/xep.xsl0000644000175000017500000011565511106006512017030 0ustar00wjtwjt00000000000000 XEP-<xsl:value-of select='/xep/header/number'/>:<xsl:text> </xsl:text><xsl:value-of select='/xep/header/title' /> DC.Title DC.Description DC.Publisher XMPP Standards Foundation DC.Contributor XMPP Extensions Editor DC.Date DC.Type XMPP Extension Protocol DC.Format XHTML DC.Identifier XEP- DC.Language en DC.Rights

XEP-:


NOTICE: This Historical specification provides canonical documentation of a protocol that is in use within the Jabber/XMPP community. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it may be converted to standards-track in the future or may be obsoleted by a more modern protocol.

NOTICE: This document is Humorous. It MAY provide amusement but SHOULD NOT be taken seriously.

NOTICE: This Informational specification defines a best practice or protocol profile that has been approved by the XMPP Council and/or the XSF Board of Directors. Implementations are encouraged and the best practice or protocol profile is appropriate for deployment in production systems.

NOTICE: This Procedural document defines a process or activity of the XMPP Standards Foundation (XSF) that has been approved by the XMPP Council and/or the XSF Board of Directors. The XSF is currently following the process or activity defined herein and will do so until this document is deprecated or obsoleted.

WARNING: Consideration of this document has been Deferred by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended.

WARNING: This document has been deprecated by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality should implement the protocol that supersedes this one (if any).

NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.

NOTICE: This Historical document attempts to provide canonical documentation of a protocol that is in use within the Jabber/XMPP community. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it may be converted to standards-track in the future or may be obsoleted by a more modern protocol.

WARNING: This Informational document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the best practice or protocol profile described herein is encouraged in exploratory implementations, although production systems should not deploy implementations of this protocol until it advances to a status of Draft.

NOTICE: This Procedural document proposes that the process or activity defined herein shall be followed by the XMPP Standards Foundation (XSF). However, this process or activity has not yet been approved by the XMPP Council and/or the XSF Board of Directors and is therefore not currently in force.

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.

NOTICE: The protocol defined herein is a Final Standard of the XMPP Standards Foundation and may be considered a stable technology for implementation and deployment.

WARNING: This document has been obsoleted by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality should implement the protocol that supersedes this one (if any).

NOTICE: This document is currently within Last Call or under consideration by the XMPP Council for advancement to the next stage in the XSF standards process.

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document must not be referred to as an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <http://www.xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.

WARNING: This document has been Rejected by the XMPP Council. Implementation of the protocol described herein is not recommended under any circumstances.

WARNING: This document has been retracted by the author(s). Implementation of the protocol described herein is not recommended. Developers desiring similar functionality should implement the protocol that supersedes this one (if any).


Document Information

Series: XEP
Number:
Publisher: XMPP Standards Foundation
Status: http://www.xmpp.org/extensions/xep-0001.html#states-
Type: http://www.xmpp.org/extensions/xep-0001.html#types-
Version:
Last Updated:
Expires:
Approving Body: XSF Board of Directors
Approving Body: XMPP Council
Dependencies:
Dependencies: None
Supersedes:
Supersedes: None
Superseded By:
Superseded By: None
Short Name:
Registry: http://www.xmpp.org/registrar/ .html <>
http://wiki.jabber.org/index.php/ (XEP- ) Wiki Page: <>


Author Information



Discussion Venue

The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.

Discussion by the membership of the XSF may also be appropriate (see <http://mail.jabber.org/mailman/listinfo/members> for details).

The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.

Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the XSF-IETF list may also be appropriate (see <http://mail.jabber.org/mailman/listinfo/jsf-ietf> for details).

Errata may be sent to <editor@xmpp.org>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".




Notes


Revision History


END

Table of Contents

DC.Creator

See Author Note
Organization:
Email: mailto:
JabberID: xmpp:
URI:

Legal Notices

Copyright

Permissions

Disclaimer of Warranty

Limitation of Liability

IPR Conformance

, XML Schema for namespace: <>
Schema: <>

Version ()

()
.
# sect-

. sect-

.
    # sect-
.
       # sect-
.
         # sect-

  • example-Example .

    table-Table :

    [ ]

    .

    telepathy-salut-0.8.1/tools/doc-generator.xsl0000644000175000017500000006237711605347674021014 0ustar00wjtwjt00000000000000

    Errors

    Generic types

    Simple types

    Enumerated types:

    Sets of flags:

    Structure types

    Mapping types

    Types defined elsewhere

    This interface is and is likely to cause havoc to your API/ABI if bindings are generated. Don't include it in libraries that care about compatibility.

    Implementations of this interface must also implement:

    Methods:

    Interface has no methods.

    Signals:

    Interface has no signals.

    Telepathy Properties:

    Accessed using the Telepathy Properties interface.

    Interface has no Telepathy properties.

    D-Bus core Properties:

    Accessed using the org.freedesktop.DBus.Properties interface.

    Interface has no D-Bus core properties.

    =
    (Undocumented)

    =
    (Undocumented)
    - , read-only write-only read/write access:
    -

    - a{ : }

    In bindings that need a separate name, arrays of should be called .

    Members

    -

    -

    -
    Defined by:
    - ( , ) - a{ }

    - ( : , )

    In bindings that need a separate name, arrays of should be called .

    Arrays of don't generally make sense.

    Members

    ( : , ) → , nothing

    Parameters

    Returns

    Possible errors

    ERR: Unable to find type ' ' ()
    -
    (undocumented)
    -
    -
    (generic description) (Undocumented.)

    ( : , )

    Parameters

    <xsl:value-of select="tp:title"/> <xsl:if test="tp:version"> <xsl:text> version </xsl:text> <xsl:value-of select="tp:version"/> </xsl:if>

    Version

    Interfaces

    Index

    Index of interfaces

    Index of types

    telepathy-salut-0.8.1/tools/glib-ginterface-gen.py0000644000175000017500000006305611622447311021655 0ustar00wjtwjt00000000000000#!/usr/bin/python # glib-ginterface-gen.py: service-side interface generator # # Generate dbus-glib 0.x service GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # 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 import sys import os.path import xml.dom.minidom from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ camelcase_to_lower, NS_TP, dbus_gutils_wincaps_to_uscore, \ signal_to_marshal_name, method_to_glue_marshal_name NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix, basename, signal_marshal_prefix, headers, end_headers, not_implemented_func, allow_havoc): self.dom = dom self.__header = [] self.__body = [] assert prefix.endswith('_') assert not signal_marshal_prefix.endswith('_') # The main_prefix, sub_prefix thing is to get: # FOO_ -> (FOO_, _) # FOO_SVC_ -> (FOO_, _SVC_) # but # FOO_BAR/ -> (FOO_BAR_, _) # FOO_BAR/SVC_ -> (FOO_BAR_, _SVC_) if '/' in prefix: main_prefix, sub_prefix = prefix.upper().split('/', 1) prefix = prefix.replace('/', '_') else: main_prefix, sub_prefix = prefix.upper().split('_', 1) self.MAIN_PREFIX_ = main_prefix + '_' self._SUB_PREFIX_ = '_' + sub_prefix self.Prefix_ = prefix self.Prefix = prefix.replace('_', '') self.prefix_ = prefix.lower() self.PREFIX_ = prefix.upper() self.signal_marshal_prefix = signal_marshal_prefix self.headers = headers self.end_headers = end_headers self.not_implemented_func = not_implemented_func self.allow_havoc = allow_havoc def h(self, s): self.__header.append(s) def b(self, s): self.__body.append(s) def do_node(self, node): node_name = node.getAttribute('name').replace('/', '') node_name_mixed = self.node_name_mixed = node_name.replace('_', '') node_name_lc = self.node_name_lc = node_name.lower() node_name_uc = self.node_name_uc = node_name.upper() interfaces = node.getElementsByTagName('interface') assert len(interfaces) == 1, interfaces interface = interfaces[0] self.iface_name = interface.getAttribute('name') tmp = interface.getAttribute('tp:implement-service') if tmp == "no": return tmp = interface.getAttribute('tp:causes-havoc') if tmp and not self.allow_havoc: raise AssertionError('%s is %s' % (self.iface_name, tmp)) self.b('static const DBusGObjectInfo _%s%s_object_info;' % (self.prefix_, node_name_lc)) self.b('') methods = interface.getElementsByTagName('method') signals = interface.getElementsByTagName('signal') properties = interface.getElementsByTagName('property') # Don't put properties in dbus-glib glue glue_properties = [] self.b('struct _%s%sClass {' % (self.Prefix, node_name_mixed)) self.b(' GTypeInterface parent_class;') for method in methods: self.b(' %s %s;' % self.get_method_impl_names(method)) self.b('};') self.b('') if signals: self.b('enum {') for signal in signals: self.b(' %s,' % self.get_signal_const_entry(signal)) self.b(' N_%s_SIGNALS' % node_name_uc) self.b('};') self.b('static guint %s_signals[N_%s_SIGNALS] = {0};' % (node_name_lc, node_name_uc)) self.b('') self.b('static void %s%s_base_init (gpointer klass);' % (self.prefix_, node_name_lc)) self.b('') self.b('GType') self.b('%s%s_get_type (void)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static GType type = 0;') self.b('') self.b(' if (G_UNLIKELY (type == 0))') self.b(' {') self.b(' static const GTypeInfo info = {') self.b(' sizeof (%s%sClass),' % (self.Prefix, node_name_mixed)) self.b(' %s%s_base_init, /* base_init */' % (self.prefix_, node_name_lc)) self.b(' NULL, /* base_finalize */') self.b(' NULL, /* class_init */') self.b(' NULL, /* class_finalize */') self.b(' NULL, /* class_data */') self.b(' 0,') self.b(' 0, /* n_preallocs */') self.b(' NULL /* instance_init */') self.b(' };') self.b('') self.b(' type = g_type_register_static (G_TYPE_INTERFACE,') self.b(' "%s%s", &info, 0);' % (self.Prefix, node_name_mixed)) self.b(' }') self.b('') self.b(' return type;') self.b('}') self.b('') self.h('/**') self.h(' * %s%s:' % (self.Prefix, node_name_mixed)) self.h(' *') self.h(' * Dummy typedef representing any implementation of this ' 'interface.') self.h(' */') self.h('typedef struct _%s%s %s%s;' % (self.Prefix, node_name_mixed, self.Prefix, node_name_mixed)) self.h('') self.h('/**') self.h(' * %s%sClass:' % (self.Prefix, node_name_mixed)) self.h(' *') self.h(' * The class of %s%s.' % (self.Prefix, node_name_mixed)) self.h(' */') self.h('typedef struct _%s%sClass %s%sClass;' % (self.Prefix, node_name_mixed, self.Prefix, node_name_mixed)) self.h('') self.h('GType %s%s_get_type (void);' % (self.prefix_, node_name_lc)) gtype = self.current_gtype = \ self.MAIN_PREFIX_ + 'TYPE' + self._SUB_PREFIX_ + node_name_uc classname = self.Prefix + node_name_mixed self.h('#define %s \\\n (%s%s_get_type ())' % (gtype, self.prefix_, node_name_lc)) self.h('#define %s%s(obj) \\\n' ' (G_TYPE_CHECK_INSTANCE_CAST((obj), %s, %s))' % (self.PREFIX_, node_name_uc, gtype, classname)) self.h('#define %sIS%s%s(obj) \\\n' ' (G_TYPE_CHECK_INSTANCE_TYPE((obj), %s))' % (self.MAIN_PREFIX_, self._SUB_PREFIX_, node_name_uc, gtype)) self.h('#define %s%s_GET_CLASS(obj) \\\n' ' (G_TYPE_INSTANCE_GET_INTERFACE((obj), %s, %sClass))' % (self.PREFIX_, node_name_uc, gtype, classname)) self.h('') self.h('') base_init_code = [] for method in methods: self.do_method(method) for signal in signals: base_init_code.extend(self.do_signal(signal)) self.b('static inline void') self.b('%s%s_base_init_once (gpointer klass G_GNUC_UNUSED)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static TpDBusPropertiesMixinPropInfo properties[%d] = {' % (len(properties) + 1)) for m in properties: access = m.getAttribute('access') assert access in ('read', 'write', 'readwrite') if access == 'read': flags = 'TP_DBUS_PROPERTIES_MIXIN_FLAG_READ' elif access == 'write': flags = 'TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE' else: flags = ('TP_DBUS_PROPERTIES_MIXIN_FLAG_READ | ' 'TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE') self.b(' { 0, %s, "%s", 0, NULL, NULL }, /* %s */' % (flags, m.getAttribute('type'), m.getAttribute('name'))) self.b(' { 0, 0, NULL, 0, NULL, NULL }') self.b(' };') self.b(' static TpDBusPropertiesMixinIfaceInfo interface =') self.b(' { 0, properties, NULL, NULL };') self.b('') self.b(' interface.dbus_interface = g_quark_from_static_string ' '("%s");' % self.iface_name) for i, m in enumerate(properties): self.b(' properties[%d].name = g_quark_from_static_string ("%s");' % (i, m.getAttribute('name'))) self.b(' properties[%d].type = %s;' % (i, type_to_gtype(m.getAttribute('type'))[1])) self.b(' tp_svc_interface_set_dbus_properties_info (%s, &interface);' % self.current_gtype) self.b('') for s in base_init_code: self.b(s) self.b(' dbus_g_object_type_install_info (%s%s_get_type (),' % (self.prefix_, node_name_lc)) self.b(' &_%s%s_object_info);' % (self.prefix_, node_name_lc)) self.b('}') self.b('static void') self.b('%s%s_base_init (gpointer klass)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static gboolean initialized = FALSE;') self.b('') self.b(' if (!initialized)') self.b(' {') self.b(' initialized = TRUE;') self.b(' %s%s_base_init_once (klass);' % (self.prefix_, node_name_lc)) self.b(' }') # insert anything we need to do per implementation here self.b('}') self.h('') self.b('static const DBusGMethodInfo _%s%s_methods[] = {' % (self.prefix_, node_name_lc)) method_blob, offsets = self.get_method_glue(methods) for method, offset in zip(methods, offsets): self.do_method_glue(method, offset) self.b('};') self.b('') self.b('static const DBusGObjectInfo _%s%s_object_info = {' % (self.prefix_, node_name_lc)) self.b(' 0,') # version self.b(' _%s%s_methods,' % (self.prefix_, node_name_lc)) self.b(' %d,' % len(methods)) self.b('"' + method_blob.replace('\0', '\\0') + '",') self.b('"' + self.get_signal_glue(signals).replace('\0', '\\0') + '",') self.b('"' + self.get_property_glue(glue_properties).replace('\0', '\\0') + '",') self.b('};') self.b('') self.node_name_mixed = None self.node_name_lc = None self.node_name_uc = None def get_method_glue(self, methods): info = [] offsets = [] for method in methods: offsets.append(len(''.join(info))) info.append(self.iface_name + '\0') info.append(method.getAttribute('name') + '\0') info.append('A\0') # async counter = 0 for arg in method.getElementsByTagName('arg'): out = arg.getAttribute('direction') == 'out' name = arg.getAttribute('name') if not name: assert out name = 'arg%u' % counter counter += 1 info.append(name + '\0') if out: info.append('O\0') else: info.append('I\0') if out: info.append('F\0') # not const info.append('N\0') # not error or return info.append(arg.getAttribute('type') + '\0') info.append('\0') return ''.join(info) + '\0', offsets def do_method_glue(self, method, offset): lc_name = camelcase_to_lower(method.getAttribute('name')) marshaller = method_to_glue_marshal_name(method, self.signal_marshal_prefix) wrapper = self.prefix_ + self.node_name_lc + '_' + lc_name self.b(" { (GCallback) %s, %s, %d }," % (wrapper, marshaller, offset)) def get_signal_glue(self, signals): info = [] for signal in signals: info.append(self.iface_name) info.append(signal.getAttribute('name')) return '\0'.join(info) + '\0\0' # the implementation can be the same get_property_glue = get_signal_glue def get_method_impl_names(self, method): dbus_method_name = method.getAttribute('name') class_member_name = camelcase_to_lower(dbus_method_name) stub_name = (self.prefix_ + self.node_name_lc + '_' + class_member_name) return (stub_name + '_impl', class_member_name) def do_method(self, method): assert self.node_name_mixed is not None in_class = [] # Examples refer to Thing.DoStuff (su) -> ii # DoStuff dbus_method_name = method.getAttribute('name') # do_stuff class_member_name = camelcase_to_lower(dbus_method_name) # void tp_svc_thing_do_stuff (TpSvcThing *, const char *, guint, # DBusGMethodInvocation *); stub_name = (self.prefix_ + self.node_name_lc + '_' + class_member_name) # typedef void (*tp_svc_thing_do_stuff_impl) (TpSvcThing *, # const char *, guint, DBusGMethodInvocation); impl_name = stub_name + '_impl' # void tp_svc_thing_return_from_do_stuff (DBusGMethodInvocation *, # gint, gint); ret_name = (self.prefix_ + self.node_name_lc + '_return_from_' + class_member_name) # Gather arguments in_args = [] out_args = [] for i in method.getElementsByTagName('arg'): name = i.getAttribute('name') direction = i.getAttribute('direction') or 'in' dtype = i.getAttribute('type') assert direction in ('in', 'out') if name: name = direction + '_' + name elif direction == 'in': name = direction + str(len(in_args)) else: name = direction + str(len(out_args)) ctype, gtype, marshaller, pointer = type_to_gtype(dtype) if pointer: ctype = 'const ' + ctype struct = (ctype, name) if direction == 'in': in_args.append(struct) else: out_args.append(struct) # Implementation type declaration (in header, docs in body) self.b('/**') self.b(' * %s:' % impl_name) self.b(' * @self: The object implementing this interface') for (ctype, name) in in_args: self.b(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.b(' * @context: Used to return values or throw an error') self.b(' *') self.b(' * The signature of an implementation of the D-Bus method') self.b(' * %s on interface %s.' % (dbus_method_name, self.iface_name)) self.b(' */') self.h('typedef void (*%s) (%s%s *self,' % (impl_name, self.Prefix, self.node_name_mixed)) for (ctype, name) in in_args: self.h(' %s%s,' % (ctype, name)) self.h(' DBusGMethodInvocation *context);') # Class member (in class definition) in_class.append(' %s %s;' % (impl_name, class_member_name)) # Stub definition (in body only - it's static) self.b('static void') self.b('%s (%s%s *self,' % (stub_name, self.Prefix, self.node_name_mixed)) for (ctype, name) in in_args: self.b(' %s%s,' % (ctype, name)) self.b(' DBusGMethodInvocation *context)') self.b('{') self.b(' %s impl = (%s%s_GET_CLASS (self)->%s);' % (impl_name, self.PREFIX_, self.node_name_uc, class_member_name)) self.b('') self.b(' if (impl != NULL)') tmp = ['self'] + [name for (ctype, name) in in_args] + ['context'] self.b(' {') self.b(' (impl) (%s);' % ',\n '.join(tmp)) self.b(' }') self.b(' else') self.b(' {') if self.not_implemented_func: self.b(' %s (context);' % self.not_implemented_func) else: self.b(' GError e = { DBUS_GERROR, ') self.b(' DBUS_GERROR_UNKNOWN_METHOD,') self.b(' "Method not implemented" };') self.b('') self.b(' dbus_g_method_return_error (context, &e);') self.b(' }') self.b('}') self.b('') # Implementation registration (in both header and body) self.h('void %s%s_implement_%s (%s%sClass *klass, %s impl);' % (self.prefix_, self.node_name_lc, class_member_name, self.Prefix, self.node_name_mixed, impl_name)) self.b('/**') self.b(' * %s%s_implement_%s:' % (self.prefix_, self.node_name_lc, class_member_name)) self.b(' * @klass: A class whose instances implement this interface') self.b(' * @impl: A callback used to implement the %s D-Bus method' % dbus_method_name) self.b(' *') self.b(' * Register an implementation for the %s method in the vtable' % dbus_method_name) self.b(' * of an implementation of this interface. To be called from') self.b(' * the interface init function.') self.b(' */') self.b('void') self.b('%s%s_implement_%s (%s%sClass *klass, %s impl)' % (self.prefix_, self.node_name_lc, class_member_name, self.Prefix, self.node_name_mixed, impl_name)) self.b('{') self.b(' klass->%s = impl;' % class_member_name) self.b('}') self.b('') # Return convenience function (static inline, in header) self.h('/**') self.h(' * %s:' % ret_name) self.h(' * @context: The D-Bus method invocation context') for (ctype, name) in out_args: self.h(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.h(' *') self.h(' * Return successfully by calling dbus_g_method_return().') self.h(' * This inline function exists only to provide type-safety.') self.h(' */') tmp = (['DBusGMethodInvocation *context'] + [ctype + name for (ctype, name) in out_args]) self.h('static inline') self.h('/* this comment is to stop gtkdoc realising this is static */') self.h(('void %s (' % ret_name) + (',\n '.join(tmp)) + ');') self.h('static inline void') self.h(('%s (' % ret_name) + (',\n '.join(tmp)) + ')') self.h('{') tmp = ['context'] + [name for (ctype, name) in out_args] self.h(' dbus_g_method_return (' + ',\n '.join(tmp) + ');') self.h('}') self.h('') return in_class def get_signal_const_entry(self, signal): assert self.node_name_uc is not None return ('SIGNAL_%s_%s' % (self.node_name_uc, signal.getAttribute('name'))) def do_signal(self, signal): assert self.node_name_mixed is not None in_base_init = [] # for signal: Thing::StuffHappened (s, u) # we want to emit: # void tp_svc_thing_emit_stuff_happened (gpointer instance, # const char *arg0, guint arg1); dbus_name = signal.getAttribute('name') stub_name = (self.prefix_ + self.node_name_lc + '_emit_' + camelcase_to_lower(dbus_name)) const_name = self.get_signal_const_entry(signal) # Gather arguments args = [] for i in signal.getElementsByTagName('arg'): name = i.getAttribute('name') dtype = i.getAttribute('type') tp_type = i.getAttribute('tp:type') if name: name = 'arg_' + name else: name = 'arg' + str(len(args)) ctype, gtype, marshaller, pointer = type_to_gtype(dtype) if pointer: ctype = 'const ' + ctype struct = (ctype, name, gtype) args.append(struct) tmp = (['gpointer instance'] + [ctype + name for (ctype, name, gtype) in args]) self.h(('void %s (' % stub_name) + (',\n '.join(tmp)) + ');') # FIXME: emit docs self.b('/**') self.b(' * %s:' % stub_name) self.b(' * @instance: The object implementing this interface') for (ctype, name, gtype) in args: self.b(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.b(' *') self.b(' * Type-safe wrapper around g_signal_emit to emit the') self.b(' * %s signal on interface %s.' % (dbus_name, self.iface_name)) self.b(' */') self.b('void') self.b(('%s (' % stub_name) + (',\n '.join(tmp)) + ')') self.b('{') self.b(' g_assert (instance != NULL);') self.b(' g_assert (G_TYPE_CHECK_INSTANCE_TYPE (instance, %s));' % (self.current_gtype)) tmp = (['instance', '%s_signals[%s]' % (self.node_name_lc, const_name), '0'] + [name for (ctype, name, gtype) in args]) self.b(' g_signal_emit (' + ',\n '.join(tmp) + ');') self.b('}') self.b('') in_base_init.append(' %s_signals[%s] =' % (self.node_name_lc, const_name)) in_base_init.append(' g_signal_new ("%s",' % (dbus_gutils_wincaps_to_uscore(dbus_name).replace('_', '-'))) in_base_init.append(' G_OBJECT_CLASS_TYPE (klass),') in_base_init.append(' G_SIGNAL_RUN_LAST|G_SIGNAL_DETAILED,') in_base_init.append(' 0,') in_base_init.append(' NULL, NULL,') in_base_init.append(' %s,' % signal_to_marshal_name(signal, self.signal_marshal_prefix)) in_base_init.append(' G_TYPE_NONE,') tmp = ['%d' % len(args)] + [gtype for (ctype, name, gtype) in args] in_base_init.append(' %s);' % ',\n '.join(tmp)) in_base_init.append('') return in_base_init def __call__(self): self.h('#include ') self.h('#include ') self.h('#include ') self.h('') self.h('G_BEGIN_DECLS') self.h('') self.b('#include "%s.h"' % basename) self.b('') for header in self.headers: self.b('#include %s' % header) self.b('') nodes = self.dom.getElementsByTagName('node') nodes.sort(cmp_by_name) for node in nodes: self.do_node(node) self.h('') self.h('G_END_DECLS') self.b('') for header in self.end_headers: self.b('#include %s' % header) self.h('') self.b('') open(basename + '.h', 'w').write('\n'.join(self.__header)) open(basename + '.c', 'w').write('\n'.join(self.__body)) def cmdline_error(): print """\ usage: gen-ginterface [OPTIONS] xmlfile Prefix_ options: --include='' (may be repeated) --include='"header.h"' (ditto) --include-end='"header.h"' (ditto) Include extra headers in the generated .c file --signal-marshal-prefix='prefix' Use the given prefix on generated signal marshallers (default is prefix.lower()). --filename='BASENAME' Set the basename for the output files (default is prefix.lower() + 'ginterfaces') --not-implemented-func='symbol' Set action when methods not implemented in the interface vtable are called. symbol must have signature void symbol (DBusGMethodInvocation *context) and return some sort of "not implemented" error via dbus_g_method_return_error (context, ...) """ sys.exit(1) if __name__ == '__main__': from getopt import gnu_getopt options, argv = gnu_getopt(sys.argv[1:], '', ['filename=', 'signal-marshal-prefix=', 'include=', 'include-end=', 'allow-unstable', 'not-implemented-func=']) try: prefix = argv[1] except IndexError: cmdline_error() basename = prefix.lower() + 'ginterfaces' signal_marshal_prefix = prefix.lower().rstrip('_') headers = [] end_headers = [] not_implemented_func = '' allow_havoc = False for option, value in options: if option == '--filename': basename = value elif option == '--signal-marshal-prefix': signal_marshal_prefix = value elif option == '--include': if value[0] not in '<"': value = '"%s"' % value headers.append(value) elif option == '--include-end': if value[0] not in '<"': value = '"%s"' % value end_headers.append(value) elif option == '--not-implemented-func': not_implemented_func = value elif option == '--allow-unstable': allow_havoc = True try: dom = xml.dom.minidom.parse(argv[0]) except IndexError: cmdline_error() Generator(dom, prefix, basename, signal_marshal_prefix, headers, end_headers, not_implemented_func, allow_havoc)() telepathy-salut-0.8.1/tools/glib-errors-enum-header.xsl0000644000175000017500000000466511106006512022651 0ustar00wjtwjt00000000000000 * @TP_ERROR_: : * TP_ERROR_, /* Generated from the Telepathy spec */ #include <glib-object.h> G_BEGIN_DECLS GType tp_error_get_type (void); /** * TP_TYPE_ERROR: * * The GType of the Telepathy error enumeration. */ #define TP_TYPE_ERROR (tp_error_get_type()) /** * TpError: * * Enumerated type representing the Telepathy D-Bus errors. */ typedef enum { } TpError; G_END_DECLS telepathy-salut-0.8.1/tools/c-interfaces-generator.xsl0000644000175000017500000000605611106006512022555 0ustar00wjtwjt00000000000000 /** * _IFACE_ : * * The interface name " " */ #define _IFACE_ \ " " mixed-case-prefix param must be set /* Generated from: version */ telepathy-salut-0.8.1/tools/check-coding-style.mk0000644000175000017500000000076412050201776021513 0ustar00wjtwjt00000000000000check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \ exit "$$fail";\ else \ exit 0;\ fi telepathy-salut-0.8.1/tools/glib-gtypes-generator.py0000644000175000017500000002366711622447311022302 0ustar00wjtwjt00000000000000#!/usr/bin/python # Generate GLib GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # 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 import sys import xml.dom.minidom from libglibcodegen import escape_as_identifier, \ get_docstring, \ NS_TP, \ Signature, \ type_to_gtype, \ xml_escape def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] class GTypesGenerator(object): def __init__(self, dom, output, mixed_case_prefix): self.dom = dom self.Prefix = mixed_case_prefix self.PREFIX_ = self.Prefix.upper() + '_' self.prefix_ = self.Prefix.lower() + '_' self.header = open(output + '.h', 'w') self.body = open(output + '-body.h', 'w') for f in (self.header, self.body): f.write('/* Auto-generated, do not edit.\n *\n' ' * This file may be distributed under the same terms\n' ' * as the specification from which it was generated.\n' ' */\n\n') self.need_mappings = {} self.need_structs = {} self.need_arrays = {} def do_mapping_header(self, mapping): members = mapping.getElementsByTagNameNS(NS_TP, 'member') assert len(members) == 2 impl_sig = ''.join([elt.getAttribute('type') for elt in members]) esc_impl_sig = escape_as_identifier(impl_sig) name = (self.PREFIX_ + 'HASH_TYPE_' + mapping.getAttribute('name').upper()) impl = self.prefix_ + 'type_dbus_hash_' + esc_impl_sig docstring = get_docstring(mapping) or '(Undocumented)' self.header.write('/**\n * %s:\n *\n' % name) self.header.write(' * %s\n' % xml_escape(docstring)) self.header.write(' *\n') self.header.write(' * This macro expands to a call to a function\n') self.header.write(' * that returns the #GType of a #GHashTable\n') self.header.write(' * appropriate for representing a D-Bus\n') self.header.write(' * dictionary of signature\n') self.header.write(' * a{%s}.\n' % impl_sig) self.header.write(' *\n') key, value = members self.header.write(' * Keys (D-Bus type %s,\n' % key.getAttribute('type')) tp_type = key.getAttributeNS(NS_TP, 'type') if tp_type: self.header.write(' * type %s,\n' % tp_type) self.header.write(' * named %s):\n' % key.getAttribute('name')) docstring = get_docstring(key) or '(Undocumented)' self.header.write(' * %s\n' % xml_escape(docstring)) self.header.write(' *\n') self.header.write(' * Values (D-Bus type %s,\n' % value.getAttribute('type')) tp_type = value.getAttributeNS(NS_TP, 'type') if tp_type: self.header.write(' * type %s,\n' % tp_type) self.header.write(' * named %s):\n' % value.getAttribute('name')) docstring = get_docstring(value) or '(Undocumented)' self.header.write(' * %s\n' % xml_escape(docstring)) self.header.write(' *\n') self.header.write(' */\n') self.header.write('#define %s (%s ())\n\n' % (name, impl)) self.need_mappings[impl_sig] = esc_impl_sig def do_struct_header(self, struct): members = struct.getElementsByTagNameNS(NS_TP, 'member') impl_sig = ''.join([elt.getAttribute('type') for elt in members]) esc_impl_sig = escape_as_identifier(impl_sig) name = (self.PREFIX_ + 'STRUCT_TYPE_' + struct.getAttribute('name').upper()) impl = self.prefix_ + 'type_dbus_struct_' + esc_impl_sig docstring = struct.getElementsByTagNameNS(NS_TP, 'docstring') if docstring: docstring = docstring[0].toprettyxml() if docstring.startswith(''): docstring = docstring[14:] if docstring.endswith('\n'): docstring = docstring[:-16] if docstring.strip() in ('', ''): docstring = '(Undocumented)' else: docstring = '(Undocumented)' self.header.write('/**\n * %s:\n\n' % name) self.header.write(' * %s\n' % xml_escape(docstring)) self.header.write(' *\n') self.header.write(' * This macro expands to a call to a function\n') self.header.write(' * that returns the #GType of a #GValueArray\n') self.header.write(' * appropriate for representing a D-Bus struct\n') self.header.write(' * with signature (%s).\n' % impl_sig) self.header.write(' *\n') for i, member in enumerate(members): self.header.write(' * Member %d (D-Bus type ' '%s,\n' % (i, member.getAttribute('type'))) tp_type = member.getAttributeNS(NS_TP, 'type') if tp_type: self.header.write(' * type %s,\n' % tp_type) self.header.write(' * named %s):\n' % member.getAttribute('name')) docstring = get_docstring(member) or '(Undocumented)' self.header.write(' * %s\n' % xml_escape(docstring)) self.header.write(' *\n') self.header.write(' */\n') self.header.write('#define %s (%s ())\n\n' % (name, impl)) array_name = struct.getAttribute('array-name') if array_name != '': array_name = (self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper()) impl = self.prefix_ + 'type_dbus_array_' + esc_impl_sig self.header.write('/**\n * %s:\n\n' % array_name) self.header.write(' * Expands to a call to a function\n') self.header.write(' * that returns the #GType of a #GPtrArray\n') self.header.write(' * of #%s.\n' % name) self.header.write(' */\n') self.header.write('#define %s (%s ())\n\n' % (array_name, impl)) self.need_arrays[impl_sig] = esc_impl_sig self.need_structs[impl_sig] = esc_impl_sig def __call__(self): mappings = self.dom.getElementsByTagNameNS(NS_TP, 'mapping') structs = self.dom.getElementsByTagNameNS(NS_TP, 'struct') for mapping in mappings: self.do_mapping_header(mapping) for sig in self.need_mappings: self.header.write('GType %stype_dbus_hash_%s (void);\n\n' % (self.prefix_, self.need_mappings[sig])) self.body.write('GType\n%stype_dbus_hash_%s (void)\n{\n' % (self.prefix_, self.need_mappings[sig])) self.body.write(' static GType t = 0;\n\n') self.body.write(' if (G_UNLIKELY (t == 0))\n') # FIXME: translate sig into two GTypes items = tuple(Signature(sig)) gtypes = types_to_gtypes(items) self.body.write(' t = dbus_g_type_get_map ("GHashTable", ' '%s, %s);\n' % (gtypes[0], gtypes[1])) self.body.write(' return t;\n') self.body.write('}\n\n') for struct in structs: self.do_struct_header(struct) for sig in self.need_structs: self.header.write('GType %stype_dbus_struct_%s (void);\n\n' % (self.prefix_, self.need_structs[sig])) self.body.write('GType\n%stype_dbus_struct_%s (void)\n{\n' % (self.prefix_, self.need_structs[sig])) self.body.write(' static GType t = 0;\n\n') self.body.write(' if (G_UNLIKELY (t == 0))\n') self.body.write(' t = dbus_g_type_get_struct ("GValueArray",\n') items = tuple(Signature(sig)) gtypes = types_to_gtypes(items) for gtype in gtypes: self.body.write(' %s,\n' % gtype) self.body.write(' G_TYPE_INVALID);\n') self.body.write(' return t;\n') self.body.write('}\n\n') for sig in self.need_arrays: self.header.write('GType %stype_dbus_array_%s (void);\n\n' % (self.prefix_, self.need_structs[sig])) self.body.write('GType\n%stype_dbus_array_%s (void)\n{\n' % (self.prefix_, self.need_structs[sig])) self.body.write(' static GType t = 0;\n\n') self.body.write(' if (G_UNLIKELY (t == 0))\n') self.body.write(' t = dbus_g_type_get_collection ("GPtrArray", ' '%stype_dbus_struct_%s ());\n' % (self.prefix_, self.need_structs[sig])) self.body.write(' return t;\n') self.body.write('}\n\n') if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) GTypesGenerator(dom, argv[1], argv[2])() telepathy-salut-0.8.1/tools/glib-errors-enum-body.xsl0000644000175000017500000000500311106006512022341 0ustar00wjtwjt00000000000000 /* */ { TP_ERROR_, "TP_ERROR_", "" }, /* Generated from the Telepathy spec */ #include <_gen/telepathy-errors.h> GType tp_error_get_type (void) { static GType etype = 0; if (G_UNLIKELY (etype == 0)) { static const GEnumValue values[] = { }; etype = g_enum_register_static ("TpError", values); } return etype; } telepathy-salut-0.8.1/tools/telepathy.am0000644000175000017500000000447312050201776020025 0ustar00wjtwjt00000000000000## Useful top-level Makefile.am snippets for Telepathy projects. dist-hook: chmod u+w ${distdir}/ChangeLog if test -d ${top_srcdir}/.git; then \ git log --date=iso $(CHANGELOG_RANGE) > ${distdir}/ChangeLog; \ fi distcheck-hook: @test "z$(CHECK_FOR_UNRELEASED)" = z || \ case @VERSION@ in \ *.*.*.*|*+) ;; \ *) \ if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \ then \ echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \ exit 2; \ fi \ ;; \ esac _is-release-check: @case @VERSION@ in \ (*.*.*.*|*+) \ echo "Hey! @VERSION@ is not a release!" >&2; \ exit 2; \ ;; \ esac @if ! git diff --no-ext-diff --quiet --exit-code; then \ echo "Hey! Your tree is dirty! No release for you." >&2; \ exit 2; \ fi @if ! git diff --cached --no-ext-diff --quiet --exit-code; then \ echo "Hey! You have changes staged! No release for you." >&2; \ exit 2; \ fi if ENABLE_GTK_DOC else @echo "Hey! You need to pass --enable-gtk-doc to configure!" @exit 2; endif %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ @PACKAGE@-@VERSION@.tar.gz: _is-release-check check distcheck maintainer-prepare-release: _is-release-check all distcheck release-mail git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@ gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz release-mail: NEWS $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \ @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \ mv $@.tmp $@) maintainer-upload-release: _maintainer-upload-release _maintainer-upload-release-check: _is-release-check test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc _maintainer-upload-release: _maintainer-upload-release-check rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc maintainer-make-release: maintainer-prepare-release maintainer-upload-release @echo "Now:" @echo " • bump the nano-version;" @echo " • push the branch and tags upstream; and" @echo " • send release-mail to ." ## vim:set ft=automake: telepathy-salut-0.8.1/tools/c-constants-generator.xsl0000644000175000017500000002552511106006512022450 0ustar00wjtwjt00000000000000 /** * : * * <![CDATA[ ]]> * * Bitfield/set of flags generated from the Telepathy specification. */ typedef enum { } ; * @ : <![CDATA[ ]]> * @ : <![CDATA[ ]]> s /** * : * * <![CDATA[ ]]> * * Bitfield/set of flags generated from the Telepathy specification. */ typedef enum { } ; /** * NUM_ : * * 1 higher than the highest valid value of # . */ #define NUM_ ( +1) Flag name != suffix = , Enumvalue name != suffix Enum values must be in ascending numeric order, but is less than the previous value = , tp:flag found outside tp:flags tp:enumvalue found outside tp:enum mixed-case-prefix param must be set /* Generated from , version */ #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif telepathy-salut-0.8.1/tools/identity.xsl0000644000175000017500000000033511106006512020051 0ustar00wjtwjt00000000000000 telepathy-salut-0.8.1/tools/Makefile.in0000644000175000017500000003402712051456040017547 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/ax_config_dir.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/salut-args.m4 $(top_srcdir)/m4/salut-gcov.m4 \ $(top_srcdir)/m4/salut-lcov.m4 \ $(top_srcdir)/m4/salut-valgrind.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.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 = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BONJOUR_CFLAGS = @BONJOUR_CFLAGS@ BONJOUR_LIBS = @BONJOUR_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ENABLE_OLPC = @ENABLE_OLPC@ ENABLE_PLUGINS = @ENABLE_PLUGINS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GIO_WINDOWS_CFLAGS = @GIO_WINDOWS_CFLAGS@ GIO_WINDOWS_LIBS = @GIO_WINDOWS_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ LIBSOUP_LIBS = @LIBSOUP_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_GLIB_CFLAGS = @TELEPATHY_GLIB_CFLAGS@ TELEPATHY_GLIB_LIBS = @TELEPATHY_GLIB_LIBS@ TEST_PYTHON = @TEST_PYTHON@ USE_BACKEND_AVAHI = @USE_BACKEND_AVAHI@ USE_BACKEND_BONJOUR = @USE_BACKEND_BONJOUR@ USE_BACKEND_DUMMY = @USE_BACKEND_DUMMY@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VALGRIND_PATH = @VALGRIND_PATH@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ WOCKY_LIBS = @WOCKY_LIBS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginexecdir = @pluginexecdir@ pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ c-constants-generator.xsl \ c-interfaces-generator.xsl \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ doc-generator.xsl \ glib-client-marshaller-gen.py \ glib-errors-enum-body.xsl \ glib-errors-enum-header.xsl \ glib-interfaces-generator.xsl \ glib-interfaces-body-generator.xsl \ glib-ginterface-gen.py \ glib-gtypes-generator.py \ glib-signals-marshal-gen.py \ identity.xsl \ libglibcodegen.py \ make-release-mail.py \ telepathy.am \ xep.xsl TELEPATHY_GLIB_SRCDIR = $(top_srcdir)/../telepathy-glib 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am glib-client-marshaller-gen.py: libglibcodegen.py @touch $@ glib-ginterface-gen.py: libglibcodegen.py @touch $@ glib-gtypes-generator.py: libglibcodegen.py @touch $@ glib-signals-marshal-gen.py: libglibcodegen.py @touch $@ glib-interfaces-generator.xsl: c-interfaces-generator.xsl @touch $@ glib-interfaces-body-generator.xsl: c-interfaces-generator.xsl @touch $@ maintainer-update-from-xmpp.org: set -e; \ uri=svn://svn.xmpp.org:7938/xmpp/trunk/extensions/xep.xsl; \ svn info $$uri; \ svn cat $$uri > xep.xsl.tmp mv xep.xsl.tmp xep.xsl maintainer-update-from-telepathy-glib: set -e && cd $(srcdir) && \ for x in $(EXTRA_DIST); do \ if test -f $(TELEPATHY_GLIB_SRCDIR)/tools/$$x; then \ cp $(TELEPATHY_GLIB_SRCDIR)/tools/$$x $$x; \ fi; \ done # 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: telepathy-salut-0.8.1/tools/make-release-mail.py0000644000175000017500000000474512050201776021336 0ustar00wjtwjt00000000000000#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # Hello. This is make-release-mail.py from the Telepathy project. It's # designed to turn an item from a NEWS file into a mail suitable for sending # to . I hope that you enjoy your stay. import sys def extract_description(package, version, news_path): release_name = [] details = [] with open(news_path) as f: lines = (line for line in f.readlines()) for line in lines: # Find the 'telepathy-foo 0.1.2' header if line.startswith("%s %s" % (package, version)): break # Skip the ====== line, and the first blank line lines.next() lines.next() got_release_name = False for line in lines: line = line.rstrip() # If we hit the next version header, we're done if line.startswith(package): break # Else, if we hit a blank line and we're still reading the release # name, we're done with the release name. elif not got_release_name and line == '': got_release_name = True # Otherwise, append this to the relevant list elif not got_release_name: release_name.append(line) else: details.append(line) assert got_release_name, (release_name, details) # We rstrip details because it picks up a trailing blank line return ('\n'.join(release_name), '\n'.join(details).rstrip()) BASE_URL = 'http://telepathy.freedesktop.org/releases' GIT_URL = 'http://cgit.freedesktop.org/telepathy' def main(package, version, news_path): release_name, details = extract_description(package, version, news_path) print """ %(release_name)s tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz signature: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz.asc git: %(git_url)s/%(package)s %(details)s""".strip().rstrip() % { 'base_url': BASE_URL, 'git_url': GIT_URL, 'package': package, 'version': version, 'release_name': release_name, 'details': details, } if __name__ == '__main__': try: package, version, news_path = sys.argv[1:] main(package, version, news_path) except ValueError, e: sys.stderr.write( 'Usage: %s package-name package.version.number path/to/NEWS\n' % sys.argv[0]) sys.stderr.flush() sys.exit(1) telepathy-salut-0.8.1/ltmain.sh0000644000175000017500000105202612051456030016161 0ustar00wjtwjt00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 telepathy-salut-0.8.1/COPYING0000644000175000017500000006712311117725470015410 0ustar00wjtwjt00000000000000Most of Salut is licensed under the GNU Lesser General Public License, as published by the Free Software Foundation and reproduced below: either version 2.1 of the License, or (at your option) any later version. xep.xsl in the the tools/ directory, used to generate HTML documentation for the Clique protocol, is copyright 1999-2008 by the XMPP Standards Foundation (XSF) and is released under a MIT-style license, reproduced below. ------------------------------------------------------------------------ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 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 Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ------------------------------------------------------------------------ License of tools/xep.xsl: Copyright (c) 1999 - 2008 XMPP Standards Foundation 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. telepathy-salut-0.8.1/config.sub0000755000175000017500000010532712051456037016335 0ustar00wjtwjt00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-salut-0.8.1/lib/0000755000175000017500000000000012051456453015112 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/0000755000175000017500000000000012051456451015710 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/Makefile.am0000644000175000017500000000041012050201776017734 0ustar00wjtwjt00000000000000SUBDIRS = DIST_SUBDIRS = wocky all-local: @cd wocky && $(MAKE) clean-local: if test -e wocky/Makefile ; then \ cd wocky && $(MAKE) clean ; \ fi uninstall-local: @cd wocky/wocky && $(MAKE) uninstall install-data-local: @cd wocky/wocky && $(MAKE) install telepathy-salut-0.8.1/lib/ext/wocky/0000755000175000017500000000000012051456452017045 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/m4/0000755000175000017500000000000012051456452017365 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/m4/libtool.m40000644000175000017500000105754212051456046021310 0ustar00wjtwjt00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # 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) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])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_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_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${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # 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. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[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 ;; *-*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*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/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 -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # 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* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) 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 max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_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 <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if 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_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_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* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it 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="-ldld"], [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="-ldld"]) ]) ]) ]) ]) ]) ;; 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_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_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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_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 .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_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 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_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 _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_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_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) 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" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[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]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_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 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_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])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 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (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 : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # 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]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # 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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_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_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_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_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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_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_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_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_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 ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_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_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_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_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]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_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_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX([$1]) _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_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' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_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_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_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' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_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_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$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_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl 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_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # 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 ;; aix[[4-9]]*) 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]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl 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 else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_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_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_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_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 -v "^Configured with:" | $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_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do 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_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' 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 : else # We have old collect2 _LT_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_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX([$1]) _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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_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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_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_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_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; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-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_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_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | 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_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_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; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # 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_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_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' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_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::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_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_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_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_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 -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_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_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_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 -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$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_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([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. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= 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... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); 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 for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${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 fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # 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. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then 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 ;; aix[[4-9]]*) 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]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then 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 ;; aix[[4-9]]*) 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]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # 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. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # 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. # ############################################################ m4_defun([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 IFS=$as_save_IFS 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_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS telepathy-salut-0.8.1/lib/ext/wocky/m4/wocky-lcov.m40000644000175000017500000000104211720473445021724 0ustar00wjtwjt00000000000000dnl Check for lcov utility AC_DEFUN([WOCKY_LCOV], [ enable=$1 AC_CHECK_PROGS(LCOV_PATH, lcov) if test -n "$LCOV_PATH" ; then AC_MSG_CHECKING([whether lcov accepts --compat-libtool]) if $LCOV_PATH --compat-libtool --help > /dev/null 2>&1 ; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(no) AC_MSG_WARN([lcov option --compat-libtool is not supported]) AC_MSG_WARN([update lcov to version > 1.5]) LCOV_PATH="" fi fi AM_CONDITIONAL(HAVE_LCOV, test -n "$LCOV_PATH" && test "x$enable" = xyes) ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/tp-compiler-flag.m40000644000175000017500000000170411720473445022776 0ustar00wjtwjt00000000000000dnl A version of AS_COMPILER_FLAG that supports both C and C++. dnl Based on: dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS and CXXFLAGS. dnl dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([TP_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS $1" CXXFLAGS="$CXXFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/gtk-doc.m40000644000175000017500000000461111731550205021154 0ustar00wjtwjt00000000000000dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) fi fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/tp-compiler-warnings.m40000644000175000017500000000240111720473445023710 0ustar00wjtwjt00000000000000dnl TP_COMPILER_WARNINGS(VARIABLE, WERROR_BY_DEFAULT, DESIRABLE, UNDESIRABLE) dnl $1 (VARIABLE): the variable to put flags into dnl $2 (WERROR_BY_DEFAULT): a command returning true if -Werror should be the dnl default dnl $3 (DESIRABLE): warning flags we want (e.g. all extra shadow) dnl $4 (UNDESIRABLE): warning flags we don't want (e.g. dnl missing-field-initializers unused-parameter) AC_DEFUN([TP_COMPILER_WARNINGS], [ AC_REQUIRE([AC_ARG_ENABLE])dnl AC_REQUIRE([AC_HELP_STRING])dnl AC_REQUIRE([TP_COMPILER_FLAG])dnl tp_warnings="" for tp_flag in $3; do TP_COMPILER_FLAG([-W$tp_flag], [tp_warnings="$tp_warnings -W$tp_flag"]) done tp_error_flags="-Werror" TP_COMPILER_FLAG([-Werror], [tp_werror=yes], [tp_werror=no]) for tp_flag in $4; do TP_COMPILER_FLAG([-Wno-$tp_flag], [tp_warnings="$tp_warnings -Wno-$tp_flag"]) TP_COMPILER_FLAG([-Wno-error=$tp_flag], [tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no]) done AC_ARG_ENABLE([Werror], AC_HELP_STRING([--disable-Werror], [compile without -Werror (normally enabled in development builds)]), tp_werror=$enableval, :) if test "x$tp_werror" = xyes && $2; then $1="$tp_warnings $tp_error_flags" else $1="$tp_warnings" fi ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/wocky-gcov.m40000644000175000017500000000267711720473445021736 0ustar00wjtwjt00000000000000dnl Detect and set flags for gcov AC_DEFUN([WOCKY_GCOV], [ enable=$1 GCOV=`echo $CC | sed s/gcc/gcov/g` AC_CHECK_PROG(have_gcov, $GCOV, yes, no) AS_COMPILER_FLAG(["-fprofile-arcs"], [flag_profile_arcs=yes], [flag_profile_arcs=no]) AS_COMPILER_FLAG(["-ftest-coverage"], [flag_test_coverage=yes], [flag_test_coverage=no]) if test "x$enable" = xyes && test "x$GCC" = "xyes" && test "$flag_profile_arcs" = yes && test "$flag_test_coverage" = yes ; then GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs -ftest-coverage" dnl remove any -O flags - FIXME: is this needed ? GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[[0-9]]*//g'` dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags dnl passed to the linker, which is a bug; -fprofile-arcs implicitly dnl links in -lgcov, so we do it explicitly here for the same effect GCOV_LIBS=-lgcov AC_SUBST([MOSTLYCLEANFILES], "*.bb *.bbg *.da *.gcov *.gcda *.gcno") AC_DEFINE_UNQUOTED(HAVE_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing]) CFLAGS="-O0" AC_SUBST(CFLAGS) CXXFLAGS="-O0" AC_SUBST(CXXFLAGS) FFLAGS="-O0" AC_SUBST(FFLAGS) CCASFLAGS="-O0" AC_SUBST(CCASFLAGS) AC_MSG_NOTICE([gcov enabled, setting CFLAGS and friends to $CFLAGS]) fi AC_SUBST(GCOV_CFLAGS) AC_SUBST(GCOV_LIBS) AC_SUBST(GCOV) AM_CONDITIONAL(HAVE_GCOV, test x$have_gcov = xyes) ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/Makefile.am0000644000175000017500000000004311720473445021421 0ustar00wjtwjt00000000000000EXTRA_DIST = \ as-compiler-flag.m4 telepathy-salut-0.8.1/lib/ext/wocky/m4/as-compiler-flag.m40000644000175000017500000000136311720473445022757 0ustar00wjtwjt00000000000000dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS. dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, dnl and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([AS_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/ltoptions.m40000644000175000017500000003007312051456046021664 0ustar00wjtwjt00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # 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 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_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=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_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=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_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=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) telepathy-salut-0.8.1/lib/ext/wocky/m4/ltsugar.m40000644000175000017500000001042412051456046021310 0ustar00wjtwjt00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/ltversion.m40000644000175000017500000000126212051456046021654 0ustar00wjtwjt00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) telepathy-salut-0.8.1/lib/ext/wocky/m4/lt~obsolete.m40000644000175000017500000001375612051456046022214 0ustar00wjtwjt00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) telepathy-salut-0.8.1/lib/ext/wocky/m4/Makefile.in0000644000175000017500000002742212051456053021436 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.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 = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ as-compiler-flag.m4 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: telepathy-salut-0.8.1/lib/ext/wocky/README0000644000175000017500000000002411720473445017724 0ustar00wjtwjt00000000000000Wocky XMPP Library! telepathy-salut-0.8.1/lib/ext/wocky/config.guess0000755000175000017500000012743212051456053021373 0ustar00wjtwjt00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-salut-0.8.1/lib/ext/wocky/configure.ac0000644000175000017500000002003312051446215021325 0ustar00wjtwjt00000000000000AC_PREREQ([2.59]) # Making releases: # set the new version number: # odd minor -> development series # even minor -> stable series # increment micro for each release within a series # set wockynano_version to 0. m4_define([wocky_major_version], [0]) m4_define([wocky_minor_version], [0]) m4_define([wocky_micro_version], [0]) m4_define([wocky_nano_version], [1]) # Some magic m4_define([wocky_base_version], [wocky_major_version.wocky_minor_version.wocky_micro_version]) m4_define([wocky_version], [m4_if(wocky_nano_version, 0, [wocky_base_version], [wocky_base_version].[wocky_nano_version])])dnl AC_INIT([Wocky], [wocky_version]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.9 -Wno-portability tar-ustar]) AM_PROG_LIBTOOL AM_CONFIG_HEADER(config.h) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) dnl check for tools AC_PROG_CC AC_PROG_CC_STDC AM_PROG_AS AM_PROG_MKDIR_P dnl decide error flags dnl ifelse(wocky_nano_version, 0, dnl [ official_release=yes ], dnl [ official_release=no ]) official_release=no TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$official_release" = xno], [all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self], [missing-field-initializers \ unused-parameter]) AC_SUBST([ERROR_CFLAGS]) ifelse(wocky_nano_version, 0, [ # Wocky is version x.y.z - disable coding style checks by default AC_ARG_ENABLE(coding-style-checks, AC_HELP_STRING([--enable-coding-style-checks], [check coding style using grep]), [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=no] ) ], [ # Wocky is version x.y.z.1 - enable coding style checks by default AC_ARG_ENABLE(coding-style-checks, AC_HELP_STRING([--disable-coding-style-checks], [do not check coding style using grep]), [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes]) ]) AC_SUBST([ENABLE_CODING_STYLE_CHECKS]) dnl debugging stuff AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile without debug code]), [ case "${enableval}" in yes|no) enable_debug="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac ], [enable_debug=yes]) if test "$enable_debug" = yes; then AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code]) else enable_debug=no fi AC_ARG_WITH(installed-headers, AC_HELP_STRING([--with-installed-headers=DIR], [install development headers to DIR @<:@default=nowhere@:>@]), [], [with_installed_headers=]) AM_CONDITIONAL(INSTALL_HEADERS, test x$with_installed_headers != x) HEADER_DIR=$with_installed_headers AC_SUBST(HEADER_DIR) dnl Build a shared library even though Wocky isn't stable yet? AC_ARG_ENABLE([shared-suffix], AC_HELP_STRING([--enable-shared-suffix=], [install a shared library with a version-specific suffix]), [], [enable_shared_suffix=]) AM_CONDITIONAL([ENABLE_SHARED_SUFFIX], [test x$enable_shared_suffix != x]) SHARED_SUFFIX="$enable_shared_suffix" AC_SUBST([SHARED_SUFFIX]) dnl Check for code generation tools AC_HEADER_STDC([]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_C_INLINE dnl Check endianness (Needed for the sha1 implementation) AC_C_BIGENDIAN dnl Check for Glib PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28, gobject-2.0 >= 2.16, gthread-2.0 >= 2.4, gio-2.0 >= 2.26]) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) dnl Check GIO proxy support PKG_CHECK_EXISTS([gio-2.0 >= 2.25.15], [HAVE_GIO_PROXY=yes AC_DEFINE(HAVE_GIO_PROXY, [1], [Defined if GIO supports proxy])], [HAVE_GIO_PROXY=no]) AM_CONDITIONAL(HAVE_GIO_PROXY, [test "x${HAVE_GIO_PROXY}" = "xyes"]) dnl Choose an SSL/TLS backend (default gnutls) AC_ARG_WITH([tls], AC_HELP_STRING([--with-tls=BACKEND], [which TLS backend to use (gnutls, openssl, or auto) @<:@default=auto@:>@]), [], [with_tls=auto]) AS_CASE([$with_tls], [gnutls], [PKG_CHECK_MODULES(TLS, [gnutls >= 2.8.2 ])], [openssl], [USING_OPENSSL=yes AC_DEFINE(USING_OPENSSL, 1, [Define if using openssl]) PKG_CHECK_MODULES(TLS, [openssl >= 0.9.8g])], [auto], [PKG_CHECK_MODULES(TLS, [gnutls >= 2.8.2 ], [with_tls=gnutls], [USING_OPENSSL=yes AC_DEFINE(USING_OPENSSL, 1, [Define if using openssl]) PKG_CHECK_MODULES(TLS, [openssl >= 0.9.8g],[with_tls=openssl], AC_MSG_ERROR([Neither gnutls nor openssl found]))])], [*], AC_MSG_ERROR([Must have a TLS backend (gnutls or openssl)])) AC_SUBST(TLS_CFLAGS) AC_SUBST(TLS_LIBS) AM_CONDITIONAL(USING_OPENSSL, test x$USING_OPENSSL = xyes) AC_ARG_ENABLE([prefer-stream-ciphers], AC_HELP_STRING([--enable-prefer-stream-ciphers], [prefer stream ciphers over block ciphers to save bandwidth (at the possible expense of security)]), [prefer_stream_ciphers=$enableval], [prefer_stream_ciphers=no]) if test x$prefer_stream_ciphers = xyes; then AC_DEFINE(ENABLE_PREFER_STREAM_CIPHERS, [], [Prefer stream ciphers over block ones to save bandwidth]) if test $with_tls = gnutls; then # The *-ALL priority strings require gnutls 2.12.0. # We do this check here and not earlier to avoid accidentally falling # back to openssl because of the use of --enable-prefer-stream-ciphers. PKG_CHECK_MODULES(GNUTLS_FOR_STREAM_CIPHERS, [gnutls >= 2.12.0],[], AC_MSG_ERROR([gnutls 2.12.0 is needed to use --enable-prefer-stream-cihpers])) fi fi GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) dnl Check for libxml2 PKG_CHECK_MODULES(LIBXML2, [libxml-2.0]) AC_SUBST(LIBXML2_CFLAGS) AC_SUBST(LIBXML2_LIBS) dnl Check for sqlite PKG_CHECK_MODULES(SQLITE, [sqlite3]) AC_SUBST(SQLITE_CFLAGS) AC_SUBST(SQLITE_LIBS) dnl check for libsasl2 (for sasl test) dnl must check for headers as well as library (no .pc so can't use pkg-config) AC_CHECK_LIB(sasl2, sasl_server_new, [ AC_CHECK_HEADER(sasl/sasl.h, [ LIBSASL2_LIBS="-lsasl2" LIBSASL2_CFLAGS="" HAVE_LIBSASL2=yes AC_DEFINE(HAVE_LIBSASL2, 1, [Define if libsasl2 is available]) ], [ AC_MSG_WARN(libsasl2 headers missing: skipping sasl tests)]) ], [ AC_MSG_WARN(libsasl2 not found: skipping sasl tests) HAVE_LIBSASL2=no ]) AC_SUBST(LIBSASL2_LIBS) AC_SUBST(LIBSASL2_CFLAGS) AM_CONDITIONAL(HAVE_LIBSASL2, test "x$HAVE_LIBSASL2" = "xyes") PKG_CHECK_MODULES(LIBIPHB, [libiphb >= 0.61.31], [AC_DEFINE(HAVE_IPHB, 1, [libiphb is available]) have_iphb=yes ], [have_iphb=no]) AC_SUBST(LIBIPHB_CFLAGS) AC_SUBST(LIBIPHB_LIBS) AC_ARG_ENABLE(coverage, AC_HELP_STRING([--enable-coverage], [compile with coverage profiling instrumentation (gcc only)]), [ case "${enableval}" in "yes"|"no") enable_coverage="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-coverage) ;; esac ] ) WOCKY_GCOV(${enable_coverage}) WOCKY_LCOV(${enable_coverage}) if test "x$enable_coverage" = "x"; then enable_coverage=no fi AC_SUBST(PACKAGE_STRING) dnl To be used by tests and examples WOCKY_CFLAGS='-I${top_builddir} -I${top_srcdir}' AC_SUBST(WOCKY_CFLAGS) GTK_DOC_CHECK([1.17],[--flavour no-tmpl]) AC_OUTPUT( Makefile \ wocky/Makefile \ wocky/wocky-uninstalled.pc \ m4/Makefile \ tools/Makefile \ examples/Makefile \ tests/Makefile \ docs/Makefile \ docs/reference/Makefile ) echo " Configure summary: Compiler Flags.......: ${CFLAGS} Prefix...............: ${prefix} Coverage profiling...: ${enable_coverage} Coding style checks..: ${ENABLE_CODING_STYLE_CHECKS} Debug................: ${enable_debug} Features: TLS Backend..........: ${with_tls} Prefer stream ciphers: ${prefer_stream_ciphers} SASL2 Tests..........: ${HAVE_LIBSASL2} gtk-doc documentation: ${enable_gtk_doc} libiphb integration..: ${have_iphb} " telepathy-salut-0.8.1/lib/ext/wocky/AUTHORS0000644000175000017500000000015011720473445020114 0ustar00wjtwjt00000000000000Sjoerd Simons Guillaume Desmottes telepathy-salut-0.8.1/lib/ext/wocky/examples/0000755000175000017500000000000012051456452020663 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/examples/send-message.c0000644000175000017500000000561412051446215023404 0ustar00wjtwjt00000000000000#include #include #include #include #include #include GMainLoop *mainloop; char *recipient; char *message; static void closed_cb ( GObject *source, GAsyncResult *res, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); WockySession *session = WOCKY_SESSION (user_data); GError *error = NULL; if (wocky_porter_close_finish (porter, res, &error)) { g_print ("Signed out\n"); } else { g_warning ("Couldn't sign out cleanly: %s\n", error->message); g_clear_error (&error); } /* Either way, we're done. */ g_object_unref (session); g_main_loop_quit (mainloop); } static void message_sent_cb ( GObject *source, GAsyncResult *res, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); WockySession *session = WOCKY_SESSION (user_data); GError *error = NULL; if (wocky_porter_send_finish (porter, res, &error)) { g_print ("Sent '%s' to %s\n", message, recipient); } else { g_warning ("Couldn't send message: %s\n", error->message); g_clear_error (&error); } /* Sign out. */ wocky_porter_close_async (porter, NULL, closed_cb, session); } static void connected_cb ( GObject *source, GAsyncResult *res, gpointer user_data) { WockyConnector *connector = WOCKY_CONNECTOR (source); WockyXmppConnection *connection; gchar *jid = NULL; GError *error = NULL; connection = wocky_connector_connect_finish (connector, res, &jid, NULL, &error); if (connection == NULL) { g_warning ("Couldn't connect: %s", error->message); g_clear_error (&error); g_main_loop_quit (mainloop); } else { WockySession *session = wocky_session_new_with_connection (connection, jid); WockyPorter *porter = wocky_session_get_porter (session); WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, recipient, '(', "body", '$', message, ')', NULL); g_print ("Connected as %s\n", jid); wocky_porter_start (porter); wocky_porter_send_async (porter, stanza, NULL, message_sent_cb, session); g_object_unref (stanza); g_free (jid); } } int main (int argc, char **argv) { char *jid, *password; WockyConnector *connector; g_type_init (); wocky_init (); if (argc != 5) { printf ("Usage: %s \n", argv[0]); return -1; } jid = argv[1]; password = argv[2]; recipient = argv[3]; message = argv[4]; mainloop = g_main_loop_new (NULL, FALSE); connector = wocky_connector_new (jid, password, NULL, NULL, NULL); wocky_connector_connect_async (connector, NULL, connected_cb, NULL); g_main_loop_run (mainloop); g_object_unref (connector); g_main_loop_unref (mainloop); return 0; } telepathy-salut-0.8.1/lib/ext/wocky/examples/receive-messages.c0000644000175000017500000001177312051446215024263 0ustar00wjtwjt00000000000000#include #include #include #include #include #include GMainLoop *mainloop; static void porter_closed_cb ( GObject *source, GAsyncResult *res, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); WockySession *session = WOCKY_SESSION (user_data); GError *error = NULL; if (wocky_porter_close_finish (porter, res, &error)) { g_print ("Signed out\n"); } else { g_warning ("Couldn't sign out cleanly: %s\n", error->message); g_clear_error (&error); } /* Either way, we're done. */ g_object_unref (session); g_main_loop_quit (mainloop); } static gboolean message_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyNode *body_node = wocky_node_get_child ( wocky_stanza_get_top_node (stanza), "body"); const gchar *from = wocky_stanza_get_from (stanza); const gchar *message; /* We told the porter only to give us messages which contained a * element. */ g_assert (body_node != NULL); message = body_node->content; if (message == NULL) message = ""; g_print ("Message received from %s: “%s”\n", from, message); if (g_ascii_strcasecmp (message, "sign out") == 0) { WockyStanza *reply = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NORMAL, NULL, from, '(', "body", '$', "Say please! Didn’t your parents teach you any manners‽", ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); } /* Tell the porter that we've handled this stanza; if there were any * lower-priority handlers, they would not be called for this stanza. */ return TRUE; } static gboolean sign_out_message_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockySession *session = WOCKY_SESSION (user_data); const gchar *from = wocky_stanza_get_from (stanza); g_print ("%s asked us nicely to sign out\n", from); wocky_porter_close_async (porter, NULL, porter_closed_cb, session); /* Returning FALSE tells the porter that other, lower-priority handlers that * match the stanza should be invoked — in this example, that means * message_received_cb(). */ return FALSE; } static void connected_cb ( GObject *source, GAsyncResult *res, gpointer user_data) { WockyConnector *connector = WOCKY_CONNECTOR (source); WockyXmppConnection *connection; gchar *jid = NULL; GError *error = NULL; connection = wocky_connector_connect_finish (connector, res, &jid, NULL, &error); if (connection == NULL) { g_warning ("Couldn't connect: %s", error->message); g_clear_error (&error); g_main_loop_quit (mainloop); } else { WockySession *session = wocky_session_new_with_connection (connection, jid); WockyPorter *porter = wocky_session_get_porter (session); WockyStanza *stanza; g_print ("Connected as %s\n", jid); /* Register a callback for incoming stanzas from * anyone, but only if it contains a element (the element that * actually contains the text of IMs). */ wocky_porter_register_handler_from_anyone (porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, message_received_cb, session, '(', "body", ')', NULL); /* Register a higher-priority handler for incoming * stanzas which contain a element containing the text * "please sign out". */ wocky_porter_register_handler_from_anyone (porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, sign_out_message_received_cb, session, '(', "body", '$', "please sign out", ')', NULL); wocky_porter_start (porter); /* Broadcast presence for ourself, so our contacts can see us online, * with a status message. */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_PRESENCE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "show", '$', "chat", ')', '(', "status", '$', "talk to me! (or tell me to “sign out”)", ')', NULL); wocky_porter_send (porter, stanza); g_object_unref (stanza); g_free (jid); } } int main (int argc, char **argv) { char *jid, *password; WockyConnector *connector; g_type_init (); wocky_init (); if (argc != 3) { printf ("Usage: %s \n", argv[0]); return -1; } jid = argv[1]; password = argv[2]; mainloop = g_main_loop_new (NULL, FALSE); connector = wocky_connector_new (jid, password, NULL, NULL, NULL); wocky_connector_connect_async (connector, NULL, connected_cb, NULL); g_main_loop_run (mainloop); g_object_unref (connector); g_main_loop_unref (mainloop); return 0; } telepathy-salut-0.8.1/lib/ext/wocky/examples/unregister.c0000644000175000017500000000305512051446215023215 0ustar00wjtwjt00000000000000#include #include #include #include #include #include GMainLoop *mainloop; int rval = -1; static void unregister_callback (GObject *source, GAsyncResult *res, gpointer user_data) { GError *error = NULL; WockyConnector *wcon = WOCKY_CONNECTOR (source); gboolean done = wocky_connector_unregister_finish (wcon, res, &error); if (done) { printf ("Unregistered!\n"); } else { if (error) g_warning ("Unregistration error: %s: %d: %s\n", g_quark_to_string (error->domain), error->code, error->message); else g_warning ("Unregister failed: No error supplied\n"); } g_main_loop_quit (mainloop); } int main (int argc, char **argv) { gchar *jid = NULL; gchar *user = NULL; gchar *host = NULL; gchar *pass = NULL; WockyConnector *wcon = NULL; g_type_init (); if ((argc < 3) || (argc > 4)) { printf ("Usage: %s [host]\n", argv[0]); return -1; } jid = argv[1]; pass = argv[2]; wocky_decode_jid (jid, &user, NULL, NULL); if (argc == 4) host = argv[3]; mainloop = g_main_loop_new (NULL, FALSE); if ((host != NULL) && (*host != '\0')) wcon = wocky_connector_new (jid, pass, NULL, NULL, NULL); else wcon = g_object_new (WOCKY_TYPE_CONNECTOR, "jid" , jid , "password" , pass, "xmpp-server", host, NULL); wocky_connector_unregister_async (wcon, NULL, unregister_callback, NULL); g_main_loop_run (mainloop); return rval; } telepathy-salut-0.8.1/lib/ext/wocky/examples/register.c0000644000175000017500000000326312051446215022653 0ustar00wjtwjt00000000000000#include #include #include #include #include #include GMainLoop *mainloop; static void connector_callback (GObject *source, GAsyncResult *res, gpointer user_data) { GError *error = NULL; gchar *jid = NULL; gchar *sid = NULL; WockyConnector *wcon = WOCKY_CONNECTOR (source); WockyXmppConnection *connection = wocky_connector_register_finish (wcon, res, &jid, &sid, &error); if (connection != NULL) { printf ("connected (%s) [%s]!\n", jid, sid); g_free (sid); g_free (jid); } else { if (error) g_warning ("%s: %d: %s\n", g_quark_to_string (error->domain), error->code, error->message); } g_main_loop_quit (mainloop); } int main (int argc, char **argv) { gchar *jid = NULL; gchar *user = NULL; gchar *host = NULL; gchar *pass = NULL; gchar *email = NULL; WockyConnector *wcon = NULL; g_type_init (); if ((argc < 4) || (argc > 5)) { printf ("Usage: %s [host]\n", argv[0]); return -1; } jid = argv[1]; pass = argv[2]; email = argv[3]; wocky_decode_jid (jid, &user, NULL, NULL); if (argc == 5) host = argv[4]; mainloop = g_main_loop_new (NULL, FALSE); if ((host != NULL) && (*host != '\0')) wcon = wocky_connector_new (jid, pass, NULL, NULL, NULL); else wcon = g_object_new (WOCKY_TYPE_CONNECTOR, "jid" , jid , "password" , pass, "xmpp-server", host, NULL); g_object_set (G_OBJECT (wcon), "email", email, NULL); wocky_connector_register_async (wcon, NULL, connector_callback, NULL); g_main_loop_run (mainloop); return 0; } telepathy-salut-0.8.1/lib/ext/wocky/examples/Makefile.am0000644000175000017500000000206612051444011022707 0ustar00wjtwjt00000000000000EXAMPLES = EXAMPLES += wocky-send-message EXAMPLES += wocky-receive-messages EXAMPLES += wocky-register EXAMPLES += wocky-unregister INCLUDES := -I$(top_builddir)/wocky wocky_send_message_SOURCES = send-message.c wocky_send_message_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_receive_messages_SOURCES = receive-messages.c wocky_receive_messages_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_register_SOURCES = register.c wocky_register_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_unregister_SOURCES = unregister.c wocky_unregister_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la LDADD = \ @GLIB_LIBS@ \ $(top_builddir)/wocky/libwocky.la AM_CFLAGS = \ $(WOCKY_CFLAGS) \ $(ERROR_CFLAGS) \ @GLIB_CFLAGS@ check_c_sources = $(wocky_send_message_SOURCES) \ $(wocky_receive_messages_SOURCES) \ $(wocky_register_SOURCES) \ $(wocky_unregister_SOURCES) include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style noinst_PROGRAMS = $(EXAMPLES) telepathy-salut-0.8.1/lib/ext/wocky/examples/Makefile.in0000644000175000017500000005020012051456053022722 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/tools/check-coding-style.mk noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.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 = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = wocky-send-message$(EXEEXT) \ wocky-receive-messages$(EXEEXT) wocky-register$(EXEEXT) \ wocky-unregister$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_wocky_receive_messages_OBJECTS = receive-messages.$(OBJEXT) wocky_receive_messages_OBJECTS = $(am_wocky_receive_messages_OBJECTS) wocky_receive_messages_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am_wocky_register_OBJECTS = register.$(OBJEXT) wocky_register_OBJECTS = $(am_wocky_register_OBJECTS) wocky_register_LDADD = $(LDADD) am_wocky_send_message_OBJECTS = send-message.$(OBJEXT) wocky_send_message_OBJECTS = $(am_wocky_send_message_OBJECTS) wocky_send_message_LDADD = $(LDADD) am_wocky_unregister_OBJECTS = unregister.$(OBJEXT) wocky_unregister_OBJECTS = $(am_wocky_unregister_OBJECTS) wocky_unregister_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(wocky_receive_messages_SOURCES) $(wocky_register_SOURCES) \ $(wocky_send_message_SOURCES) $(wocky_unregister_SOURCES) DIST_SOURCES = $(wocky_receive_messages_SOURCES) \ $(wocky_register_SOURCES) $(wocky_send_message_SOURCES) \ $(wocky_unregister_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXAMPLES = wocky-send-message wocky-receive-messages wocky-register \ wocky-unregister INCLUDES := -I$(top_builddir)/wocky wocky_send_message_SOURCES = send-message.c wocky_send_message_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_receive_messages_SOURCES = receive-messages.c wocky_receive_messages_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_register_SOURCES = register.c wocky_register_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_unregister_SOURCES = unregister.c wocky_unregister_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la LDADD = \ @GLIB_LIBS@ \ $(top_builddir)/wocky/libwocky.la AM_CFLAGS = \ $(WOCKY_CFLAGS) \ $(ERROR_CFLAGS) \ @GLIB_CFLAGS@ check_c_sources = $(wocky_send_message_SOURCES) \ $(wocky_receive_messages_SOURCES) \ $(wocky_register_SOURCES) \ $(wocky_unregister_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/check-coding-style.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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_srcdir)/tools/check-coding-style.mk: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list wocky-receive-messages$(EXEEXT): $(wocky_receive_messages_OBJECTS) $(wocky_receive_messages_DEPENDENCIES) $(EXTRA_wocky_receive_messages_DEPENDENCIES) @rm -f wocky-receive-messages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_receive_messages_OBJECTS) $(wocky_receive_messages_LDADD) $(LIBS) wocky-register$(EXEEXT): $(wocky_register_OBJECTS) $(wocky_register_DEPENDENCIES) $(EXTRA_wocky_register_DEPENDENCIES) @rm -f wocky-register$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_register_OBJECTS) $(wocky_register_LDADD) $(LIBS) wocky-send-message$(EXEEXT): $(wocky_send_message_OBJECTS) $(wocky_send_message_DEPENDENCIES) $(EXTRA_wocky_send_message_DEPENDENCIES) @rm -f wocky-send-message$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_send_message_OBJECTS) $(wocky_send_message_LDADD) $(LIBS) wocky-unregister$(EXEEXT): $(wocky_unregister_OBJECTS) $(wocky_unregister_DEPENDENCIES) $(EXTRA_wocky_unregister_DEPENDENCIES) @rm -f wocky-unregister$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_unregister_OBJECTS) $(wocky_unregister_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/receive-messages.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/register.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send-message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unregister.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(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: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local 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-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: check-coding-style # 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: telepathy-salut-0.8.1/lib/ext/wocky/aclocal.m40000644000175000017500000012712012051456051020703 0ustar00wjtwjt00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # 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|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 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. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have 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_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) 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 AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [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])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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 .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # 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 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # (`yes' being less verbose, `no' or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0')]) case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few `make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using `$V' instead of `$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/as-compiler-flag.m4]) m4_include([m4/gtk-doc.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/tp-compiler-flag.m4]) m4_include([m4/tp-compiler-warnings.m4]) m4_include([m4/wocky-gcov.m4]) m4_include([m4/wocky-lcov.m4]) telepathy-salut-0.8.1/lib/ext/wocky/NEWS0000644000175000017500000000002511720473445017544 0ustar00wjtwjt00000000000000No news is good news telepathy-salut-0.8.1/lib/ext/wocky/missing0000755000175000017500000002415212051456053020445 0ustar00wjtwjt00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi 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' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-salut-0.8.1/lib/ext/wocky/gtk-doc.make0000644000175000017500000001726711731550205021244 0ustar00wjtwjt00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### xml #### sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) @echo ' DOC Building XML' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs telepathy-salut-0.8.1/lib/ext/wocky/autogen.sh0000755000175000017500000000136011720473445021051 0ustar00wjtwjt00000000000000#!/bin/sh set -e gtkdocize || exit 1 if test -n "$AUTOMAKE"; then : # don't override an explicit user request elif automake-1.11 --version >/dev/null 2>/dev/null && \ aclocal-1.11 --version >/dev/null 2>/dev/null; then # If we have automake-1.11, use it. This is the oldest version (=> least # likely to introduce undeclared dependencies) that will give us # --enable-silent-rules support. AUTOMAKE=automake-1.11 export AUTOMAKE ACLOCAL=aclocal-1.11 export ACLOCAL fi autoreconf -i -f run_configure=true for arg in $*; do case $arg in --no-configure) run_configure=false ;; *) ;; esac done if test $run_configure = true; then ./configure "$@" fi telepathy-salut-0.8.1/lib/ext/wocky/Makefile.am0000644000175000017500000000140211720473445021101 0ustar00wjtwjt00000000000000ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = autogen.sh SUBDIRS = wocky tools m4 examples tests docs DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc dist-hook: chmod u+w ${distdir}/ChangeLog if test -d ${top_srcdir}/.git; then \ git log --stat > ${distdir}/ChangeLog || \ git log > ${distdir}/ChangeLog; \ fi include $(top_srcdir)/rules/lcov.mak CLEANFILES = FIXME.out check-local:: egrep -A 5 '[F]IXME|[T]ODO|[X]XX' \ $(srcdir)/wocky/*.[ch] \ $(srcdir)/tests/*.[ch] \ $(srcdir)/examples/*.[ch] \ > FIXME.out || true # one day we'll have a wocky.freedesktop.org but today is not that day maintainer-upload-docs: rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX $(srcdir)/docs/reference/html/ \ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/doc/wocky/ telepathy-salut-0.8.1/lib/ext/wocky/depcomp0000755000175000017500000005064312051456054020430 0ustar00wjtwjt00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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 outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" 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 ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" 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 ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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 -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. 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 "X$1" != 'X--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:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi 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. -arch) eat=yes ;; -*|$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" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 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 "X$1" != 'X--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. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # 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 ;; 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-salut-0.8.1/lib/ext/wocky/tools/0000755000175000017500000000000012051456452020205 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/tools/check-whitespace.sh0000644000175000017500000000032311720473445023751 0ustar00wjtwjt00000000000000#!/bin/sh fail=0 if grep -n ' $' "$@" then echo "^^^ The above files contain unwanted trailing spaces" fail=1 fi if grep -n ' ' "$@" then echo "^^^ The above files contain tabs" fail=1 fi exit $fail telepathy-salut-0.8.1/lib/ext/wocky/tools/check-misc.sh0000644000175000017500000000036011720473445022551 0ustar00wjtwjt00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-whitespace.sh ) || fail=$? if egrep '(Free\s*Software\s*Foundation.*02139|02111-1307)' "$@" then echo "^^^ The above files contain the FSF's old address in GPL headers" fail=1 fi exit $fail telepathy-salut-0.8.1/lib/ext/wocky/tools/check-c-style.sh0000644000175000017500000000376412050202021023162 0ustar00wjtwjt00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-misc.sh ) || fail=$? if grep -n '^ *GError *\*[[:alpha:]_][[:alnum:]_]* *;' "$@" then echo "^^^ The above files contain uninitialized GError*s - they should be" echo " initialized to NULL" fail=1 fi # The first regex finds function calls like foo() (as opposed to foo ()). # It attempts to ignore string constants (may cause false negatives). # The second and third ignore block comments (gtkdoc uses foo() as markup). # The fourth ignores cpp so you can # #define foo(bar) (_real_foo (__FUNC__, bar)) (cpp insists on foo() style). if grep -n '^[^"]*[[:lower:]](' "$@" \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: */\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *#' then echo "^^^ Our coding style is to use function calls like foo (), not foo()" fail=1 fi if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then echo "^^^ Our coding style is to have a space between a cast and the " echo " thing being cast" fail=1 fi # this only spots casts if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 1)" fail=1 fi # ... and this only spots variable declarations and function return types if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \ "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 2)" fail=1 fi if grep -n 'g_hash_table_destroy' "$@"; then echo "^^^ Our coding style is to use g_hash_table_unref" fail=1 fi for p in "" "ptr_" "byte_"; do if grep -En "g_${p}array_free \(([^ ,]+), TRUE\)" "$@"; then echo "^^^ Our coding style is to use g_${p}array_unref in the case " echo " the underlying C array is not used" fail=1 fi done if test -n "$CHECK_FOR_LONG_LINES" then if egrep -n '.{80,}' "$@" then echo "^^^ The above files contain long lines" fail=1 fi fi exit $fail telepathy-salut-0.8.1/lib/ext/wocky/tools/flymake.mk0000644000175000017500000000014411720473445022170 0ustar00wjtwjt00000000000000check-syntax: $(CC) $(AM_CPPFLAGS) $(AM_CFLAGS) -fsyntax-only $(CHK_SOURCES) .PHONY: check-syntax telepathy-salut-0.8.1/lib/ext/wocky/tools/Makefile.am0000644000175000017500000000017711720473445022251 0ustar00wjtwjt00000000000000EXTRA_DIST = \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ flymake.mk telepathy-salut-0.8.1/lib/ext/wocky/tools/check-coding-style.mk0000644000175000017500000000076411720473445024224 0ustar00wjtwjt00000000000000check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \ exit "$$fail";\ else \ exit 0;\ fi telepathy-salut-0.8.1/lib/ext/wocky/tools/Makefile.in0000644000175000017500000002756712051456054022271 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.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 = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ flymake.mk 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: telepathy-salut-0.8.1/lib/ext/wocky/ltmain.sh0000644000175000017500000105202612051456046020672 0ustar00wjtwjt00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 telepathy-salut-0.8.1/lib/ext/wocky/COPYING0000644000175000017500000006363711720473445020122 0ustar00wjtwjt00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 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 Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! telepathy-salut-0.8.1/lib/ext/wocky/config.sub0000755000175000017500000010532712051456053021035 0ustar00wjtwjt00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-salut-0.8.1/lib/ext/wocky/docs/0000755000175000017500000000000012051456452017775 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/docs/Makefile.am0000644000175000017500000000002411720473445022030 0ustar00wjtwjt00000000000000SUBDIRS = reference telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/0000755000175000017500000000000012051456453021734 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/wocky-overrides.txt0000644000175000017500000000000011720473445025621 0ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/Makefile.am0000644000175000017500000000733512050202021023753 0ustar00wjtwjt00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE= wocky # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR=$(abs_top_srcdir)/wocky $(abs_top_builddir)/wocky # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types --rebuild-sections # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # If we're building out of tree, we need to scan wocky/ under the builddir as # well as under the sourcedir (which is specified above with DOC_SOURCE_DIR) to # pick up the enumtypes. # # If we're building in-tree, well, we'd just better hope gtkdoc doesn't mind # scanning stuff twice. SCAN_OPTIONS += --source-dir=$(abs_top_builddir)/wocky MKDB_OPTIONS += --source-dir=$(abs_top_builddir)/wocky # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/wocky/*.h $(top_builddir)/wocky/*.h CFILE_GLOB=$(top_srcdir)/wocky/*.c $(top_builddir)/wocky/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files= # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) @GLIB_CFLAGS@ @SQLITE_CFLAGS@ GTKDOC_LIBS= @GLIB_LIBS@ @SQLITE_LIBS@ $(top_builddir)/wocky/libwocky.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = wocky-sections.txt wocky.types # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/wocky-docs.sgml0000644000175000017500000000721011720473445024704 0ustar00wjtwjt00000000000000 ]> Wocky Reference Manual API Reference Object Hierarchy API Index telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/0000755000175000017500000000000012051456453022700 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyAuthHandler.html0000644000175000017500000006723512051456453030151 0ustar00wjtwjt00000000000000 WockyAuthHandler

    WockyAuthHandler

    WockyAuthHandler

    Synopsis

    gboolean            (*WockyAuthAuthDataFunc)            (WockyAuthHandler *handler,
                                                             const GString *data,
                                                             GString **response,
                                                             GError **error);
    struct              WockyAuthHandlerIface;
    gboolean            (*WockyAuthInitialResponseFunc)     (WockyAuthHandler *handler,
                                                             GString **initial_data,
                                                             GError **error);
    gboolean            (*WockyAuthSuccessFunc)             (WockyAuthHandler *handler,
                                                             GError **error);
    gboolean            wocky_auth_handler_get_initial_response
                                                            (WockyAuthHandler *handler,
                                                             GString **initial_data,
                                                             GError **error);
    const gchar *       wocky_auth_handler_get_mechanism    (WockyAuthHandler *handler);
    gboolean            wocky_auth_handler_handle_auth_data (WockyAuthHandler *handler,
                                                             const GString *data,
                                                             GString **response,
                                                             GError **error);
    gboolean            wocky_auth_handler_handle_success   (WockyAuthHandler *handler,
                                                             GError **error);
    gboolean            wocky_auth_handler_is_plain         (WockyAuthHandler *handler);
    

    Description

    Details

    WockyAuthAuthDataFunc ()

    gboolean            (*WockyAuthAuthDataFunc)            (WockyAuthHandler *handler,
                                                             const GString *data,
                                                             GString **response,
                                                             GError **error);

    struct WockyAuthHandlerIface

    struct WockyAuthHandlerIface {
        GTypeInterface parent;
        gchar *mechanism;
        gboolean plain;
        WockyAuthInitialResponseFunc initial_response_func;
        WockyAuthAuthDataFunc auth_data_func;
        WockyAuthSuccessFunc success_func;
    };
    

    GTypeInterface parent;

    The parent interface.

    gchar *mechanism;

    The AUTH mechanism which this handler responds to challenges for.

    gboolean plain;

    Whether the mechanism this handler handles sends secrets in plaintext.

    WockyAuthInitialResponseFunc initial_response_func;

    Called when the initial <auth /> stanza is generated

    WockyAuthAuthDataFunc auth_data_func;

    Called when any authentication data from the server is received

    WockyAuthSuccessFunc success_func;

    Called when a <success/> stanza is received.

    WockyAuthInitialResponseFunc ()

    gboolean            (*WockyAuthInitialResponseFunc)     (WockyAuthHandler *handler,
                                                             GString **initial_data,
                                                             GError **error);

    Called when authentication begins, if the mechanism allows a response to an implicit challenge during AUTH initiation (which, in XMPP, corresponds to sending the <auth/> stanza to the server).

    The function should return TRUE on success, and optionally set the initial_data to a string if there is initial data to send. On error, it should return FALSE and set error.

    handler :

    a WockyAuthHandler object

    initial_data :

    a GString location to fill with the initial data. [out]

    error :

    an optional location for a GError to fill, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    WockyAuthSuccessFunc ()

    gboolean            (*WockyAuthSuccessFunc)             (WockyAuthHandler *handler,
                                                             GError **error);

    Called when a <success/> stanza is received during authentication. If no error is returned, then authentication is considered finished. (Typically, an error is only raised if the <success/> stanza was received earlier than expected)

    handler :

    a WockyAuthHandler object

    error :

    an optional location for a GError to fill, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    wocky_auth_handler_get_initial_response ()

    gboolean            wocky_auth_handler_get_initial_response
                                                            (WockyAuthHandler *handler,
                                                             GString **initial_data,
                                                             GError **error);

    Called when authentication begins to fetch the initial data to send to the server in the <auth/> stanza.

    If this function returns TRUE, initial_data will be non-NULL if handler provides an initial response, and NULL otherwise.

    handler :

    a handler for a SASL mechanism

    initial_data :

    initial data to send to the server, if any. [out][transfer full]

    error :

    an optional location for a GError to fill, or NULL

    Returns :

    TRUE on success; FALSE otherwise.

    wocky_auth_handler_get_mechanism ()

    const gchar *       wocky_auth_handler_get_mechanism    (WockyAuthHandler *handler);

    Returns the name of the SASL mechanism handler implements.

    handler :

    a handler for a SASL mechanism.

    Returns :

    the name of the SASL mechanism handler implements.

    wocky_auth_handler_handle_auth_data ()

    gboolean            wocky_auth_handler_handle_auth_data (WockyAuthHandler *handler,
                                                             const GString *data,
                                                             GString **response,
                                                             GError **error);

    Asks handler to respond to a <challenge/> stanza or a <success/> with data. On success, handler will put response data into response, Base64-encoding it if appropriate.

    handler :

    a WockyAuthHandler object

    data :

    the challenge string

    response :

    a location to fill with a challenge response in a GString. [out][transfer full]

    error :

    an optional location for a GError to fill, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    wocky_auth_handler_handle_success ()

    gboolean            wocky_auth_handler_handle_success   (WockyAuthHandler *handler,
                                                             GError **error);

    Called when a <success/> stanza is received during authentication. If no error is returned, then authentication is considered finished. (Typically, an error is only raised if the <success/> stanza was received earlier than expected)

    handler :

    a WockyAuthHandler object

    error :

    an optional location for a GError to fill, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    wocky_auth_handler_is_plain ()

    gboolean            wocky_auth_handler_is_plain         (WockyAuthHandler *handler);

    Checks whether handler sends secrets in plaintext. This may be used to decide whether to use handler on an insecure XMPP connection.

    handler :

    a handler for a SASL mechanism.

    Returns :

    TRUE if handler sends secrets in plaintext.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky.html0000644000175000017500000001023612051456453026056 0ustar00wjtwjt00000000000000 wocky

    wocky

    wocky

    Synopsis

    #define             WOCKY_H_INSIDE
    void                wocky_deinit                        (void);
    void                wocky_init                          (void);
    

    Description

    Details

    WOCKY_H_INSIDE

    #define WOCKY_H_INSIDE
    

    wocky_deinit ()

    void                wocky_deinit                        (void);

    Clean up any resources created by Wocky in wocky_init().

    It is normally not needed to call this function in a normal application as the resources will automatically be freed when the program terminates. This function is therefore mostly used by testsuites and other memory profiling tools.

    After this call Wocky (including this method) should not be used anymore.


    wocky_init ()

    void                wocky_init                          (void);

    Initializes the Wocky library.

    This function should be called before calling any other Wocky functions.

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyXmppReader.html0000644000175000017500000004136212051456453030012 0ustar00wjtwjt00000000000000 WockyXmppReader

    WockyXmppReader

    WockyXmppReader — Xmpp XML to stanza deserializer

    Synopsis

    #define             WOCKY_XMPP_READER_ERROR
    struct              WockyXmppReaderClass;
    enum                WockyXmppReaderError;
    enum                WockyXmppReaderState;
    GQuark              wocky_xmpp_reader_error_quark       (void);
    GError *            wocky_xmpp_reader_get_error         (WockyXmppReader *reader);
    WockyXmppReaderState wocky_xmpp_reader_get_state        (WockyXmppReader *reader);
    WockyXmppReader *   wocky_xmpp_reader_new               (void);
    WockyXmppReader *   wocky_xmpp_reader_new_no_stream     (void);
    WockyStanza *       wocky_xmpp_reader_peek_stanza       (WockyXmppReader *reader);
    WockyStanza *       wocky_xmpp_reader_pop_stanza        (WockyXmppReader *reader);
    void                wocky_xmpp_reader_push              (WockyXmppReader *reader,
                                                             const guint8 *data,
                                                             gsize length);
    void                wocky_xmpp_reader_reset             (WockyXmppReader *reader);
    

    Object Hierarchy

      GEnum
       +----WockyXmppReaderError
    
      GEnum
       +----WockyXmppReaderState
    

    Description

    The WockyXmppReader deserializes XML to WockyStanzas, misc, other

    Details

    WOCKY_XMPP_READER_ERROR

    #define WOCKY_XMPP_READER_ERROR (wocky_xmpp_reader_error_quark ())
    

    Get access to the error quark of the reader.


    struct WockyXmppReaderClass

    struct WockyXmppReaderClass {
    };
    

    The class of a WockyXmppReader.


    enum WockyXmppReaderError

    typedef enum {
      WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START,
      WOCKY_XMPP_READER_ERROR_PARSE_ERROR,
    } WockyXmppReaderError;
    

    The different errors that can occur while reading a stream

    WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START

    invalid start of xmpp stream

    WOCKY_XMPP_READER_ERROR_PARSE_ERROR

    error in parsing the XML

    enum WockyXmppReaderState

    typedef enum {
      WOCKY_XMPP_READER_STATE_INITIAL,
      WOCKY_XMPP_READER_STATE_OPENED,
      WOCKY_XMPP_READER_STATE_CLOSED,
      WOCKY_XMPP_READER_STATE_ERROR,
    } WockyXmppReaderState;
    

    The possible states a reader can be in.

    WOCKY_XMPP_READER_STATE_INITIAL

    initial state

    WOCKY_XMPP_READER_STATE_OPENED

    stream is open

    WOCKY_XMPP_READER_STATE_CLOSED

    stream has been closed

    WOCKY_XMPP_READER_STATE_ERROR

    stream reader hit an error

    wocky_xmpp_reader_error_quark ()

    GQuark              wocky_xmpp_reader_error_quark       (void);

    Get the error quark used by the reader.

    Returns :

    the quark for reader errors.

    wocky_xmpp_reader_get_error ()

    GError *            wocky_xmpp_reader_get_error         (WockyXmppReader *reader);

    Get the error from the reader

    reader :

    a WockyXmppReader

    Returns :

    A copy of the error as encountered by the reader or NULL if there was no error. Free after use.

    wocky_xmpp_reader_get_state ()

    WockyXmppReaderState wocky_xmpp_reader_get_state        (WockyXmppReader *reader);

    reader :

    a WockyXmppReader

    Returns :

    The current state of the reader

    wocky_xmpp_reader_new ()

    WockyXmppReader *   wocky_xmpp_reader_new               (void);

    Convenience function to create a new WockyXmppReader.

    Returns :

    a new WockyXmppReader

    wocky_xmpp_reader_new_no_stream ()

    WockyXmppReader *   wocky_xmpp_reader_new_no_stream     (void);

    Convenience function to create a new WockyXmppReader that has streaming mode disabled.

    Returns :

    a new WockyXmppReader in non-streaming mode

    wocky_xmpp_reader_peek_stanza ()

    WockyStanza *       wocky_xmpp_reader_peek_stanza       (WockyXmppReader *reader);

    Returns the first WockyStanza available from reader or NULL if there are no available stanzas. The stanza is not removed from the readers queue

    reader :

    a WockyXmppReader

    Returns :

    One WockyStanza or NULL if there are no available stanzas. The stanza is owned by the WockyXmppReader

    wocky_xmpp_reader_pop_stanza ()

    WockyStanza *       wocky_xmpp_reader_pop_stanza        (WockyXmppReader *reader);

    Gets one WockyStanza out of the reader or NULL if there are no available stanzas.

    reader :

    a WockyXmppReader

    Returns :

    One WockyStanza or NULL if there are no available stanzas. Caller owns the returned stanza.

    wocky_xmpp_reader_push ()

    void                wocky_xmpp_reader_push              (WockyXmppReader *reader,
                                                             const guint8 *data,
                                                             gsize length);

    Push an amount of data to parse.

    reader :

    a WockyXmppReader

    data :

    Data to read

    length :

    Size of data

    wocky_xmpp_reader_reset ()

    void                wocky_xmpp_reader_reset             (WockyXmppReader *reader);

    Reset the xml parser.

    reader :

    a WockyXmppReader
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockySession.html0000644000175000017500000002210612051456453026227 0ustar00wjtwjt00000000000000 WockySession

    WockySession

    WockySession

    Synopsis

    #include <wocky/wocky-session.h>
    
    struct              WockySessionClass;
    WockyContactFactory * wocky_session_get_contact_factory (WockySession *session);
    const gchar *       wocky_session_get_jid               (WockySession *session);
    WockyPorter *       wocky_session_get_porter            (WockySession *session);
    WockySession *      wocky_session_new_ll                (const gchar *full_jid);
    WockySession *      wocky_session_new_with_connection   (WockyXmppConnection *conn,
                                                             const gchar *full_jid);
    void                wocky_session_set_jid               (WockySession *session,
                                                             const gchar *jid);
    void                wocky_session_start                 (WockySession *session);
    

    Description

    Details

    struct WockySessionClass

    struct WockySessionClass {
    };
    

    The class of a WockySession.


    wocky_session_get_contact_factory ()

    WockyContactFactory * wocky_session_get_contact_factory (WockySession *session);

    wocky_session_get_jid ()

    const gchar *       wocky_session_get_jid               (WockySession *session);

    wocky_session_get_porter ()

    WockyPorter *       wocky_session_get_porter            (WockySession *session);

    wocky_session_new_ll ()

    WockySession *      wocky_session_new_ll                (const gchar *full_jid);

    wocky_session_new_with_connection ()

    WockySession *      wocky_session_new_with_connection   (WockyXmppConnection *conn,
                                                             const gchar *full_jid);

    wocky_session_set_jid ()

    void                wocky_session_set_jid               (WockySession *session,
                                                             const gchar *jid);

    wocky_session_start ()

    void                wocky_session_start                 (WockySession *session);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyXmppWriter.html0000644000175000017500000004312112051456453030057 0ustar00wjtwjt00000000000000 WockyXmppWriter

    WockyXmppWriter

    WockyXmppWriter — Xmpp stanza to XML serializer

    Synopsis

    struct              WockyXmppWriterClass;
    void                wocky_xmpp_writer_flush             (WockyXmppWriter *writer);
    WockyXmppWriter *   wocky_xmpp_writer_new               (void);
    WockyXmppWriter *   wocky_xmpp_writer_new_no_stream     (void);
    void                wocky_xmpp_writer_stream_close      (WockyXmppWriter *writer,
                                                             const guint8 **data,
                                                             gsize *length);
    void                wocky_xmpp_writer_stream_open       (WockyXmppWriter *writer,
                                                             const gchar *to,
                                                             const gchar *from,
                                                             const gchar *version,
                                                             const gchar *lang,
                                                             const gchar *id,
                                                             const guint8 **data,
                                                             gsize *length);
    void                wocky_xmpp_writer_write_node_tree   (WockyXmppWriter *writer,
                                                             WockyNodeTree *tree,
                                                             const guint8 **data,
                                                             gsize *length);
    void                wocky_xmpp_writer_write_stanza      (WockyXmppWriter *writer,
                                                             WockyStanza *stanza,
                                                             const guint8 **data,
                                                             gsize *length);
    

    Description

    The WockyXmppWriter serializes WockyStanzas and xmpp stream opening and closing to raw XML. The various functions provide a pointer to an internal buffer, which remains valid until the next call to the writer.

    Details

    struct WockyXmppWriterClass

    struct WockyXmppWriterClass {
    };
    

    The class of a WockyXmppWriter.


    wocky_xmpp_writer_flush ()

    void                wocky_xmpp_writer_flush             (WockyXmppWriter *writer);

    Flushes and frees the internal data buffer

    writer :

    a WockyXmppWriter

    wocky_xmpp_writer_new ()

    WockyXmppWriter *   wocky_xmpp_writer_new               (void);

    Convenience function to create a new WockyXmppWriter.

    Returns :

    a new WockyXmppWriter

    wocky_xmpp_writer_new_no_stream ()

    WockyXmppWriter *   wocky_xmpp_writer_new_no_stream     (void);

    Convenience function to create a new WockyXmppWriter that has streaming mode disabled.

    Returns :

    a new WockyXmppWriter in non-streaming mode

    wocky_xmpp_writer_stream_close ()

    void                wocky_xmpp_writer_stream_close      (WockyXmppWriter *writer,
                                                             const guint8 **data,
                                                             gsize *length);

    Create the XML closing footer of an XMPP stream . The result is available in the data buffer. The buffer is only valid until the next call to a function

    This function can only be called in streaming mode.

    writer :

    a WockyXmppWriter

    data :

    location to store a pointer to the data buffer

    length :

    length of the data buffer

    wocky_xmpp_writer_stream_open ()

    void                wocky_xmpp_writer_stream_open       (WockyXmppWriter *writer,
                                                             const gchar *to,
                                                             const gchar *from,
                                                             const gchar *version,
                                                             const gchar *lang,
                                                             const gchar *id,
                                                             const guint8 **data,
                                                             gsize *length);

    Create the XML opening header of an XMPP stream. The result is available in the data buffer. The buffer is only valid until the next call to a function the writer.

    This function can only be called in streaming mode.

    writer :

    a WockyXmppWriter

    to :

    the target of the stream opening (usually the xmpp server name)

    from :

    the sender of the stream opening (usually the jid of the client)

    version :

    XMPP version

    lang :

    default XMPP stream language

    id :

    XMPP Stream ID, if any, or NULL

    data :

    location to store a pointer to the data buffer

    length :

    length of the data buffer

    wocky_xmpp_writer_write_node_tree ()

    void                wocky_xmpp_writer_write_node_tree   (WockyXmppWriter *writer,
                                                             WockyNodeTree *tree,
                                                             const guint8 **data,
                                                             gsize *length);

    Serialize the tree to XML. The result is available in the data buffer. The buffer is only valid until the next call to a function. This function may only be called in non-streaming mode.

    writer :

    a WockyXmppWriter

    tree :

    the node tree to serialize

    data :

    location to store a pointer to the data buffer

    length :

    length of the data buffer

    wocky_xmpp_writer_write_stanza ()

    void                wocky_xmpp_writer_write_stanza      (WockyXmppWriter *writer,
                                                             WockyStanza *stanza,
                                                             const guint8 **data,
                                                             gsize *length);

    Serialize the stanza to XML. The result is available in the data buffer. The buffer is only valid until the next call to a function

    writer :

    a WockyXmppWriter

    stanza :

    the stanza to serialize

    data :

    location to store a pointer to the data buffer

    length :

    length of the data buffer
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/up.png0000644000175000017500000000062612051456453024036 0ustar00wjtwjt00000000000000PNG  IHDRw=bKGD pHYs  ~tIME2.E#IDATx=J@Fo] !+2[Z<@/9|t$D9nnBjBRIsI:H8UPN1fcsN95M㧖ɵ 束1~pEe$I 7nrDf!;`'ykI䲤sI_]y^^I>O>?YBIENDB`telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyPubsubNode.html0000644000175000017500000020332512051456453026656 0ustar00wjtwjt00000000000000 WockyPubsubNode

    WockyPubsubNode

    WockyPubsubNode

    Synopsis

    struct              WockyPubsubAffiliation;
    enum                WockyPubsubAffiliationState;
    struct              WockyPubsubNodeClass;
    WockyPubsubAffiliation * wocky_pubsub_affiliation_copy  (WockyPubsubAffiliation *aff);
    void                wocky_pubsub_affiliation_free       (WockyPubsubAffiliation *aff);
    GList *             wocky_pubsub_affiliation_list_copy  (GList *affs);
    void                wocky_pubsub_affiliation_list_free  (GList *affs);
    WockyPubsubAffiliation * wocky_pubsub_affiliation_new   (WockyPubsubNode *node,
                                                             const gchar *jid,
                                                             WockyPubsubAffiliationState state);
    void                wocky_pubsub_node_delete_async      (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_pubsub_node_delete_finish     (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_pubsub_node_get_configuration_async
                                                            (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyDataForm *     wocky_pubsub_node_get_configuration_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    const gchar *       wocky_pubsub_node_get_name          (WockyPubsubNode *self);
    void                wocky_pubsub_node_list_affiliates_async
                                                            (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_pubsub_node_list_affiliates_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GList **affiliates,
                                                             GError **error);
    void                wocky_pubsub_node_list_subscribers_async
                                                            (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_pubsub_node_list_subscribers_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GList **subscribers,
                                                             GError **error);
    WockyStanza *       wocky_pubsub_node_make_publish_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_out,
                                                             WockyNode **publish_out,
                                                             WockyNode **item_out);
    void                wocky_pubsub_node_modify_affiliates_async
                                                            (WockyPubsubNode *self,
                                                             const GList *affiliates,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_pubsub_node_modify_affiliates_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_pubsub_node_subscribe_async   (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyPubsubSubscription * wocky_pubsub_node_subscribe_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_pubsub_node_unsubscribe_async (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             const gchar *subid,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_pubsub_node_unsubscribe_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    

    Object Hierarchy

      GBoxed
       +----WockyPubsubAffiliation
    
      GEnum
       +----WockyPubsubAffiliationState
    

    Description

    Details

    struct WockyPubsubAffiliation

    struct WockyPubsubAffiliation {
        WockyPubsubNode *node;
        gchar *jid;
        WockyPubsubAffiliationState state;
    };
    

    Represents an affiliation to a node, as returned by wocky_pubsub_node_list_affiliates_finish().

    WockyPubsubNode *node;

    the node to which this affiliation relates

    gchar *jid;

    the bare JID affiliated to node

    WockyPubsubAffiliationState state;

    the state of jid's affiliation to node

    enum WockyPubsubAffiliationState

    typedef enum {
        WOCKY_PUBSUB_AFFILIATION_OWNER,
        WOCKY_PUBSUB_AFFILIATION_PUBLISHER,
        WOCKY_PUBSUB_AFFILIATION_PUBLISH_ONLY,
        WOCKY_PUBSUB_AFFILIATION_MEMBER,
        WOCKY_PUBSUB_AFFILIATION_NONE,
        WOCKY_PUBSUB_AFFILIATION_OUTCAST
    } WockyPubsubAffiliationState;
    

    Possible affiliations to a PubSub node, which determine privileges an entity has. See XEP-0060 §4.1 for the details.

    WOCKY_PUBSUB_AFFILIATION_OWNER

    Owner

    WOCKY_PUBSUB_AFFILIATION_PUBLISHER

    Publisher

    WOCKY_PUBSUB_AFFILIATION_PUBLISH_ONLY

    Publish-Only

    WOCKY_PUBSUB_AFFILIATION_MEMBER

    Member

    WOCKY_PUBSUB_AFFILIATION_NONE

    None

    WOCKY_PUBSUB_AFFILIATION_OUTCAST

    Outcast

    struct WockyPubsubNodeClass

    struct WockyPubsubNodeClass {
    };
    

    The class of a WockyPubsubNode.


    wocky_pubsub_affiliation_copy ()

    WockyPubsubAffiliation * wocky_pubsub_affiliation_copy  (WockyPubsubAffiliation *aff);

    aff :

    an existing affiliation structure

    Returns :

    a duplicate of aff; the duplicate should ultimately be freed with wocky_pubsub_affiliation_free()

    wocky_pubsub_affiliation_free ()

    void                wocky_pubsub_affiliation_free       (WockyPubsubAffiliation *aff);

    Frees an affiliation, previously allocated with wocky_pubsub_affiliation_new() or wocky_pubsub_affiliation_copy()

    aff :

    an affiliation

    wocky_pubsub_affiliation_list_copy ()

    GList *             wocky_pubsub_affiliation_list_copy  (GList *affs);

    Shorthand for manually copying affs, duplicating each element with wocky_pubsub_affiliation_copy().

    affs :

    a list of WockyPubsubAffiliation

    Returns :

    a deep copy of affs, which should ultimately be freed with wocky_pubsub_affiliation_list_free().

    wocky_pubsub_affiliation_list_free ()

    void                wocky_pubsub_affiliation_list_free  (GList *affs);

    Frees a list of WockyPubsubAffiliation structures, as shorthand for calling wocky_pubsub_affiliation_free() for each element, followed by g_list_free().

    affs :

    a list of WockyPubsubAffiliation

    wocky_pubsub_affiliation_new ()

    WockyPubsubAffiliation * wocky_pubsub_affiliation_new   (WockyPubsubNode *node,
                                                             const gchar *jid,
                                                             WockyPubsubAffiliationState state);

    node :

    a node

    jid :

    the JID affiliated to node

    state :

    the state of jid's affiliation to node

    Returns :

    a new structure representing an affiliation, which should ultimately be freed with wocky_pubsub_affiliation_free()

    wocky_pubsub_node_delete_async ()

    void                wocky_pubsub_node_delete_async      (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_pubsub_node_delete_finish ()

    gboolean            wocky_pubsub_node_delete_finish     (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_pubsub_node_get_configuration_async ()

    void                wocky_pubsub_node_get_configuration_async
                                                            (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Retrieves the current configuration for a node owned by the user.

    self :

    a node

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    a callback to call when the request is completed

    user_data :

    data to pass to callback

    wocky_pubsub_node_get_configuration_finish ()

    WockyDataForm *     wocky_pubsub_node_get_configuration_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    Complete a call to wocky_pubsub_node_get_configuration_async().

    self :

    a node

    result :

    the result

    error :

    location at which to store an error, if one occurred.

    Returns :

    a form representing the node configuration on success; NULL and sets error otherwise

    wocky_pubsub_node_get_name ()

    const gchar *       wocky_pubsub_node_get_name          (WockyPubsubNode *self);

    wocky_pubsub_node_list_affiliates_async ()

    void                wocky_pubsub_node_list_affiliates_async
                                                            (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Retrieves the list of entities affilied to a node you own. callback may complete the call using wocky_pubsub_node_list_affiliates_finish().

    (A note on naming: this is §8.9.1 — Retrieve Affiliations List — in XEP-0060, not to be confused with §5.7 — Retrieve Affiliations. The slightly different terminology in Wocky is intended to help disambiguate!)

    self :

    a pubsub node

    cancellable :

    optional GCancellable object

    callback :

    function to call when the affiliates have been retrieved or an error has occured

    user_data :

    data to pass to callback.

    wocky_pubsub_node_list_affiliates_finish ()

    gboolean            wocky_pubsub_node_list_affiliates_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GList **affiliates,
                                                             GError **error);

    Completes a call to wocky_pubsub_node_list_affiliates_async(). The list returned in affiliates should be freed with wocky_pubsub_affiliation_list_free() when it is no longer needed.

    self :

    a pubsub node

    result :

    the result passed to a callback

    affiliates :

    location at which to store a list of WockyPubsubAffiliation pointers, or NULL

    error :

    location at which to store an error, or NULL

    Returns :

    TRUE if the list of subscribers was successfully retrieved; FALSE and sets error if an error occured.

    wocky_pubsub_node_list_subscribers_async ()

    void                wocky_pubsub_node_list_subscribers_async
                                                            (WockyPubsubNode *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Retrieves the list of subscriptions to a node you own. callback may complete the call using wocky_pubsub_node_list_subscribers_finish().

    (A note on naming: this is §8.8.1 — Retrieve Subscriptions List — in XEP-0060, not to be confused with §5.6 — Retrieve Subscriptions. The different terminology in Wocky is intended to help disambiguate!)

    self :

    a pubsub node

    cancellable :

    optional GCancellable object

    callback :

    function to call when the subscribers have been retrieved or an error has occured

    user_data :

    data to pass to callback.

    wocky_pubsub_node_list_subscribers_finish ()

    gboolean            wocky_pubsub_node_list_subscribers_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GList **subscribers,
                                                             GError **error);

    Completes a call to wocky_pubsub_node_list_subscribers_async(). The list returned in subscribers should be freed with wocky_pubsub_subscription_list_free() when it is no longer needed.

    self :

    a pubsub node

    result :

    the result passed to a callback

    subscribers :

    location at which to store a list of WockyPubsubSubscription pointers, or NULL

    error :

    location at which to store an error, or NULL

    Returns :

    TRUE if the list of subscribers was successfully retrieved; FALSE and sets error if an error occured.

    wocky_pubsub_node_make_publish_stanza ()

    WockyStanza *       wocky_pubsub_node_make_publish_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_out,
                                                             WockyNode **publish_out,
                                                             WockyNode **item_out);

    wocky_pubsub_node_modify_affiliates_async ()

    void                wocky_pubsub_node_modify_affiliates_async
                                                            (WockyPubsubNode *self,
                                                             const GList *affiliates,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Modifies the entities affiliated to a node that you own.

    self :

    a pubsub node

    affiliates :

    a list of WockyPubsubAffiliation structures, describing only the affiliations which should be changed.

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    a callback to call when the request is completed

    user_data :

    data to pass to callback

    wocky_pubsub_node_modify_affiliates_finish ()

    gboolean            wocky_pubsub_node_modify_affiliates_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    Complete a call to wocky_pubsub_node_modify_affiliates_async().

    self :

    a node

    result :

    the result

    error :

    location at which to store an error, if one occurred.

    Returns :

    TRUE if the affiliates were successfully modified; FALSE and sets error otherwise.

    wocky_pubsub_node_subscribe_async ()

    void                wocky_pubsub_node_subscribe_async   (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Attempts to subscribe to self.

    self :

    a pubsub node

    jid :

    the JID to use as the subscribed JID (usually the connection's bare or full JID); may not be NULL

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    a callback to call when the request is completed

    user_data :

    data to pass to callback

    wocky_pubsub_node_subscribe_finish ()

    WockyPubsubSubscription * wocky_pubsub_node_subscribe_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_pubsub_node_unsubscribe_async ()

    void                wocky_pubsub_node_unsubscribe_async (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             const gchar *subid,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Attempts to unsubscribe from self.

    self :

    a pubsub node

    jid :

    the JID subscribed to self (usually the connection's bare or full JID); may not be NULL

    subid :

    the identifier associated with the subscription

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    a callback to call when the request is completed

    user_data :

    data to pass to callback

    wocky_pubsub_node_unsubscribe_finish ()

    gboolean            wocky_pubsub_node_unsubscribe_finish
                                                            (WockyPubsubNode *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/home.png0000644000175000017500000000121612051456453024336 0ustar00wjtwjt00000000000000PNG  IHDRw=bKGD pHYs  ~tIME1KvIDATxՕkq?rCp ~CnpCAAJ .B-\'G]:ܠC -(8 Ԁ!fDғklbRoyxwpðIJ<of_-@RHf֟t^ښ$Q|pgv;X^^&s(bwwZF9&3඙ ^IRZUE.0Z]]U PYM8HGIekqqҀ! $۬3n e{-/seeeÌXOͷ$8==USQRR'9-s+B^ Cەs+%<7W :2IENDB`telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyPepService.html0000644000175000017500000004140112051456453030002 0ustar00wjtwjt00000000000000 WockyPepService

    WockyPepService

    WockyPepService — Object to represent a single PEP service

    Synopsis

    #include <wocky/wocky-pep-service.h>
    
    struct              WockyPepServiceClass;
    void                wocky_pep_service_get_async         (WockyPepService *self,
                                                             WockyBareContact *contact,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyStanza *       wocky_pep_service_get_finish        (WockyPepService *self,
                                                             GAsyncResult *result,
                                                             WockyNode **item,
                                                             GError **error);
    WockyStanza *       wocky_pep_service_make_publish_stanza
                                                            (WockyPepService *self,
                                                             WockyNode **item);
    WockyPepService *   wocky_pep_service_new               (const gchar *node,
                                                             gboolean subscribe);
    void                wocky_pep_service_start             (WockyPepService *self,
                                                             WockySession *session);
    

    Description

    Object to aid with looking up PEP nodes and listening for changes.

    Details

    struct WockyPepServiceClass

    struct WockyPepServiceClass {
    };
    

    The class of a WockyPepService.


    wocky_pep_service_get_async ()

    void                wocky_pep_service_get_async         (WockyPepService *self,
                                                             WockyBareContact *contact,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Starts an asynchronous operation to get the PEP node, "node".

    When the operation is complete, callback will be called and the function should call wocky_pep_service_get_finish().

    self :

    a WockyPepService object

    contact :

    a WockyBareContact object

    cancellable :

    an optional GCancellable object, or NULL

    callback :

    a function to call when the node is retrieved

    user_data :

    user data for callback

    wocky_pep_service_get_finish ()

    WockyStanza *       wocky_pep_service_get_finish        (WockyPepService *self,
                                                             GAsyncResult *result,
                                                             WockyNode **item,
                                                             GError **error);

    Finishes an asynchronous operation to get the PEP node, "node". For more details, see wocky_pep_service_get_async().

    self :

    a WockyPepService object

    result :

    a GAsyncResult

    item :

    on success, the first <item> element in the result, or NULL if self has no published items. [out][allow-none]

    error :

    a location to store a GError if an error occurs

    Returns :

    the WockyStanza retrieved from getting the PEP node.

    wocky_pep_service_make_publish_stanza ()

    WockyStanza *       wocky_pep_service_make_publish_stanza
                                                            (WockyPepService *self,
                                                             WockyNode **item);

    Generates a new IQ type='set' PEP publish stanza.

    self :

    a WockyPepService

    item :

    a location to store the item WockyNode, or NULL

    Returns :

    a new WockyStanza PEP publish stanza; free with g_object_unref()

    wocky_pep_service_new ()

    WockyPepService *   wocky_pep_service_new               (const gchar *node,
                                                             gboolean subscribe);

    A convenience function to create a new WockyPepService object.

    node :

    the namespace of the PEP node

    subscribe :

    TRUE if Wocky is to subscribe to the notifications of the node, otherwise FALSE

    Returns :

    a new WockyPepService

    wocky_pep_service_start ()

    void                wocky_pep_service_start             (WockyPepService *self,
                                                             WockySession *session);

    Start listening to the PEP node node and signal changes by using "changed".

    self :

    a WockyPepService object

    session :

    a WockySession object
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyCapsHash.html0000644000175000017500000001766412051456453027445 0ustar00wjtwjt00000000000000 WockyCapsHash

    WockyCapsHash

    WockyCapsHash — Utilities for computing verification string hash

    Description

    Computes verification string hashes according to XEP-0115 v1.5

    Details

    wocky_caps_hash_compute_from_lists ()

    gchar *             wocky_caps_hash_compute_from_lists  (GPtrArray *features,
                                                             GPtrArray *identities,
                                                             GPtrArray *dataforms);

    Compute the hash as defined by the XEP-0115 from a list of features, identities and dataforms.

    features :

    a GPtrArray of strings of features

    identities :

    a GPtrArray of WockyDiscoIdentity structures

    dataforms :

    a GPtrArray of WockyDataForm objects, or NULL

    Returns :

    a newly allocated string of the caps hash which should be freed using g_free()

    wocky_caps_hash_compute_from_node ()

    gchar *             wocky_caps_hash_compute_from_node   (WockyNode *node);

    Compute the hash as defined by the XEP-0115 from a received WockyNode.

    node should be the top-level node from a disco response such as the example given in XEP-0115 §5.3 "Complex Generation Example".

    node :

    a WockyNode

    Returns :

    the hash. The called must free the returned hash with g_free().
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-jabber-auth-password.html0000644000175000017500000000663412051456453032107 0ustar00wjtwjt00000000000000 wocky-jabber-auth-password

    wocky-jabber-auth-password

    wocky-jabber-auth-password

    Synopsis

    WockyJabberAuthPassword * wocky_jabber_auth_password_new
                                                            (const gchar *password);
    

    Description

    Details

    wocky_jabber_auth_password_new ()

    WockyJabberAuthPassword * wocky_jabber_auth_password_new
                                                            (const gchar *password);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/index.html0000644000175000017500000002326612051456453024706 0ustar00wjtwjt00000000000000 Wocky Reference Manual

    API Reference
    WockyAuthHandler
    wocky-auth-registry-enumtypes
    WockyAuthRegistry
    WockyBareContact — Wrapper around a roster item.
    WockyC2SPorter — Wrapper around a WockyXmppConnection providing a higher level API.
    WockyCapsCache
    wocky-connector-enumtypes
    WockyCapsHash — Utilities for computing verification string hash
    WockyConnector — Low-level XMPP connection generator.
    WockyContactFactory — creates and looks up WockyContact objects
    WockyContact
    wocky-data-form-enumtypes
    WockyDataForm — An object to represent an XMPP data form
    wocky-debug
    wocky
    wocky-heartbeat-source
    wocky-http-proxy
    WockyDiscoIdentity — Structure holding XMPP disco identity information.
    WockyJabberAuth
    wocky-jabber-auth-digest
    wocky-jabber-auth-password
    WockyMetaPorter
    wocky-muc-enumtypes
    WockyMuc
    wocky-namespaces
    WockyNode — representation of a XMPP node
    WockyNodeTree
    WockyPepService — Object to represent a single PEP service
    WockyPing — support for pings/keepalives
    WockyPorter
    wocky-pubsub-helpers
    wocky-pubsub-node-enumtypes
    WockyPubsubNode
    wocky-pubsub-node-protected
    wocky-pubsub-service-enumtypes
    WockyPubsubService
    wocky-pubsub-service-protected
    WockyResourceContact
    WockyRoster — TODO
    WockySaslAuth
    wocky-sasl-digest-md5
    wocky-sasl-utils
    wocky-sasl-plain
    wocky-sasl-scram
    WockySession
    WockyStanza
    WockyTLSConnector
    wocky-tls-enumtypes
    Wocky OpenSSL TLS — Establish TLS sessions
    WockyTLSHandler
    wocky-utils
    WockyXmppConnection — Low-level XMPP connection.
    wocky-xmpp-error-enumtypes
    wocky-xmpp-error
    wocky-xmpp-reader-enumtypes
    WockyXmppReader — Xmpp XML to stanza deserializer
    WockyXmppWriter — Xmpp stanza to XML serializer
    Object Hierarchy
    API Index
    Annotation Glossary
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyConnector.html0000644000175000017500000012617112051456453027677 0ustar00wjtwjt00000000000000 WockyConnector

    WockyConnector

    WockyConnector — Low-level XMPP connection generator.

    Synopsis

    #include <wocky/wocky-connector.h>
    
    #define             WOCKY_CONNECTOR_ERROR
    struct              WockyConnectorClass;
    enum                WockyConnectorError;
    void                wocky_connector_connect_async       (WockyConnector *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback cb,
                                                             gpointer user_data);
    WockyXmppConnection * wocky_connector_connect_finish    (WockyConnector *self,
                                                             GAsyncResult *res,
                                                             gchar **jid,
                                                             gchar **sid,
                                                             GError **error);
    GQuark              wocky_connector_error_quark         (void);
    WockyConnector *    wocky_connector_new                 (const gchar *jid,
                                                             const gchar *pass,
                                                             const gchar *resource,
                                                             WockyAuthRegistry *auth_registry,
                                                             WockyTLSHandler *tls_handler);
    void                wocky_connector_register_async      (WockyConnector *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback cb,
                                                             gpointer user_data);
    WockyXmppConnection * wocky_connector_register_finish   (WockyConnector *self,
                                                             GAsyncResult *res,
                                                             gchar **jid,
                                                             gchar **sid,
                                                             GError **error);
    void                wocky_connector_set_auth_registry   (WockyConnector *self,
                                                             WockyAuthRegistry *registry);
    void                wocky_connector_unregister_async    (WockyConnector *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback cb,
                                                             gpointer user_data);
    gboolean            wocky_connector_unregister_finish   (WockyConnector *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    

    Object Hierarchy

      GEnum
       +----WockyConnectorError
    

    Description

    See: RFC3920 XEP-0077

    Sends and receives WockyStanzas from an underlying GIOStream. negotiating TLS if possible and completing authentication with the server by the "most suitable" method available. Returns a WockyXmppConnection object to the user on successful completion.

    Can also be used to register or unregister an account: When unregistering (cancelling) an account, a WockyXmppConnection is NOT returned - a gboolean value indicating success or failure is returned instead.

    The WOCKY_DEBUG tag for this module is "connector".

    The flow of control during connection is roughly as follows: (registration/cancellation flows are not represented with here)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    tcp_srv_connected
    │
    ├→ tcp_host_connected
    │  ↓
    └→ maybe_old_ssl
       ↓
       xmpp_init ←─────────────────┬──┐
       ↓                           │  │
       xmpp_init_sent_cb           │  │
       ↓                           │  │
       xmpp_init_recv_cb           │  │
       │ ↓                         │  │
       │ xmpp_features_cb          │  │
       │ │ │ ↓                     │  │
       │ │ │ tls_module_secure_cb ─┘  │             ①
       │ │ ↓                      │             ↑
       │ │ sasl_request_auth      │             jabber_auth_done
       │ │ ↓                      │             ↑
       │ │ sasl_auth_done ────────┴─[no sasl]─→ jabber_request_auth
       │ ↓                                      ↑
       │ iq_bind_resource                       │
       │ ↓                                      │
       │ iq_bind_resource_sent_cb               │
       │ ↓                                      │
       │ iq_bind_resource_recv_cb               │
       │ ↓                                      │
       │ ①                                      │
       └──────────[old auth]────────────────────┘
    
       ①
       ↓
       establish_session ─────────→ success
       ↓                              ↑
       establish_session_sent_cb      │
       ↓                              │
       establish_session_recv_cb ─────┘

    Details

    WOCKY_CONNECTOR_ERROR

    #define WOCKY_CONNECTOR_ERROR (wocky_connector_error_quark ())
    

    Get access to the error quark of the connector.


    struct WockyConnectorClass

    struct WockyConnectorClass {
    };
    

    The class of a WockyConnector.


    enum WockyConnectorError

    typedef enum {
      WOCKY_CONNECTOR_ERROR_UNKNOWN,
      WOCKY_CONNECTOR_ERROR_IN_PROGRESS,
      WOCKY_CONNECTOR_ERROR_BAD_JID,
      WOCKY_CONNECTOR_ERROR_NON_XMPP_V1_SERVER,
      WOCKY_CONNECTOR_ERROR_BAD_FEATURES,
      WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE,
      WOCKY_CONNECTOR_ERROR_TLS_REFUSED,
      WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED,
      WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE,
      WOCKY_CONNECTOR_ERROR_BIND_FAILED,
      WOCKY_CONNECTOR_ERROR_BIND_INVALID,
      WOCKY_CONNECTOR_ERROR_BIND_DENIED,
      WOCKY_CONNECTOR_ERROR_BIND_CONFLICT,
      WOCKY_CONNECTOR_ERROR_BIND_REJECTED,
      WOCKY_CONNECTOR_ERROR_SESSION_FAILED,
      WOCKY_CONNECTOR_ERROR_SESSION_DENIED,
      WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT,
      WOCKY_CONNECTOR_ERROR_SESSION_REJECTED,
      WOCKY_CONNECTOR_ERROR_INSECURE,
      WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED,
      WOCKY_CONNECTOR_ERROR_REGISTRATION_UNAVAILABLE,
      WOCKY_CONNECTOR_ERROR_REGISTRATION_UNSUPPORTED,
      WOCKY_CONNECTOR_ERROR_REGISTRATION_EMPTY,
      WOCKY_CONNECTOR_ERROR_REGISTRATION_CONFLICT,
      WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED,
      WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED,
      WOCKY_CONNECTOR_ERROR_UNREGISTER_DENIED,
    } WockyConnectorError;
    

    The WockyConnector specific errors that can occur while connecting.

    WOCKY_CONNECTOR_ERROR_UNKNOWN

    Unexpected error condition

    WOCKY_CONNECTOR_ERROR_IN_PROGRESS

    Connection already underway

    WOCKY_CONNECTOR_ERROR_BAD_JID

    JID is invalid

    WOCKY_CONNECTOR_ERROR_NON_XMPP_V1_SERVER

    XMPP version < 1

    WOCKY_CONNECTOR_ERROR_BAD_FEATURES

    Feature stanza invalid

    WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE

    TLS unavailable

    WOCKY_CONNECTOR_ERROR_TLS_REFUSED

    TLS refused by server

    WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED

    TLS handshake failed

    WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE

    Bind not available

    WOCKY_CONNECTOR_ERROR_BIND_FAILED

    Bind failed

    WOCKY_CONNECTOR_ERROR_BIND_INVALID

    Bind args invalid

    WOCKY_CONNECTOR_ERROR_BIND_DENIED

    Bind not allowed

    WOCKY_CONNECTOR_ERROR_BIND_CONFLICT

    Bind resource in use

    WOCKY_CONNECTOR_ERROR_BIND_REJECTED

    Bind error (generic)

    WOCKY_CONNECTOR_ERROR_SESSION_FAILED

    Session failed

    WOCKY_CONNECTOR_ERROR_SESSION_DENIED

    Session refused by server

    WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT

    Session not allowed

    WOCKY_CONNECTOR_ERROR_SESSION_REJECTED

    Session error

    WOCKY_CONNECTOR_ERROR_INSECURE

    Insufficent security for requested operation

    WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED

    Account registration error

    WOCKY_CONNECTOR_ERROR_REGISTRATION_UNAVAILABLE

    Account registration not available

    WOCKY_CONNECTOR_ERROR_REGISTRATION_UNSUPPORTED

    Account registration not implemented

    WOCKY_CONNECTOR_ERROR_REGISTRATION_EMPTY

    Account registration makes no sense

    WOCKY_CONNECTOR_ERROR_REGISTRATION_CONFLICT

    Account already registered

    WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED

    Account registration rejected

    WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED

    Account cancellation failed

    WOCKY_CONNECTOR_ERROR_UNREGISTER_DENIED

    Account cancellation refused

    wocky_connector_connect_async ()

    void                wocky_connector_connect_async       (WockyConnector *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback cb,
                                                             gpointer user_data);

    Connect to the account/server specified by the self. cb should invoke wocky_connector_connect_finish().

    self :

    a WockyConnector instance.

    cancellable :

    an GCancellable, or NULL

    cb :

    a GAsyncReadyCallback to call when the operation completes.

    user_data :

    a gpointer to pass to the callback.

    wocky_connector_connect_finish ()

    WockyXmppConnection * wocky_connector_connect_finish    (WockyConnector *self,
                                                             GAsyncResult *res,
                                                             gchar **jid,
                                                             gchar **sid,
                                                             GError **error);

    Called by the callback passed to wocky_connector_connect_async().

    self :

    a WockyConnector instance.

    res :

    a GAsyncResult (from your wocky_connector_connect_async() callback).

    jid :

    (NULL to ignore) the user JID from the server is stored here.

    sid :

    (NULL to ignore) the Session ID is stored here.

    error :

    (NULL to ignore) the GError (if any) is sored here.

    Returns :

    a WockyXmppConnection instance (success), or NULL (failure).

    wocky_connector_error_quark ()

    GQuark              wocky_connector_error_quark         (void);

    wocky_connector_new ()

    WockyConnector *    wocky_connector_new                 (const gchar *jid,
                                                             const gchar *pass,
                                                             const gchar *resource,
                                                             WockyAuthRegistry *auth_registry,
                                                             WockyTLSHandler *tls_handler);

    Connect to the account/server specified by self. To set other WockyConnector properties, use g_object_new() instead.

    jid :

    a JID (user AT domain).

    pass :

    the password.

    resource :

    the resource (sans '/'), or NULL to autogenerate one.

    auth_registry :

    a WockyAuthRegistry, or NULL

    tls_handler :

    a WockyTLSHandler, or NULL

    Returns :

    a WockyConnector instance which can be used to connect to, register or cancel an account

    wocky_connector_register_async ()

    void                wocky_connector_register_async      (WockyConnector *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback cb,
                                                             gpointer user_data);

    Connect to the account/server specified by self, register (set up) the account there and then log in to it. cb should invoke wocky_connector_register_finish().

    self :

    a WockyConnector instance.

    cancellable :

    an GCancellable, or NULL

    cb :

    a GAsyncReadyCallback to call when the operation completes.

    user_data :

    a gpointer to pass to the callback cb.

    wocky_connector_register_finish ()

    WockyXmppConnection * wocky_connector_register_finish   (WockyConnector *self,
                                                             GAsyncResult *res,
                                                             gchar **jid,
                                                             gchar **sid,
                                                             GError **error);

    Called by the callback passed to wocky_connector_register_async().

    self :

    a WockyConnector instance.

    res :

    a GAsyncResult (from your wocky_connector_register_async() callback).

    jid :

    (NULL to ignore) the JID in effect after connection is stored here.

    sid :

    (NULL to ignore) the Session ID after connection is stored here.

    error :

    (NULL to ignore) the GError (if any) is stored here.

    Returns :

    a WockyXmppConnection instance (success), or NULL (failure).

    wocky_connector_set_auth_registry ()

    void                wocky_connector_set_auth_registry   (WockyConnector *self,
                                                             WockyAuthRegistry *registry);

    wocky_connector_unregister_async ()

    void                wocky_connector_unregister_async    (WockyConnector *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback cb,
                                                             gpointer user_data);

    Connect to the account/server specified by self, and unregister (cancel) the account there. cb should invoke wocky_connector_unregister_finish().

    self :

    a WockyConnector instance.

    cancellable :

    an GCancellable, or NULL

    cb :

    a GAsyncReadyCallback to call when the operation completes.

    user_data :

    a gpointer to pass to the callback cb.

    wocky_connector_unregister_finish ()

    gboolean            wocky_connector_unregister_finish   (WockyConnector *self,
                                                             GAsyncResult *res,
                                                             GError **error);

    Called by the callback passed to wocky_connector_unregister_async().

    self :

    a WockyConnector instance.

    res :

    a GAsyncResult (from the wocky_connector_unregister_async() callback).

    error :

    (NULL to ignore) the GError (if any) is stored here.

    Returns :

    a gboolean value TRUE (success), or FALSE (failure).
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyContact.html0000644000175000017500000001105012051456453026173 0ustar00wjtwjt00000000000000 WockyContact

    WockyContact

    WockyContact

    Synopsis

    #include <wocky/wocky-contact.h>
    
    struct              WockyContactClass;
    gchar *             (*WockyContactDupJidImpl)           (WockyContact *self);
    gchar *             wocky_contact_dup_jid               (WockyContact *self);
    

    Description

    Details

    struct WockyContactClass

    struct WockyContactClass {
    };
    

    The class of a WockyContact.


    WockyContactDupJidImpl ()

    gchar *             (*WockyContactDupJidImpl)           (WockyContact *self);

    wocky_contact_dup_jid ()

    gchar *             wocky_contact_dup_jid               (WockyContact *self);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyRoster.html0000644000175000017500000011465212051456453027224 0ustar00wjtwjt00000000000000 WockyRoster

    WockyRoster

    WockyRoster — TODO

    Synopsis

    #define             WOCKY_ROSTER_ERROR
    struct              WockyRosterClass;
    enum                WockyRosterError;
    enum                WockyRosterSubscriptionFlags;
    void                wocky_roster_add_contact_async      (WockyRoster *self,
                                                             const gchar *jid,
                                                             const gchar *name,
                                                             const gchar * const *groups,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_roster_add_contact_finish     (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_roster_change_contact_name_async
                                                            (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             const gchar *name,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_roster_change_contact_name_finish
                                                            (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_roster_contact_add_group_async
                                                            (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             const gchar *group,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_roster_contact_add_group_finish
                                                            (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_roster_contact_remove_group_async
                                                            (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             const gchar *group,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_roster_contact_remove_group_finish
                                                            (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    GQuark              wocky_roster_error_quark            (void);
    void                wocky_roster_fetch_roster_async     (WockyRoster *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_roster_fetch_roster_finish    (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    GSList *            wocky_roster_get_all_contacts       (WockyRoster *self);
    WockyBareContact *  wocky_roster_get_contact            (WockyRoster *self,
                                                             const gchar *jid);
    WockyRoster *       wocky_roster_new                    (WockySession *session);
    void                wocky_roster_remove_contact_async   (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_roster_remove_contact_finish  (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    const gchar *       wocky_roster_subscription_to_string (WockyRosterSubscriptionFlags subscription);
    

    Description

    TODO

    Details

    WOCKY_ROSTER_ERROR

    #define WOCKY_ROSTER_ERROR (wocky_roster_error_quark ())
    

    Get access to the error quark of the roster.


    struct WockyRosterClass

    struct WockyRosterClass {
    };
    

    The class of a WockyRoster.


    enum WockyRosterError

    typedef enum {
      WOCKY_ROSTER_ERROR_INVALID_STANZA,
      WOCKY_ROSTER_ERROR_NOT_IN_ROSTER,
    } WockyRosterError;
    

    The WockyRosterError specific errors.

    WOCKY_ROSTER_ERROR_INVALID_STANZA

    received an invalid roster stanza from the server

    WOCKY_ROSTER_ERROR_NOT_IN_ROSTER

    the contact is not in the roster

    enum WockyRosterSubscriptionFlags

    typedef enum {
      WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE = 0,
      WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO   = 1 << 0,
      WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM = 1 << 1,
      WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH =
        WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO | WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM,
    } WockyRosterSubscriptionFlags;
    

    Flags to document the subscription information between contacts.

    WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE

    the user does not have a subscription to the contact's presence information, and the contact does not have a subscription to the user's presence information

    WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO

    the user has a subscription to the contact's presence information, but the contact does not have a subscription to the user's presence information

    WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM

    the contact has a subscription to the user's presence information, but the user does not have a subscription to the contact's presence information

    WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH

    both the user and the contact have subscriptions to each other's presence information

    wocky_roster_add_contact_async ()

    void                wocky_roster_add_contact_async      (WockyRoster *self,
                                                             const gchar *jid,
                                                             const gchar *name,
                                                             const gchar * const *groups,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_roster_add_contact_finish ()

    gboolean            wocky_roster_add_contact_finish     (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_roster_change_contact_name_async ()

    void                wocky_roster_change_contact_name_async
                                                            (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             const gchar *name,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_roster_change_contact_name_finish ()

    gboolean            wocky_roster_change_contact_name_finish
                                                            (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_roster_contact_add_group_async ()

    void                wocky_roster_contact_add_group_async
                                                            (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             const gchar *group,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_roster_contact_add_group_finish ()

    gboolean            wocky_roster_contact_add_group_finish
                                                            (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_roster_contact_remove_group_async ()

    void                wocky_roster_contact_remove_group_async
                                                            (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             const gchar *group,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_roster_contact_remove_group_finish ()

    gboolean            wocky_roster_contact_remove_group_finish
                                                            (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_roster_error_quark ()

    GQuark              wocky_roster_error_quark            (void);

    Get the error quark used by the roster.

    Returns :

    the quark for roster errors.

    wocky_roster_fetch_roster_async ()

    void                wocky_roster_fetch_roster_async     (WockyRoster *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_roster_fetch_roster_finish ()

    gboolean            wocky_roster_fetch_roster_finish    (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_roster_get_all_contacts ()

    GSList *            wocky_roster_get_all_contacts       (WockyRoster *self);

    wocky_roster_get_contact ()

    WockyBareContact *  wocky_roster_get_contact            (WockyRoster *self,
                                                             const gchar *jid);

    wocky_roster_new ()

    WockyRoster *       wocky_roster_new                    (WockySession *session);

    wocky_roster_remove_contact_async ()

    void                wocky_roster_remove_contact_async   (WockyRoster *self,
                                                             WockyBareContact *contact,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_roster_remove_contact_finish ()

    gboolean            wocky_roster_remove_contact_finish  (WockyRoster *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_roster_subscription_to_string ()

    const gchar *       wocky_roster_subscription_to_string (WockyRosterSubscriptionFlags subscription);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-debug.html0000644000175000017500000000726112051456453027146 0ustar00wjtwjt00000000000000 wocky-debug

    wocky-debug

    wocky-debug

    Description

    Details

    WOCKY_DEBUG_XMPP

    #define WOCKY_DEBUG_XMPP (WOCKY_DEBUG_XMPP_READER | WOCKY_DEBUG_XMPP_WRITER)
    

    enum WockyDebugFlags

    typedef enum {
    } WockyDebugFlags;
    

    wocky_debug_set_flags ()

    void                wocky_debug_set_flags               (WockyDebugFlags flags);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-Wocky-OpenSSL-TLS.html0000644000175000017500000007277612051456453027760 0ustar00wjtwjt00000000000000 Wocky OpenSSL TLS

    Wocky OpenSSL TLS

    Wocky OpenSSL TLS — Establish TLS sessions

    Object Hierarchy

      GEnum
       +----WockyTLSCertStatus
    
      GEnum
       +----WockyTLSCertType
    
      GObject
       +----GIOStream
             +----WockyTLSConnection
    
      GObject
       +----WockyTLSSession
    
      GEnum
       +----WockyTLSVerificationLevel
    

    Properties

      "session"                  WockyTLSSession*      : Write / Construct Only
      "base-stream"              GIOStream*            : Write / Construct Only
      "dh-bits"                  guint                 : Write / Construct Only
      "server"                   gboolean              : Write / Construct Only
      "x509-cert"                gchar*                : Write / Construct Only
      "x509-key"                 gchar*                : Write / Construct Only
    

    Description

    The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug output from OpenSSL. To enable it, set it to a value from 1 to 9. Higher values will print more information.

    Increasing the value past certain thresholds will also trigger increased debugging output from within wocky-openssl.c as well.

    Details

    WOCKY_TLS_CERT_ERROR

    #define WOCKY_TLS_CERT_ERROR (wocky_tls_cert_error_quark ())
    

    WOCKY_TLS_ERROR

    #define WOCKY_TLS_ERROR (wocky_tls_error_quark ())
    

    enum WockyTLSCertStatus

    typedef enum {
      WOCKY_TLS_CERT_OK = 0,
      WOCKY_TLS_CERT_INVALID,
      WOCKY_TLS_CERT_NAME_MISMATCH,
      WOCKY_TLS_CERT_REVOKED,
      WOCKY_TLS_CERT_SIGNER_UNKNOWN,
      WOCKY_TLS_CERT_SIGNER_UNAUTHORISED,
      WOCKY_TLS_CERT_INSECURE,
      WOCKY_TLS_CERT_NOT_ACTIVE,
      WOCKY_TLS_CERT_EXPIRED,
      WOCKY_TLS_CERT_NO_CERTIFICATE,
      WOCKY_TLS_CERT_MAYBE_DOS,
      WOCKY_TLS_CERT_INTERNAL_ERROR,
      WOCKY_TLS_CERT_UNKNOWN_ERROR,
    } WockyTLSCertStatus;
    

    enum WockyTLSCertType

    typedef enum {
      WOCKY_TLS_CERT_TYPE_NONE = 0,
      WOCKY_TLS_CERT_TYPE_X509,
      WOCKY_TLS_CERT_TYPE_OPENPGP,
    } WockyTLSCertType;
    

    WockyTLSConnection

    typedef struct _WockyTLSConnection WockyTLSConnection;

    WockyTLSSession

    typedef struct _WockyTLSSession WockyTLSSession;

    enum WockyTLSVerificationLevel

    typedef enum {
      WOCKY_TLS_VERIFY_STRICT = 0,
      WOCKY_TLS_VERIFY_NORMAL,
      WOCKY_TLS_VERIFY_LENIENT,
    } WockyTLSVerificationLevel;
    

    wocky_tls_cert_error_quark ()

    GQuark              wocky_tls_cert_error_quark          (void);

    wocky_tls_error_quark ()

    GQuark              wocky_tls_error_quark               (void);

    wocky_tls_session_add_ca ()

    void                wocky_tls_session_add_ca            (WockyTLSSession *session,
                                                             const gchar *path);

    wocky_tls_session_add_crl ()

    void                wocky_tls_session_add_crl           (WockyTLSSession *session,
                                                             const gchar *path);

    wocky_tls_session_get_peers_certificate ()

    GPtrArray *         wocky_tls_session_get_peers_certificate
                                                            (WockyTLSSession *session,
                                                             WockyTLSCertType *type);

    wocky_tls_session_handshake ()

    WockyTLSConnection * wocky_tls_session_handshake        (WockyTLSSession *session,
                                                             GCancellable *cancellable,
                                                             GError **error);

    wocky_tls_session_handshake_async ()

    void                wocky_tls_session_handshake_async   (WockyTLSSession *session,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_tls_session_handshake_finish ()

    WockyTLSConnection * wocky_tls_session_handshake_finish (WockyTLSSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_tls_session_new ()

    WockyTLSSession *   wocky_tls_session_new               (GIOStream *stream);

    wocky_tls_session_server_new ()

    WockyTLSSession *   wocky_tls_session_server_new        (GIOStream *stream,
                                                             guint dhbits,
                                                             const gchar *key,
                                                             const gchar *cert);

    Create a new TLS server session

    stream :

    a GIOStream on which we expect to receive the client TLS handshake

    dhbits :

    size of the DH parameters

    key :

    the path to the X509 PEM key file

    cert :

    the path to the X509 PEM certificate

    Returns :

    a WockyTLSSession object

    wocky_tls_session_verify_peer ()

    int                 wocky_tls_session_verify_peer       (WockyTLSSession *session,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             WockyTLSVerificationLevel level,
                                                             WockyTLSCertStatus *status);

    Property Details

    The "session" property

      "session"                  WockyTLSSession*      : Write / Construct Only

    the TLS session object for this connection.


    The "base-stream" property

      "base-stream"              GIOStream*            : Write / Construct Only

    the stream that TLS communicates over.


    The "dh-bits" property

      "dh-bits"                  guint                 : Write / Construct Only

    Diffie-Hellmann bits: 768, 1024, 2048, 3072 0r 4096.

    Allowed values: [768,4096]

    Default value: 1024


    The "server" property

      "server"                   gboolean              : Write / Construct Only

    whether this is a server.

    Default value: FALSE


    The "x509-cert" property

      "x509-cert"                gchar*                : Write / Construct Only

    x509 PEM certificate file.

    Default value: NULL


    The "x509-key" property

      "x509-key"                 gchar*                : Write / Construct Only

    x509 PEM key file.

    Default value: NULL

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-digest-md5.html0000644000175000017500000001014112051456453030751 0ustar00wjtwjt00000000000000 wocky-sasl-digest-md5

    wocky-sasl-digest-md5

    wocky-sasl-digest-md5

    Synopsis

    WockySaslDigestMd5 * wocky_sasl_digest_md5_new          (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *password);
    

    Description

    Details

    wocky_sasl_digest_md5_new ()

    WockySaslDigestMd5 * wocky_sasl_digest_md5_new          (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *password);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyContactFactory.html0000644000175000017500000005605312051456453030671 0ustar00wjtwjt00000000000000 WockyContactFactory

    WockyContactFactory

    WockyContactFactory — creates and looks up WockyContact objects

    Synopsis

    #include <wocky/wocky-contact-factory.h>
    
    struct              WockyContactFactoryClass;
    void                wocky_contact_factory_add_ll_contact
                                                            (WockyContactFactory *factory,
                                                             WockyLLContact *contact);
    WockyBareContact *  wocky_contact_factory_ensure_bare_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *bare_jid);
    WockyLLContact *    wocky_contact_factory_ensure_ll_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *jid);
    WockyResourceContact * wocky_contact_factory_ensure_resource_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *full_jid);
    GList *             wocky_contact_factory_get_ll_contacts
                                                            (WockyContactFactory *factory);
    WockyBareContact *  wocky_contact_factory_lookup_bare_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *bare_jid);
    WockyLLContact *    wocky_contact_factory_lookup_ll_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *jid);
    WockyResourceContact * wocky_contact_factory_lookup_resource_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *full_jid);
    WockyContactFactory * wocky_contact_factory_new         (void);
    

    Description

    Provides a way to create WockyContact objects. The objects created this way are cached by the factory and you can eventually look them up without creating them again.

    Details

    struct WockyContactFactoryClass

    struct WockyContactFactoryClass {
    };
    

    The class of a WockyContactFactory.


    wocky_contact_factory_add_ll_contact ()

    void                wocky_contact_factory_add_ll_contact
                                                            (WockyContactFactory *factory,
                                                             WockyLLContact *contact);

    Adds contact to the contact factory.

    factory :

    a WockyContactFactory instance

    contact :

    a WockyLLContact

    wocky_contact_factory_ensure_bare_contact ()

    WockyBareContact *  wocky_contact_factory_ensure_bare_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *bare_jid);

    Returns an instance of WockyBareContact for bare_jid. The factory cache is used, but if the contact is not found in the cache, a new WockyBareContact is created and cached for future use.

    factory :

    a WockyContactFactory instance

    bare_jid :

    the JID of a bare contact

    Returns :

    a new reference to a WockyBareContact instance, which the caller is expected to release with g_object_unref() after use.

    wocky_contact_factory_ensure_ll_contact ()

    WockyLLContact *    wocky_contact_factory_ensure_ll_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *jid);

    Returns an instance of WockyLLContact for jid. The factory cache is used, but if the contact is not found in the cache, a new WockyLLContact is created and cached for future use.

    factory :

    a WockyContactFactory instance

    jid :

    the JID of a contact

    Returns :

    a new reference to a WockyLLContact instance, which the caller is expected to release with g_object_unref() after use.

    wocky_contact_factory_ensure_resource_contact ()

    WockyResourceContact * wocky_contact_factory_ensure_resource_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *full_jid);

    Returns an instance of WockyResourceContact for full_jid. The factory cache is used, but if the resource is not found in the cache, a new WockyResourceContact is created and cached for future use.

    factory :

    a WockyContactFactory instance

    full_jid :

    the full JID of a resource

    Returns :

    a new reference to a WockyResourceContact instance, which the caller is expected to release with g_object_unref() after use.

    wocky_contact_factory_get_ll_contacts ()

    GList *             wocky_contact_factory_get_ll_contacts
                                                            (WockyContactFactory *factory);

    factory :

    a WockyContactFactory instance

    Returns :

    a newly allocated GList of WockyLLContacts which should be freed using g_list_free().

    wocky_contact_factory_lookup_bare_contact ()

    WockyBareContact *  wocky_contact_factory_lookup_bare_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *bare_jid);

    Looks up if there's a WockyBareContact for bare_jid in the cache, and returns it if it's found.

    factory :

    a WockyContactFactory instance

    bare_jid :

    the JID of a bare contact

    Returns :

    a borrowed WockyBareContact instance (which the caller should reference with g_object_ref() if it will be kept), or NULL if the contact is not found.

    wocky_contact_factory_lookup_ll_contact ()

    WockyLLContact *    wocky_contact_factory_lookup_ll_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *jid);

    Looks up if there's a WockyLLContact for jid in the cache, and returns it if it's found.

    factory :

    a WockyContactFactory instance

    jid :

    the JID of a contact

    Returns :

    a borrowed WockyLLContact instance (which the caller should reference with g_object_ref() if it will be kept), or NULL if the contact is not found.

    wocky_contact_factory_lookup_resource_contact ()

    WockyResourceContact * wocky_contact_factory_lookup_resource_contact
                                                            (WockyContactFactory *factory,
                                                             const gchar *full_jid);

    Looks up if there's a WockyResourceContact for full_jid in the cache, and returns it if it's found.

    factory :

    a WockyContactFactory instance

    full_jid :

    the full JID of a resource

    Returns :

    a borrowed WockyResourceContact instance (which the caller should reference with g_object_ref() if it will be kept), or NULL if the contact is not found.

    wocky_contact_factory_new ()

    WockyContactFactory * wocky_contact_factory_new         (void);

    Convenience function to create a new WockyContactFactory object.

    Returns :

    a newly created instance of WockyContactFactory
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyStanza.html0000644000175000017500000014161212051456453027202 0ustar00wjtwjt00000000000000 WockyStanza

    WockyStanza

    WockyStanza

    Synopsis

    struct              WockyStanzaClass;
    enum                WockyStanzaSubType;
    enum                WockyStanzaType;
    WockyStanza *       wocky_stanza_build                  (WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             const gchar *to,
                                                             ...);
    WockyStanza *       wocky_stanza_build_iq_error         (WockyStanza *iq,
                                                             ...);
    WockyStanza *       wocky_stanza_build_iq_error_va      (WockyStanza *iq,
                                                             va_list ap);
    WockyStanza *       wocky_stanza_build_iq_result        (WockyStanza *iq,
                                                             ...);
    WockyStanza *       wocky_stanza_build_iq_result_va     (WockyStanza *iq,
                                                             va_list ap);
    WockyStanza *       wocky_stanza_build_to_contact       (WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             WockyContact *to,
                                                             ...);
    WockyStanza *       wocky_stanza_build_va               (WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             const gchar *to,
                                                             va_list ap);
    WockyStanza *       wocky_stanza_copy                   (WockyStanza *old);
    gboolean            wocky_stanza_extract_errors         (WockyStanza *stanza,
                                                             WockyXmppErrorType *type,
                                                             GError **core,
                                                             GError **specialized,
                                                             WockyNode **specialized_node);
    gboolean            wocky_stanza_extract_stream_error   (WockyStanza *stanza,
                                                             GError **stream_error);
    const gchar *       wocky_stanza_get_from               (WockyStanza *self);
    WockyContact *      wocky_stanza_get_from_contact       (WockyStanza *self);
    const gchar *       wocky_stanza_get_to                 (WockyStanza *self);
    WockyContact *      wocky_stanza_get_to_contact         (WockyStanza *self);
    WockyNode *         wocky_stanza_get_top_node           (WockyStanza *self);
    void                wocky_stanza_get_type_info          (WockyStanza *stanza,
                                                             WockyStanzaType *type,
                                                             WockyStanzaSubType *sub_type);
    WockyStanza *       wocky_stanza_new                    (const gchar *name,
                                                             const gchar *ns);
    void                wocky_stanza_set_from_contact       (WockyStanza *self,
                                                             WockyContact *contact);
    void                wocky_stanza_set_to_contact         (WockyStanza *self,
                                                             WockyContact *contact);
    

    Description

    Details

    struct WockyStanzaClass

    struct WockyStanzaClass {
    };
    

    The class of a WockyStanza.


    enum WockyStanzaSubType

    typedef enum {
      WOCKY_STANZA_SUB_TYPE_NONE,
      WOCKY_STANZA_SUB_TYPE_AVAILABLE,
      WOCKY_STANZA_SUB_TYPE_NORMAL,
      WOCKY_STANZA_SUB_TYPE_CHAT,
      WOCKY_STANZA_SUB_TYPE_GROUPCHAT,
      WOCKY_STANZA_SUB_TYPE_HEADLINE,
      WOCKY_STANZA_SUB_TYPE_UNAVAILABLE,
      WOCKY_STANZA_SUB_TYPE_PROBE,
      WOCKY_STANZA_SUB_TYPE_SUBSCRIBE,
      WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBE,
      WOCKY_STANZA_SUB_TYPE_SUBSCRIBED,
      WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBED,
      WOCKY_STANZA_SUB_TYPE_GET,
      WOCKY_STANZA_SUB_TYPE_SET,
      WOCKY_STANZA_SUB_TYPE_RESULT,
      WOCKY_STANZA_SUB_TYPE_ERROR,
      WOCKY_STANZA_SUB_TYPE_UNKNOWN,
    } WockyStanzaSubType;
    

    XMPP stanza sub types.

    WOCKY_STANZA_SUB_TYPE_NONE

    no sub type

    WOCKY_STANZA_SUB_TYPE_AVAILABLE

    "available" stanza sub type

    WOCKY_STANZA_SUB_TYPE_NORMAL

    "normal" stanza sub type

    WOCKY_STANZA_SUB_TYPE_CHAT

    "chat" stanza sub type

    WOCKY_STANZA_SUB_TYPE_GROUPCHAT

    "groupchat" stanza sub type

    WOCKY_STANZA_SUB_TYPE_HEADLINE

    "headline" stanza sub type

    WOCKY_STANZA_SUB_TYPE_UNAVAILABLE

    "unavailable" stanza sub type

    WOCKY_STANZA_SUB_TYPE_PROBE

    "probe" stanza sub type

    WOCKY_STANZA_SUB_TYPE_SUBSCRIBE

    "subscribe" stanza sub type

    WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBE

    "unsubscribe" stanza sub type

    WOCKY_STANZA_SUB_TYPE_SUBSCRIBED

    "subscribed" stanza sub type

    WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBED

    "unsubscribed" stanza sub type

    WOCKY_STANZA_SUB_TYPE_GET

    "get" stanza sub type

    WOCKY_STANZA_SUB_TYPE_SET

    "set" stanza sub type

    WOCKY_STANZA_SUB_TYPE_RESULT

    "result" stanza sub type

    WOCKY_STANZA_SUB_TYPE_ERROR

    "error" stanza sub type

    WOCKY_STANZA_SUB_TYPE_UNKNOWN

    unknown stanza sub type

    enum WockyStanzaType

    typedef enum {
      WOCKY_STANZA_TYPE_NONE,
      WOCKY_STANZA_TYPE_MESSAGE,
      WOCKY_STANZA_TYPE_PRESENCE,
      WOCKY_STANZA_TYPE_IQ,
      WOCKY_STANZA_TYPE_STREAM,
      WOCKY_STANZA_TYPE_STREAM_FEATURES,
      WOCKY_STANZA_TYPE_AUTH,
      WOCKY_STANZA_TYPE_CHALLENGE,
      WOCKY_STANZA_TYPE_RESPONSE,
      WOCKY_STANZA_TYPE_SUCCESS,
      WOCKY_STANZA_TYPE_FAILURE,
      WOCKY_STANZA_TYPE_STREAM_ERROR,
      WOCKY_STANZA_TYPE_UNKNOWN,
    } WockyStanzaType;
    

    XMPP stanza types.

    WOCKY_STANZA_TYPE_NONE

    no stanza type

    WOCKY_STANZA_TYPE_MESSAGE

    <message/> stanza

    WOCKY_STANZA_TYPE_PRESENCE

    <presence/> stanza

    WOCKY_STANZA_TYPE_IQ

    <iq/> stanza

    WOCKY_STANZA_TYPE_STREAM

    <stream/> stanza

    WOCKY_STANZA_TYPE_STREAM_FEATURES

    <stream:features/> stanza

    WOCKY_STANZA_TYPE_AUTH

    <auth/> stanza

    WOCKY_STANZA_TYPE_CHALLENGE

    <challenge/> stanza

    WOCKY_STANZA_TYPE_RESPONSE

    <response/> stanza

    WOCKY_STANZA_TYPE_SUCCESS

    <success/> stanza

    WOCKY_STANZA_TYPE_FAILURE

    <failure/> stanza

    WOCKY_STANZA_TYPE_STREAM_ERROR

    <stream:error/> stanza

    WOCKY_STANZA_TYPE_UNKNOWN

    unknown stanza type

    wocky_stanza_build ()

    WockyStanza *       wocky_stanza_build                  (WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             const gchar *to,
                                                             ...);

    Build a XMPP stanza from a list of arguments. Example:

    Example 3. 

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    wocky_stanza_build (
       WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
       "alice@collabora.co.uk", "bob@collabora.co.uk",
       WOCKY_NODE_START, "html",
         WOCKY_NODE_XMLNS, "http://www.w3.org/1999/xhtml",
         WOCKY_NODE, "body",
           WOCKY_NODE_ATTRIBUTE, "textcolor", "red",
           WOCKY_NODE_TEXT, "Telepathy rocks!",
         WOCKY_NODE_END,
       WOCKY_NODE_END,
      NULL);
    
    /* produces
    <message from='alice@collabora.co.uk' to='bob@collabora.co.uk'>
      <html xmlns='http://www.w3.org/1999/xhtml'>
        <body textcolor='red'>
          Telepathy rocks!
        </body>
      </html>
    </message>
    */


    You may optionally use mnemonic ASCII characters in place of the build tags, to better reflect the structure of the stanza in C source. For example, the above stanza could be written as:

    Example 4. 

    1
    2
    3
    4
    5
    6
    7
    8
    9
    wocky_stanza_build (
       WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
       "alice@collabora.co.uk", "bob@collabora.co.uk",
       '(', "html", ':', "http://www.w3.org/1999/xhtml",
         '(', "body", '@', "textcolor", "red",
           '$', "Telepathy rocks!",
         ')',
       ')'
      NULL);


    type :

    The type of stanza to build

    sub_type :

    The stanza's subtype; valid values depend on type. (For instance, WOCKY_STANZA_TYPE_IQ can use WOCKY_STANZA_SUB_TYPE_GET, but not WOCKY_STANZA_SUB_TYPE_SUBSCRIBED.)

    from :

    The sender's JID, or NULL to leave it unspecified.

    to :

    The target's JID, or NULL to leave it unspecified.

    ... :

    the description of the stanza to build, terminated with NULL

    Returns :

    a new stanza object

    wocky_stanza_build_iq_error ()

    WockyStanza *       wocky_stanza_build_iq_error         (WockyStanza *iq,
                                                             ...);

    Builds an error reply to iq containing the given body. This function also adds the child element of iq to the reply, as recommended by RFC3920 §9.2.3 ‘IQ Semantics’.

    No <error/> element is added to the reply. To add a standard stanza error, plus message, consider using wocky_stanza_error_to_node(). To add a more complicated error with an application-specific condition, specify it when calling this function. For example:

    1
    2
    3
    4
    5
    6
    7
    8
    WockyStanza *reply = wocky_stanza_build_iq_error (iq,
       '(', "error",
         '@', "type", "cancel",
         '(', "feature-not-implemented", ':', WOCKY_XMPP_NS_STANZAS, ')',
         '(', "unsupported", ':', WOCKY_XMPP_NS_PUBSUB_ERRORS,
           '@', "feature", "subscribe",
         ')',
       ')', NULL);

    iq :

    a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

    ... :

    a wocky_stanza_build() specification

    Returns :

    an error reply for iq

    wocky_stanza_build_iq_error_va ()

    WockyStanza *       wocky_stanza_build_iq_error_va      (WockyStanza *iq,
                                                             va_list ap);

    wocky_stanza_build_iq_result ()

    WockyStanza *       wocky_stanza_build_iq_result        (WockyStanza *iq,
                                                             ...);

    wocky_stanza_build_iq_result_va ()

    WockyStanza *       wocky_stanza_build_iq_result_va     (WockyStanza *iq,
                                                             va_list ap);

    wocky_stanza_build_to_contact ()

    WockyStanza *       wocky_stanza_build_to_contact       (WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             WockyContact *to,
                                                             ...);

    wocky_stanza_build_va ()

    WockyStanza *       wocky_stanza_build_va               (WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             const gchar *to,
                                                             va_list ap);

    wocky_stanza_copy ()

    WockyStanza *       wocky_stanza_copy                   (WockyStanza *old);

    wocky_stanza_extract_errors ()

    gboolean            wocky_stanza_extract_errors         (WockyStanza *stanza,
                                                             WockyXmppErrorType *type,
                                                             GError **core,
                                                             GError **specialized,
                                                             WockyNode **specialized_node);

    Given a message, iq or presence stanza with type='error', breaks it down into values describing the error. type and core are guaranteed to be set; specialized and specialized_node will be set if a recognised application-specific error is found, and the latter will be set to NULL if no application-specific error is found.

    Any or all of the out parameters may be NULL to ignore the value. The value stored in specialized_node is borrowed from stanza, and is only valid as long as the latter is alive.

    stanza :

    a message/iq/presence stanza

    type :

    location at which to store the error type

    core :

    location at which to store an error in the domain WOCKY_XMPP_ERROR

    specialized :

    location at which to store an error in an application-specific domain, if one is found

    specialized_node :

    location at which to store the node representing an application-specific error, if one is found

    Returns :

    TRUE if the stanza had type='error'; FALSE otherwise

    wocky_stanza_extract_stream_error ()

    gboolean            wocky_stanza_extract_stream_error   (WockyStanza *stanza,
                                                             GError **stream_error);

    stanza :

    a stanza

    stream_error :

    location at which to store an error in domain WOCKY_XMPP_STREAM_ERROR, if one is found.

    Returns :

    TRUE and sets stream_error if the stanza was indeed a stream error.

    wocky_stanza_get_from ()

    const gchar *       wocky_stanza_get_from               (WockyStanza *self);

    self :

    a stanza

    Returns :

    The sender of self, or NULL if no sender was specified.

    wocky_stanza_get_from_contact ()

    WockyContact *      wocky_stanza_get_from_contact       (WockyStanza *self);

    wocky_stanza_get_to ()

    const gchar *       wocky_stanza_get_to                 (WockyStanza *self);

    self :

    a stanza

    Returns :

    The recipient of self, or NULL if no recipient was specified.

    wocky_stanza_get_to_contact ()

    WockyContact *      wocky_stanza_get_to_contact         (WockyStanza *self);

    wocky_stanza_get_top_node ()

    WockyNode *         wocky_stanza_get_top_node           (WockyStanza *self);

    self :

    a stanza

    Returns :

    A pointer to the topmost node of the stanza

    wocky_stanza_get_type_info ()

    void                wocky_stanza_get_type_info          (WockyStanza *stanza,
                                                             WockyStanzaType *type,
                                                             WockyStanzaSubType *sub_type);

    wocky_stanza_new ()

    WockyStanza *       wocky_stanza_new                    (const gchar *name,
                                                             const gchar *ns);

    wocky_stanza_set_from_contact ()

    void                wocky_stanza_set_from_contact       (WockyStanza *self,
                                                             WockyContact *contact);

    wocky_stanza_set_to_contact ()

    void                wocky_stanza_set_to_contact         (WockyStanza *self,
                                                             WockyContact *contact);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-namespaces.html0000644000175000017500000004675412051456453030211 0ustar00wjtwjt00000000000000 wocky-namespaces

    wocky-namespaces

    wocky-namespaces

    Synopsis

    #define             WOCKY_GOOGLE_NS_AUTH
    #define             WOCKY_JABBER_NS_AUTH
    #define             WOCKY_JABBER_NS_AUTH_FEATURE
    #define             WOCKY_NS_CHATSTATE
    #define             WOCKY_NS_DISCO_INFO
    #define             WOCKY_NS_DISCO_ITEMS
    #define             WOCKY_NS_GOOGLE_SESSION_PHONE
    #define             WOCKY_NS_GOOGLE_SESSION_VIDEO
    #define             WOCKY_NS_MUC
    #define             WOCKY_NS_MUC_ADMIN
    #define             WOCKY_NS_MUC_OWNER
    #define             WOCKY_NS_MUC_UNIQUE
    #define             WOCKY_NS_MUC_USER
    #define             WOCKY_TELEPATHY_NS_CAPS
    #define             WOCKY_TELEPATHY_NS_CLIQUE
    #define             WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS
    #define             WOCKY_TELEPATHY_NS_TUBES
    #define             WOCKY_W3C_NS_XHTML
    #define             WOCKY_XEP77_NS_REGISTER
    #define             WOCKY_XMPP_NS_AMP
    #define             WOCKY_XMPP_NS_BIND
    #define             WOCKY_XMPP_NS_DATA
    #define             WOCKY_XMPP_NS_DELAY
    #define             WOCKY_XMPP_NS_EVENT
    #define             WOCKY_XMPP_NS_FEATURENEG
    #define             WOCKY_XMPP_NS_IBB
    #define             WOCKY_XMPP_NS_IQ_OOB
    #define             WOCKY_XMPP_NS_JABBER_CLIENT
    #define             WOCKY_XMPP_NS_JINGLE
    #define             WOCKY_XMPP_NS_JINGLE_ERRORS
    #define             WOCKY_XMPP_NS_JINGLE_RTP
    #define             WOCKY_XMPP_NS_JINGLE_RTP_AUDIO
    #define             WOCKY_XMPP_NS_JINGLE_RTP_ERRORS
    #define             WOCKY_XMPP_NS_JINGLE_RTP_INFO
    #define             WOCKY_XMPP_NS_JINGLE_RTP_VIDEO
    #define             WOCKY_XMPP_NS_PING
    #define             WOCKY_XMPP_NS_PUBSUB
    #define             WOCKY_XMPP_NS_PUBSUB_ERRORS
    #define             WOCKY_XMPP_NS_PUBSUB_EVENT
    #define             WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG
    #define             WOCKY_XMPP_NS_PUBSUB_OWNER
    #define             WOCKY_XMPP_NS_ROSTER
    #define             WOCKY_XMPP_NS_SASL_AUTH
    #define             WOCKY_XMPP_NS_SESSION
    #define             WOCKY_XMPP_NS_SI
    #define             WOCKY_XMPP_NS_STANZAS
    #define             WOCKY_XMPP_NS_STREAM
    #define             WOCKY_XMPP_NS_STREAMS
    #define             WOCKY_XMPP_NS_TLS
    #define             WOCKY_XMPP_NS_XHTML_IM
    #define             WOCKY_XMPP_NS_X_OOB
    

    Description

    Details

    WOCKY_GOOGLE_NS_AUTH

    #define             WOCKY_GOOGLE_NS_AUTH

    WOCKY_JABBER_NS_AUTH

    #define             WOCKY_JABBER_NS_AUTH

    WOCKY_JABBER_NS_AUTH_FEATURE

    #define             WOCKY_JABBER_NS_AUTH_FEATURE

    WOCKY_NS_CHATSTATE

    #define             WOCKY_NS_CHATSTATE

    WOCKY_NS_DISCO_INFO

    #define             WOCKY_NS_DISCO_INFO

    WOCKY_NS_DISCO_ITEMS

    #define             WOCKY_NS_DISCO_ITEMS

    WOCKY_NS_GOOGLE_SESSION_PHONE

    #define             WOCKY_NS_GOOGLE_SESSION_PHONE

    WOCKY_NS_GOOGLE_SESSION_VIDEO

    #define             WOCKY_NS_GOOGLE_SESSION_VIDEO

    WOCKY_NS_MUC

    #define             WOCKY_NS_MUC

    WOCKY_NS_MUC_ADMIN

    #define             WOCKY_NS_MUC_ADMIN

    WOCKY_NS_MUC_OWNER

    #define             WOCKY_NS_MUC_OWNER

    WOCKY_NS_MUC_UNIQUE

    #define             WOCKY_NS_MUC_UNIQUE

    WOCKY_NS_MUC_USER

    #define             WOCKY_NS_MUC_USER

    WOCKY_TELEPATHY_NS_CAPS

    #define             WOCKY_TELEPATHY_NS_CAPS

    WOCKY_TELEPATHY_NS_CLIQUE

    #define             WOCKY_TELEPATHY_NS_CLIQUE

    WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS

    #define             WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS

    WOCKY_TELEPATHY_NS_TUBES

    #define             WOCKY_TELEPATHY_NS_TUBES

    WOCKY_W3C_NS_XHTML

    #define             WOCKY_W3C_NS_XHTML

    WOCKY_XEP77_NS_REGISTER

    #define             WOCKY_XEP77_NS_REGISTER

    WOCKY_XMPP_NS_AMP

    #define             WOCKY_XMPP_NS_AMP

    WOCKY_XMPP_NS_BIND

    #define             WOCKY_XMPP_NS_BIND

    WOCKY_XMPP_NS_DATA

    #define             WOCKY_XMPP_NS_DATA

    WOCKY_XMPP_NS_DELAY

    #define             WOCKY_XMPP_NS_DELAY

    WOCKY_XMPP_NS_EVENT

    #define             WOCKY_XMPP_NS_EVENT

    WOCKY_XMPP_NS_FEATURENEG

    #define             WOCKY_XMPP_NS_FEATURENEG

    WOCKY_XMPP_NS_IBB

    #define             WOCKY_XMPP_NS_IBB

    WOCKY_XMPP_NS_IQ_OOB

    #define             WOCKY_XMPP_NS_IQ_OOB

    WOCKY_XMPP_NS_JABBER_CLIENT

    #define             WOCKY_XMPP_NS_JABBER_CLIENT

    WOCKY_XMPP_NS_JINGLE

    #define             WOCKY_XMPP_NS_JINGLE

    WOCKY_XMPP_NS_JINGLE_ERRORS

    #define             WOCKY_XMPP_NS_JINGLE_ERRORS

    WOCKY_XMPP_NS_JINGLE_RTP

    #define             WOCKY_XMPP_NS_JINGLE_RTP

    WOCKY_XMPP_NS_JINGLE_RTP_AUDIO

    #define             WOCKY_XMPP_NS_JINGLE_RTP_AUDIO

    WOCKY_XMPP_NS_JINGLE_RTP_ERRORS

    #define             WOCKY_XMPP_NS_JINGLE_RTP_ERRORS

    WOCKY_XMPP_NS_JINGLE_RTP_INFO

    #define             WOCKY_XMPP_NS_JINGLE_RTP_INFO

    WOCKY_XMPP_NS_JINGLE_RTP_VIDEO

    #define             WOCKY_XMPP_NS_JINGLE_RTP_VIDEO

    WOCKY_XMPP_NS_PING

    #define             WOCKY_XMPP_NS_PING

    WOCKY_XMPP_NS_PUBSUB

    #define             WOCKY_XMPP_NS_PUBSUB

    WOCKY_XMPP_NS_PUBSUB_ERRORS

    #define             WOCKY_XMPP_NS_PUBSUB_ERRORS

    WOCKY_XMPP_NS_PUBSUB_EVENT

    #define             WOCKY_XMPP_NS_PUBSUB_EVENT

    WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG

    #define             WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG

    WOCKY_XMPP_NS_PUBSUB_OWNER

    #define             WOCKY_XMPP_NS_PUBSUB_OWNER

    WOCKY_XMPP_NS_ROSTER

    #define             WOCKY_XMPP_NS_ROSTER

    WOCKY_XMPP_NS_SASL_AUTH

    #define             WOCKY_XMPP_NS_SASL_AUTH

    WOCKY_XMPP_NS_SESSION

    #define             WOCKY_XMPP_NS_SESSION

    WOCKY_XMPP_NS_SI

    #define             WOCKY_XMPP_NS_SI

    WOCKY_XMPP_NS_STANZAS

    #define             WOCKY_XMPP_NS_STANZAS

    WOCKY_XMPP_NS_STREAM

    #define             WOCKY_XMPP_NS_STREAM

    WOCKY_XMPP_NS_STREAMS

    #define             WOCKY_XMPP_NS_STREAMS

    WOCKY_XMPP_NS_TLS

    #define             WOCKY_XMPP_NS_TLS

    WOCKY_XMPP_NS_XHTML_IM

    #define             WOCKY_XMPP_NS_XHTML_IM

    WOCKY_XMPP_NS_X_OOB

    #define             WOCKY_XMPP_NS_X_OOB
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-helpers.html0000644000175000017500000011572212051456453031022 0ustar00wjtwjt00000000000000 wocky-pubsub-helpers

    wocky-pubsub-helpers

    wocky-pubsub-helpers

    Synopsis

    gboolean            wocky_pubsub_distill_ambivalent_iq_reply
                                                            (GObject *source,
                                                             GAsyncResult *res,
                                                             const gchar *pubsub_ns,
                                                             const gchar *child_name,
                                                             WockyNodeTree **child_out,
                                                             GError **error);
    gboolean            wocky_pubsub_distill_iq_reply       (GObject *source,
                                                             GAsyncResult *res,
                                                             const gchar *pubsub_ns,
                                                             const gchar *child_name,
                                                             WockyNodeTree **child_out,
                                                             GError **error);
    gboolean            wocky_pubsub_distill_stanza         (WockyStanza *result,
                                                             const gchar *pubsub_ns,
                                                             const gchar *child_name,
                                                             gboolean body_optional,
                                                             WockyNodeTree **child_out,
                                                             GError **error);
    gboolean            wocky_pubsub_distill_void_iq_reply  (GObject *source,
                                                             GAsyncResult *res,
                                                             GError **error);
    WockyStanza *       wocky_pubsub_make_event_stanza      (const gchar *node,
                                                             const gchar *from,
                                                             WockyNode **item_out);
    WockyStanza *       wocky_pubsub_make_publish_stanza    (const gchar *service,
                                                             const gchar *node,
                                                             WockyNode **pubsub_out,
                                                             WockyNode **publish_out,
                                                             WockyNode **item_out);
    WockyStanza *       wocky_pubsub_make_stanza            (const gchar *service,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *pubsub_ns,
                                                             const gchar *action_name,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **action_node);
    void                wocky_send_ll_pep_event             (WockySession *session,
                                                             WockyStanza *stanza);
    

    Description

    Details

    wocky_pubsub_distill_ambivalent_iq_reply ()

    gboolean            wocky_pubsub_distill_ambivalent_iq_reply
                                                            (GObject *source,
                                                             GAsyncResult *res,
                                                             const gchar *pubsub_ns,
                                                             const gchar *child_name,
                                                             WockyNodeTree **child_out,
                                                             GError **error);

    Helper function to finish a wocky_porter_send_iq_async() operation and extract a particular pubsub child from the resulting reply, if it is present. This is like wocky_pubsub_distill_iq_reply(), but is ambivalent as to whether the <pubsub/> structure has to be included.

    source :

    a WockyPorter instance

    res :

    a result passed to the callback for wocky_porter_send_iq_async()

    pubsub_ns :

    the namespace of the <pubsub/> node accepted in this reply (such as WOCKY_XMPP_NS_PUBSUB)

    child_name :

    the name of the child of <pubsub/> accepted in this reply (such as "subscriptions")

    child_out :

    location at which to store a reference to the node tree at child_name, if it is found, or to be set to NULL if it is not found

    error :

    location at which to store an error if the call to wocky_porter_send_iq_async() returned an error, or if the reply was an error

    Returns :

    TRUE if the IQ was a success; FALSE if sending the IQ failed or the reply had type='error', with error set appropriately.

    wocky_pubsub_distill_iq_reply ()

    gboolean            wocky_pubsub_distill_iq_reply       (GObject *source,
                                                             GAsyncResult *res,
                                                             const gchar *pubsub_ns,
                                                             const gchar *child_name,
                                                             WockyNodeTree **child_out,
                                                             GError **error);

    Helper function to finish a wocky_porter_send_iq_async() operation and extract a particular pubsub child from the resulting reply, if needed.

    source :

    a WockyPorter instance

    res :

    a result passed to the callback for wocky_porter_send_iq_async()

    pubsub_ns :

    the namespace of the <pubsub/> node expected in this reply (such as WOCKY_XMPP_NS_PUBSUB), or NULL if one is not expected

    child_name :

    the name of the child of <pubsub/> expected in this reply (such as "subscriptions"); ignored if pubsub_ns is NULL

    child_out :

    location at which to store a reference to the node tree at child_name, or NULL if you don't need it.

    error :

    location at which to store an error if the call to wocky_porter_send_iq_async() returned an error, or if the reply was an error

    Returns :

    TRUE if the desired pubsub child was found; FALSE if sending the IQ failed, the reply had type='error', or the pubsub child was not found, with error set appropriately.

    wocky_pubsub_distill_stanza ()

    gboolean            wocky_pubsub_distill_stanza         (WockyStanza *result,
                                                             const gchar *pubsub_ns,
                                                             const gchar *child_name,
                                                             gboolean body_optional,
                                                             WockyNodeTree **child_out,
                                                             GError **error);

    Helper function to extract a particular pubsub child node from a reply, if it is present. If body_optional is FALSE, the <pubsub><child_name/></pubsub> tree being absent is not considered an error: child_out is set to NULL and the function returns TRUE.

    If you are happy to delegate calling wocky_porter_send_iq_finish() and extracting stanza errors, you would probably be better served by one of wocky_pubsub_distill_iq_reply() or wocky_pubsub_distill_ambivalent_iq_reply().

    result :

    an iq type='result'

    pubsub_ns :

    the namespace of the <pubsub/> node expected in this reply (such as WOCKY_XMPP_NS_PUBSUB)

    child_name :

    the name of the child of <pubsub/> expected in this reply (such as "subscriptions")

    body_optional :

    If TRUE, the child being absent is not considered an error

    child_out :

    location at which to store a reference to the node tree at child_name, if it is found, or to be set to NULL if it is not.

    error :

    location at which to store an error if the child node is not found and body_optional is FALSE

    Returns :

    TRUE if the child was found or was optional; FALSE with error set otherwise.

    wocky_pubsub_distill_void_iq_reply ()

    gboolean            wocky_pubsub_distill_void_iq_reply  (GObject *source,
                                                             GAsyncResult *res,
                                                             GError **error);

    Helper function to finish a wocky_porter_send_iq_async() operation where no pubsub child is expected in the resulting reply.

    source :

    a WockyPorter instance

    res :

    a result passed to the callback for wocky_porter_send_iq_async()

    error :

    location at which to store an error if the call to wocky_porter_send_iq_async() returned an error, or if the reply was an error

    Returns :

    TRUE if the IQ was a success; FALSE if sending the IQ failed or the reply had type='error', with error set appropriately.

    wocky_pubsub_make_event_stanza ()

    WockyStanza *       wocky_pubsub_make_event_stanza      (const gchar *node,
                                                             const gchar *from,
                                                             WockyNode **item_out);

    Generates a new message stanza to send to other contacts about an updated PEP node.

    Note that this should only be used in link-local connections. Regular pubsub consists of making a publish stanza with wocky_pubsub_make_publish_stanza() and sending it to your own server. The server will then send the event stanza on to your contacts who have the appropriate capability.

    node :

    the the name of the pubsub node; may not be NULL

    from :

    a JID to use as the 'from' attribute, or NULL

    item_out :

    a location to store the item WockyNode, or NULL

    Returns :

    a new WockyStanza pubsub event stanza; free with g_object_unref()

    wocky_pubsub_make_publish_stanza ()

    WockyStanza *       wocky_pubsub_make_publish_stanza    (const gchar *service,
                                                             const gchar *node,
                                                             WockyNode **pubsub_out,
                                                             WockyNode **publish_out,
                                                             WockyNode **item_out);

    service :

    the JID of a PubSub service, or NULL

    node :

    the name of a node on service; may not be NULL

    pubsub_out :

    address at which to store a pointer to the <pubsub/> node

    publish_out :

    address at which to store a pointer to the <publish/> node

    item_out :

    address at which to store a pointer to the <item/> node

    Returns :

    a new iq[type='set']/pubsub/publish/item stanza

    wocky_pubsub_make_stanza ()

    WockyStanza *       wocky_pubsub_make_stanza            (const gchar *service,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *pubsub_ns,
                                                             const gchar *action_name,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **action_node);

    service :

    the JID of a PubSub service, or NULL

    pubsub_ns :

    the namespace for the <pubsub/> node of the stanza

    action_name :

    the action node to add to <pubsub/>

    pubsub_node :

    address at which to store a pointer to the <pubsub/> node

    action_node :

    address at wihch to store a pointer to the <action/> node

    Returns :

    a new iq[type='set']/pubsub/action stanza

    wocky_send_ll_pep_event ()

    void                wocky_send_ll_pep_event             (WockySession *session,
                                                             WockyStanza *stanza);

    Send a PEP event to all link-local contacts interested in receiving it.

    session :

    the WockySession to send on

    stanza :

    the PEP event stanza to send
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-auth-registry-enumtypes.html0000644000175000017500000000476212051456453032721 0ustar00wjtwjt00000000000000 wocky-auth-registry-enumtypes

    wocky-auth-registry-enumtypes

    wocky-auth-registry-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyTLSConnector.html0000644000175000017500000002117112051456453030254 0ustar00wjtwjt00000000000000 WockyTLSConnector

    WockyTLSConnector

    WockyTLSConnector

    Synopsis

    struct              WockyTLSConnectorClass;
    WockyTLSConnector * wocky_tls_connector_new             (WockyTLSHandler *handler);
    void                wocky_tls_connector_secure_async    (WockyTLSConnector *self,
                                                             WockyXmppConnection *connection,
                                                             gboolean old_style_ssl,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyXmppConnection * wocky_tls_connector_secure_finish (WockyTLSConnector *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    

    Description

    Details

    struct WockyTLSConnectorClass

    struct WockyTLSConnectorClass {
    };
    

    The class of a WockyTLSConnector.


    wocky_tls_connector_new ()

    WockyTLSConnector * wocky_tls_connector_new             (WockyTLSHandler *handler);

    wocky_tls_connector_secure_async ()

    void                wocky_tls_connector_secure_async    (WockyTLSConnector *self,
                                                             WockyXmppConnection *connection,
                                                             gboolean old_style_ssl,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_tls_connector_secure_finish ()

    WockyXmppConnection * wocky_tls_connector_secure_finish (WockyTLSConnector *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/api-index-full.html0000644000175000017500000051630512051456453026416 0ustar00wjtwjt00000000000000 API Index

    API Index

    A

    wocky_absolutize_path, function in wocky-utils
    WockyAuthAuthDataFunc, user_function in WockyAuthHandler
    WockyAuthError, enum in WockyAuthRegistry
    WockyAuthHandlerIface, struct in WockyAuthHandler
    WockyAuthInitialResponseFunc, user_function in WockyAuthHandler
    WockyAuthRegistry, struct in WockyAuthRegistry
    WockyAuthRegistryChallengeAsyncFunc, user_function in WockyAuthRegistry
    WockyAuthRegistryChallengeFinishFunc, user_function in WockyAuthRegistry
    WockyAuthRegistryClass, struct in WockyAuthRegistry
    WockyAuthRegistryFailureFunc, user_function in WockyAuthRegistry
    WockyAuthRegistryStartAuthAsyncFunc, user_function in WockyAuthRegistry
    WockyAuthRegistryStartAuthFinishFunc, user_function in WockyAuthRegistry
    WockyAuthRegistryStartData, struct in WockyAuthRegistry
    WockyAuthRegistrySuccessAsyncFunc, user_function in WockyAuthRegistry
    WockyAuthRegistrySuccessFinishFunc, user_function in WockyAuthRegistry
    WockyAuthSuccessFunc, user_function in WockyAuthHandler
    WOCKY_AUTH_ERROR, macro in WockyAuthRegistry
    wocky_auth_error_quark, function in WockyAuthRegistry
    wocky_auth_handler_get_initial_response, function in WockyAuthHandler
    wocky_auth_handler_get_mechanism, function in WockyAuthHandler
    wocky_auth_handler_handle_auth_data, function in WockyAuthHandler
    wocky_auth_handler_handle_success, function in WockyAuthHandler
    wocky_auth_handler_is_plain, function in WockyAuthHandler
    WOCKY_AUTH_MECH_JABBER_DIGEST, macro in WockyAuthRegistry
    WOCKY_AUTH_MECH_JABBER_PASSWORD, macro in WockyAuthRegistry
    WOCKY_AUTH_MECH_SASL_DIGEST_MD5, macro in WockyAuthRegistry
    WOCKY_AUTH_MECH_SASL_PLAIN, macro in WockyAuthRegistry
    WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1, macro in WockyAuthRegistry
    wocky_auth_registry_add_handler, function in WockyAuthRegistry
    wocky_auth_registry_challenge_async, function in WockyAuthRegistry
    wocky_auth_registry_challenge_finish, function in WockyAuthRegistry
    wocky_auth_registry_failure, function in WockyAuthRegistry
    wocky_auth_registry_new, function in WockyAuthRegistry
    wocky_auth_registry_start_auth_async, function in WockyAuthRegistry
    wocky_auth_registry_start_auth_finish, function in WockyAuthRegistry
    wocky_auth_registry_start_data_dup, function in WockyAuthRegistry
    wocky_auth_registry_start_data_free, function in WockyAuthRegistry
    wocky_auth_registry_start_data_new, function in WockyAuthRegistry
    wocky_auth_registry_success_async, function in WockyAuthRegistry
    wocky_auth_registry_success_finish, function in WockyAuthRegistry
    wocky_auth_registry_supports_one_of, function in WockyAuthRegistry

    B

    WockyBareContact, struct in wocky-types
    WockyBareContact:groups, object property in wocky-types
    WockyBareContact:jid, object property in wocky-types
    WockyBareContact:name, object property in wocky-types
    WockyBareContact:subscription, object property in wocky-types
    WockyBareContactClass, struct in WockyBareContact
    wocky_bare_contact_add_group, function in WockyBareContact
    wocky_bare_contact_add_resource, function in WockyBareContact
    wocky_bare_contact_copy, function in WockyBareContact
    wocky_bare_contact_debug_print, function in WockyBareContact
    wocky_bare_contact_equal, function in WockyBareContact
    wocky_bare_contact_get_groups, function in WockyBareContact
    wocky_bare_contact_get_jid, function in WockyBareContact
    wocky_bare_contact_get_name, function in WockyBareContact
    wocky_bare_contact_get_resources, function in WockyBareContact
    wocky_bare_contact_get_subscription, function in WockyBareContact
    wocky_bare_contact_in_group, function in WockyBareContact
    wocky_bare_contact_new, function in WockyBareContact
    wocky_bare_contact_remove_group, function in WockyBareContact
    wocky_bare_contact_set_groups, function in WockyBareContact
    wocky_bare_contact_set_name, function in WockyBareContact
    wocky_bare_contact_set_subscription, function in WockyBareContact

    C

    WockyC2SPorterClass, struct in WockyC2SPorter
    wocky_c2s_porter_enable_power_saving_mode, function in WockyC2SPorter
    wocky_c2s_porter_new, function in WockyC2SPorter
    wocky_c2s_porter_register_handler_from_server, function in WockyC2SPorter
    wocky_c2s_porter_register_handler_from_server_by_stanza, function in WockyC2SPorter
    wocky_c2s_porter_register_handler_from_server_va, function in WockyC2SPorter
    wocky_c2s_porter_send_whitespace_ping_async, function in WockyC2SPorter
    wocky_c2s_porter_send_whitespace_ping_finish, function in WockyC2SPorter
    WockyCapsCache, struct in WockyCapsCache
    WockyCapsCache:path, object property in WockyCapsCache
    WockyCapsCacheClass, struct in WockyCapsCache
    wocky_caps_cache_dup_shared, function in WockyCapsCache
    wocky_caps_cache_free_shared, function in WockyCapsCache
    wocky_caps_cache_insert, function in WockyCapsCache
    wocky_caps_cache_lookup, function in WockyCapsCache
    wocky_caps_cache_new, function in WockyCapsCache
    wocky_caps_hash_compute_from_lists, function in WockyCapsHash
    wocky_caps_hash_compute_from_node, function in WockyCapsHash
    wocky_compose_jid, function in wocky-utils
    WockyConnectorClass, struct in WockyConnector
    WockyConnectorError, enum in WockyConnector
    wocky_connector_connect_async, function in WockyConnector
    wocky_connector_connect_finish, function in WockyConnector
    WOCKY_CONNECTOR_ERROR, macro in WockyConnector
    wocky_connector_error_quark, function in WockyConnector
    wocky_connector_new, function in WockyConnector
    wocky_connector_register_async, function in WockyConnector
    wocky_connector_register_finish, function in WockyConnector
    wocky_connector_set_auth_registry, function in WockyConnector
    wocky_connector_unregister_async, function in WockyConnector
    wocky_connector_unregister_finish, function in WockyConnector
    WockyContactClass, struct in WockyContact
    WockyContactDupJidImpl, user_function in WockyContact
    WockyContactFactoryClass, struct in WockyContactFactory
    wocky_contact_dup_jid, function in WockyContact
    wocky_contact_factory_add_ll_contact, function in WockyContactFactory
    wocky_contact_factory_ensure_bare_contact, function in WockyContactFactory
    wocky_contact_factory_ensure_ll_contact, function in WockyContactFactory
    wocky_contact_factory_ensure_resource_contact, function in WockyContactFactory
    wocky_contact_factory_get_ll_contacts, function in WockyContactFactory
    wocky_contact_factory_lookup_bare_contact, function in WockyContactFactory
    wocky_contact_factory_lookup_ll_contact, function in WockyContactFactory
    wocky_contact_factory_lookup_resource_contact, function in WockyContactFactory
    wocky_contact_factory_new, function in WockyContactFactory

    D

    WockyDataFormClass, struct in WockyDataForm
    WockyDataFormError, enum in WockyDataForm
    WockyDataFormField, struct in WockyDataForm
    WockyDataFormFieldOption, struct in WockyDataForm
    WockyDataFormFieldType, enum in WockyDataForm
    wocky_data_form_add_to_node, function in WockyDataForm
    WOCKY_DATA_FORM_ERROR, macro in WockyDataForm
    wocky_data_form_error_quark, function in WockyDataForm
    wocky_data_form_field_cmp, function in WockyDataForm
    wocky_data_form_get_instructions, function in WockyDataForm
    wocky_data_form_get_title, function in WockyDataForm
    wocky_data_form_new_from_form, function in WockyDataForm
    wocky_data_form_new_from_node, function in WockyDataForm
    wocky_data_form_parse_result, function in WockyDataForm
    wocky_data_form_set_boolean, function in WockyDataForm
    wocky_data_form_set_string, function in WockyDataForm
    wocky_data_form_set_strv, function in WockyDataForm
    wocky_data_form_set_type, function in WockyDataForm
    wocky_data_form_submit, function in WockyDataForm
    DEBUG, macro in wocky-debug-internal
    wocky_debug, function in wocky-debug-internal
    WockyDebugFlags, enum in wocky-debug
    DEBUGGING, macro in wocky-debug-internal
    wocky_debug_flag_is_set, function in wocky-debug-internal
    DEBUG_NODE_TREE, macro in wocky-debug-internal
    wocky_debug_node_tree, function in wocky-debug-internal
    wocky_debug_set_flags, function in wocky-debug
    wocky_debug_set_flags_from_env, function in wocky-debug-internal
    wocky_debug_stanza, function in wocky-debug-internal
    DEBUG_STANZA, macro in wocky-debug-internal
    wocky_debug_valist, function in wocky-debug-internal
    WOCKY_DEBUG_XMPP, macro in wocky-debug
    wocky_decode_jid, function in wocky-utils
    wocky_deinit, function in wocky
    WockyDiscoIdentity, struct in WockyDiscoIdentity
    wocky_disco_identity_array_copy, function in WockyDiscoIdentity
    wocky_disco_identity_array_free, function in WockyDiscoIdentity
    wocky_disco_identity_array_new, function in WockyDiscoIdentity
    wocky_disco_identity_cmp, function in WockyDiscoIdentity
    wocky_disco_identity_copy, function in WockyDiscoIdentity
    wocky_disco_identity_free, function in WockyDiscoIdentity
    wocky_disco_identity_new, function in WockyDiscoIdentity

    E

    wocky_enum_from_nick, function in wocky-utils
    wocky_enum_to_nick, function in wocky-utils

    G

    WOCKY_GOOGLE_NS_AUTH, macro in wocky-namespaces
    wocky_g_string_dup, function in wocky-utils
    wocky_g_string_free, function in wocky-utils
    wocky_g_value_slice_dup, function in wocky-utils
    wocky_g_value_slice_free, function in wocky-utils
    wocky_g_value_slice_new, function in wocky-utils
    wocky_g_value_slice_new_boolean, function in wocky-utils
    wocky_g_value_slice_new_boxed, function in wocky-utils
    wocky_g_value_slice_new_double, function in wocky-utils
    wocky_g_value_slice_new_int, function in wocky-utils
    wocky_g_value_slice_new_int64, function in wocky-utils
    wocky_g_value_slice_new_static_boxed, function in wocky-utils
    wocky_g_value_slice_new_static_string, function in wocky-utils
    wocky_g_value_slice_new_string, function in wocky-utils
    wocky_g_value_slice_new_take_boxed, function in wocky-utils
    wocky_g_value_slice_new_take_string, function in wocky-utils
    wocky_g_value_slice_new_uint, function in wocky-utils
    wocky_g_value_slice_new_uint64, function in wocky-utils

    H

    WockyHeartbeatCallback, user_function in wocky-heartbeat-source
    wocky_heartbeat_source_new, function in wocky-heartbeat-source
    wocky_heartbeat_source_update_interval, function in wocky-heartbeat-source
    WockyHttpProxy, struct in wocky-http-proxy
    WockyHttpProxyClass, struct in wocky-http-proxy
    WOCKY_H_INSIDE, macro in wocky

    I

    wocky_implement_finish_copy_pointer, macro in wocky-utils
    wocky_implement_finish_return_copy_pointer, macro in wocky-utils
    wocky_implement_finish_return_pointer, macro in wocky-utils
    wocky_implement_finish_void, macro in wocky-utils
    wocky_init, function in wocky

    J

    WockyJabberAuthClass, struct in WockyJabberAuth
    wocky_jabber_auth_add_handler, function in WockyJabberAuth
    wocky_jabber_auth_authenticate_async, function in WockyJabberAuth
    wocky_jabber_auth_authenticate_finish, function in WockyJabberAuth
    wocky_jabber_auth_digest_new, function in wocky-jabber-auth-digest
    wocky_jabber_auth_new, function in WockyJabberAuth
    wocky_jabber_auth_password_new, function in wocky-jabber-auth-password
    WOCKY_JABBER_NS_AUTH, macro in wocky-namespaces
    WOCKY_JABBER_NS_AUTH_FEATURE, macro in wocky-namespaces
    WockyJingleError, enum in wocky-xmpp-error
    WOCKY_JINGLE_ERROR, macro in wocky-xmpp-error
    wocky_jingle_error_quark, function in wocky-xmpp-error

    L

    wocky_list_deep_copy, function in wocky-utils
    WockyLLConnectionFactoryClass, struct in WockyLLConnectionFactory
    WockyLLConnectionFactoryError, enum in WockyLLConnectionFactory
    WockyLLConnectorClass, struct in WockyLLConnector
    WockyLLConnectorError, enum in WockyLLConnector
    WockyLLContact, struct in wocky-types
    WockyLLContact:jid, object property in wocky-types
    WockyLLContactClass, struct in WockyLLContact
    WockyLLContactGetAddressesImpl, user_function in WockyLLContact
    WOCKY_LL_CONNECTION_FACTORY_ERROR, macro in WockyLLConnectionFactory
    wocky_ll_connection_factory_error_quark, function in WockyLLConnectionFactory
    wocky_ll_connection_factory_make_connection_async, function in WockyLLConnectionFactory
    wocky_ll_connection_factory_make_connection_finish, function in WockyLLConnectionFactory
    wocky_ll_connection_factory_new, function in WockyLLConnectionFactory
    WOCKY_LL_CONNECTOR_ERROR, macro in WockyLLConnector
    wocky_ll_connector_error_quark, function in WockyLLConnector
    wocky_ll_connector_finish, function in WockyLLConnector
    wocky_ll_connector_incoming_async, function in WockyLLConnector
    wocky_ll_connector_outgoing_async, function in WockyLLConnector
    wocky_ll_contact_equal, function in WockyLLContact
    wocky_ll_contact_get_addresses, function in WockyLLContact
    wocky_ll_contact_get_jid, function in WockyLLContact
    wocky_ll_contact_has_address, function in WockyLLContact
    wocky_ll_contact_new, function in WockyLLContact
    WockyLoopbackStreamClass, struct in WockyLoopbackStream
    wocky_loopback_stream_new, function in WockyLoopbackStream

    M

    WockyMetaPorterClass, struct in WockyMetaPorter
    WockyMetaPorterError, enum in WockyMetaPorter
    wocky_meta_porter_borrow_connection, function in WockyMetaPorter
    WOCKY_META_PORTER_ERROR, macro in WockyMetaPorter
    wocky_meta_porter_error_quark, function in WockyMetaPorter
    wocky_meta_porter_get_port, function in WockyMetaPorter
    wocky_meta_porter_hold, function in WockyMetaPorter
    wocky_meta_porter_new, function in WockyMetaPorter
    wocky_meta_porter_open_async, function in WockyMetaPorter
    wocky_meta_porter_open_finish, function in WockyMetaPorter
    wocky_meta_porter_set_jid, function in WockyMetaPorter
    wocky_meta_porter_unhold, function in WockyMetaPorter
    WockyMucAffiliation, enum in WockyMuc
    WockyMucClass, struct in WockyMuc
    WockyMucFeature, enum in WockyMuc
    WockyMucMember, struct in WockyMuc
    WockyMucMsgState, enum in WockyMuc
    WockyMucMsgType, enum in WockyMuc
    WockyMucRole, enum in WockyMuc
    WockyMucState, enum in WockyMuc
    WockyMucStatusCode, enum in WockyMuc
    wocky_muc_affiliation, function in WockyMuc
    wocky_muc_create_presence, function in WockyMuc
    wocky_muc_disco_info_async, function in WockyMuc
    wocky_muc_disco_info_finish, function in WockyMuc
    wocky_muc_get_state, function in WockyMuc
    wocky_muc_initiate_async, function in WockyMuc
    wocky_muc_initiate_finish, function in WockyMuc
    wocky_muc_jid, function in WockyMuc
    wocky_muc_join, function in WockyMuc
    wocky_muc_members, function in WockyMuc
    wocky_muc_role, function in WockyMuc
    wocky_muc_user, function in WockyMuc

    N

    WockyNode, struct in WockyNode
    WockyNodeBuildTag, enum in WockyNode
    WockyNodeIter, struct in WockyNode
    WockyNodeTree, struct in wocky-types
    WockyNodeTree:top-node, object property in wocky-types
    WockyNodeTreeClass, struct in WockyNodeTree
    wocky_node_add_build, function in WockyNode
    wocky_node_add_build_va, function in WockyNode
    wocky_node_add_child, function in WockyNode
    wocky_node_add_child_ns, function in WockyNode
    wocky_node_add_child_ns_q, function in WockyNode
    wocky_node_add_child_with_content, function in WockyNode
    wocky_node_add_child_with_content_ns, function in WockyNode
    wocky_node_add_child_with_content_ns_q, function in WockyNode
    wocky_node_add_node_tree, function in WockyNode
    wocky_node_append_content, function in WockyNode
    wocky_node_append_content_n, function in WockyNode
    wocky_node_attribute_ns_get_prefix_from_quark, function in WockyNode
    wocky_node_attribute_ns_get_prefix_from_urn, function in WockyNode
    wocky_node_attribute_ns_set_prefix, function in WockyNode
    wocky_node_deinit, function in WockyNode
    wocky_node_each_attribute, function in WockyNode
    wocky_node_each_attr_func, user_function in WockyNode
    wocky_node_each_child, function in WockyNode
    wocky_node_each_child_func, user_function in WockyNode
    wocky_node_equal, function in WockyNode
    wocky_node_free, function in WockyNode
    wocky_node_get_attribute, function in WockyNode
    wocky_node_get_attribute_ns, function in WockyNode
    wocky_node_get_child, function in WockyNode
    wocky_node_get_child_ns, function in WockyNode
    wocky_node_get_content_from_child, function in WockyNode
    wocky_node_get_content_from_child_ns, function in WockyNode
    wocky_node_get_first_child, function in WockyNode
    wocky_node_get_first_child_ns, function in WockyNode
    wocky_node_get_language, function in WockyNode
    wocky_node_get_ns, function in WockyNode
    wocky_node_has_ns, function in WockyNode
    wocky_node_has_ns_q, function in WockyNode
    wocky_node_init, function in WockyNode
    wocky_node_is_superset, function in WockyNode
    wocky_node_iter_init, function in WockyNode
    wocky_node_iter_next, function in WockyNode
    wocky_node_matches, function in WockyNode
    wocky_node_matches_q, function in WockyNode
    wocky_node_new, function in WockyNode
    wocky_node_prepend_node_tree, function in WockyNode
    wocky_node_set_attribute, function in WockyNode
    wocky_node_set_attributes, function in WockyNode
    wocky_node_set_attribute_n, function in WockyNode
    wocky_node_set_attribute_ns, function in WockyNode
    wocky_node_set_attribute_n_ns, function in WockyNode
    wocky_node_set_content, function in WockyNode
    wocky_node_set_language, function in WockyNode
    wocky_node_set_language_n, function in WockyNode
    wocky_node_to_string, function in WockyNode
    wocky_node_tree_get_top_node, function in WockyNodeTree
    wocky_node_tree_new, function in WockyNodeTree
    wocky_node_tree_new_from_node, function in WockyNodeTree
    wocky_node_tree_new_va, function in WockyNodeTree
    wocky_normalise_jid, function in wocky-utils
    WOCKY_NS_CHATSTATE, macro in wocky-namespaces
    WOCKY_NS_DISCO_INFO, macro in wocky-namespaces
    WOCKY_NS_DISCO_ITEMS, macro in wocky-namespaces
    WOCKY_NS_GOOGLE_SESSION_PHONE, macro in wocky-namespaces
    WOCKY_NS_GOOGLE_SESSION_VIDEO, macro in wocky-namespaces
    WOCKY_NS_MUC, macro in wocky-namespaces
    WOCKY_NS_MUC_ADMIN, macro in wocky-namespaces
    WOCKY_NS_MUC_OWNER, macro in wocky-namespaces
    WOCKY_NS_MUC_UNIQUE, macro in wocky-namespaces
    WOCKY_NS_MUC_USER, macro in wocky-namespaces

    P

    WockyPepServiceClass, struct in WockyPepService
    wocky_pep_service_get_async, function in WockyPepService
    wocky_pep_service_get_finish, function in WockyPepService
    wocky_pep_service_make_publish_stanza, function in WockyPepService
    wocky_pep_service_new, function in WockyPepService
    wocky_pep_service_start, function in WockyPepService
    WockyPingClass, struct in WockyPing
    wocky_ping_error_quark, function in WockyPing
    wocky_ping_new, function in WockyPing
    WockyPorterError, enum in WockyPorter
    WockyPorterHandlerFunc, user_function in WockyPorter
    WockyPorterInterface, struct in WockyPorter
    wocky_porter_acknowledge_iq, function in WockyPorter
    wocky_porter_close_async, function in WockyPorter
    wocky_porter_close_finish, function in WockyPorter
    WOCKY_PORTER_ERROR, macro in WockyPorter
    wocky_porter_error_quark, function in WockyPorter
    wocky_porter_force_close_async, function in WockyPorter
    wocky_porter_force_close_finish, function in WockyPorter
    wocky_porter_get_bare_jid, function in WockyPorter
    wocky_porter_get_full_jid, function in WockyPorter
    wocky_porter_get_resource, function in WockyPorter
    WOCKY_PORTER_HANDLER_PRIORITY_MAX, macro in WockyPorter
    WOCKY_PORTER_HANDLER_PRIORITY_MIN, macro in WockyPorter
    WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, macro in WockyPorter
    wocky_porter_register_handler_from, function in WockyPorter
    wocky_porter_register_handler_from_anyone, function in WockyPorter
    wocky_porter_register_handler_from_anyone_by_stanza, function in WockyPorter
    wocky_porter_register_handler_from_anyone_va, function in WockyPorter
    wocky_porter_register_handler_from_by_stanza, function in WockyPorter
    wocky_porter_register_handler_from_va, function in WockyPorter
    wocky_porter_send, function in WockyPorter
    wocky_porter_send_async, function in WockyPorter
    wocky_porter_send_finish, function in WockyPorter
    wocky_porter_send_iq_async, function in WockyPorter
    wocky_porter_send_iq_error, function in WockyPorter
    wocky_porter_send_iq_finish, function in WockyPorter
    wocky_porter_send_iq_gerror, function in WockyPorter
    wocky_porter_start, function in WockyPorter
    wocky_porter_unregister_handler, function in WockyPorter
    WockyPubsubAffiliation, struct in WockyPubsubNode
    WockyPubsubAffiliationState, enum in WockyPubsubNode
    WockyPubsubNode, struct in wocky-types
    WockyPubsubNode::deleted, object signal in wocky-types
    WockyPubsubNode::event-received, object signal in wocky-types
    WockyPubsubNode::subscription-state-changed, object signal in wocky-types
    WockyPubsubNode:name, object property in wocky-types
    WockyPubsubNode:service, object property in wocky-types
    WockyPubsubNodeClass, struct in WockyPubsubNode
    WockyPubsubNodeEventHandler, user_function in wocky-pubsub-node-internal
    WockyPubsubNodeEventMapping, struct in wocky-pubsub-node-internal
    WockyPubsubServiceClass, struct in WockyPubsubService
    WockyPubsubServiceError, enum in WockyPubsubService
    WockyPubsubSubscription, struct in WockyPubsubService
    WockyPubsubSubscriptionState, enum in WockyPubsubService
    wocky_pubsub_affiliation_copy, function in WockyPubsubNode
    wocky_pubsub_affiliation_free, function in WockyPubsubNode
    wocky_pubsub_affiliation_list_copy, function in WockyPubsubNode
    wocky_pubsub_affiliation_list_free, function in WockyPubsubNode
    wocky_pubsub_affiliation_new, function in WockyPubsubNode
    wocky_pubsub_distill_ambivalent_iq_reply, function in wocky-pubsub-helpers
    wocky_pubsub_distill_iq_reply, function in wocky-pubsub-helpers
    wocky_pubsub_distill_stanza, function in wocky-pubsub-helpers
    wocky_pubsub_distill_void_iq_reply, function in wocky-pubsub-helpers
    wocky_pubsub_make_event_stanza, function in wocky-pubsub-helpers
    wocky_pubsub_make_publish_stanza, function in wocky-pubsub-helpers
    wocky_pubsub_make_stanza, function in wocky-pubsub-helpers
    wocky_pubsub_node_delete_async, function in WockyPubsubNode
    wocky_pubsub_node_delete_finish, function in WockyPubsubNode
    wocky_pubsub_node_get_configuration_async, function in WockyPubsubNode
    wocky_pubsub_node_get_configuration_finish, function in WockyPubsubNode
    wocky_pubsub_node_get_name, function in WockyPubsubNode
    wocky_pubsub_node_get_porter, function in wocky-pubsub-node-protected
    wocky_pubsub_node_list_affiliates_async, function in WockyPubsubNode
    wocky_pubsub_node_list_affiliates_finish, function in WockyPubsubNode
    wocky_pubsub_node_list_subscribers_async, function in WockyPubsubNode
    wocky_pubsub_node_list_subscribers_finish, function in WockyPubsubNode
    wocky_pubsub_node_make_delete_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_make_get_configuration_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_make_list_affiliates_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_make_list_subscribers_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_make_modify_affiliates_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_make_publish_stanza, function in WockyPubsubNode
    wocky_pubsub_node_make_subscribe_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_make_unsubscribe_stanza, function in wocky-pubsub-node-protected
    wocky_pubsub_node_modify_affiliates_async, function in WockyPubsubNode
    wocky_pubsub_node_modify_affiliates_finish, function in WockyPubsubNode
    wocky_pubsub_node_parse_affiliations, function in wocky-pubsub-node-protected
    wocky_pubsub_node_subscribe_async, function in WockyPubsubNode
    wocky_pubsub_node_subscribe_finish, function in WockyPubsubNode
    wocky_pubsub_node_unsubscribe_async, function in WockyPubsubNode
    wocky_pubsub_node_unsubscribe_finish, function in WockyPubsubNode
    wocky_pubsub_service_create_create_node_stanza, function in wocky-pubsub-service-protected
    wocky_pubsub_service_create_node_async, function in WockyPubsubService
    wocky_pubsub_service_create_node_finish, function in WockyPubsubService
    wocky_pubsub_service_create_retrieve_subscriptions_stanza, function in wocky-pubsub-service-protected
    wocky_pubsub_service_ensure_node, function in WockyPubsubService
    WOCKY_PUBSUB_SERVICE_ERROR, macro in WockyPubsubService
    wocky_pubsub_service_error_quark, function in WockyPubsubService
    wocky_pubsub_service_get_default_node_configuration_async, function in WockyPubsubService
    wocky_pubsub_service_get_default_node_configuration_finish, function in WockyPubsubService
    wocky_pubsub_service_get_porter, function in wocky-pubsub-service-protected
    wocky_pubsub_service_handle_create_node_reply, function in wocky-pubsub-service-protected
    wocky_pubsub_service_lookup_node, function in WockyPubsubService
    wocky_pubsub_service_new, function in WockyPubsubService
    wocky_pubsub_service_parse_subscription, function in wocky-pubsub-service-protected
    wocky_pubsub_service_parse_subscriptions, function in wocky-pubsub-service-protected
    wocky_pubsub_service_retrieve_subscriptions_async, function in WockyPubsubService
    wocky_pubsub_service_retrieve_subscriptions_finish, function in WockyPubsubService
    wocky_pubsub_subscription_copy, function in WockyPubsubService
    wocky_pubsub_subscription_free, function in WockyPubsubService
    wocky_pubsub_subscription_list_copy, function in WockyPubsubService
    wocky_pubsub_subscription_list_free, function in WockyPubsubService
    wocky_pubsub_subscription_new, function in WockyPubsubService

    R

    WockyResourceContact, struct in wocky-types
    WockyResourceContact:bare-contact, object property in wocky-types
    WockyResourceContact:resource, object property in wocky-types
    WockyResourceContactClass, struct in WockyResourceContact
    wocky_resource_contact_equal, function in WockyResourceContact
    wocky_resource_contact_get_bare_contact, function in WockyResourceContact
    wocky_resource_contact_get_resource, function in WockyResourceContact
    wocky_resource_contact_new, function in WockyResourceContact
    WockyRosterClass, struct in WockyRoster
    WockyRosterError, enum in WockyRoster
    WockyRosterSubscriptionFlags, enum in WockyRoster
    wocky_roster_add_contact_async, function in WockyRoster
    wocky_roster_add_contact_finish, function in WockyRoster
    wocky_roster_change_contact_name_async, function in WockyRoster
    wocky_roster_change_contact_name_finish, function in WockyRoster
    wocky_roster_contact_add_group_async, function in WockyRoster
    wocky_roster_contact_add_group_finish, function in WockyRoster
    wocky_roster_contact_remove_group_async, function in WockyRoster
    wocky_roster_contact_remove_group_finish, function in WockyRoster
    WOCKY_ROSTER_ERROR, macro in WockyRoster
    wocky_roster_error_quark, function in WockyRoster
    wocky_roster_fetch_roster_async, function in WockyRoster
    wocky_roster_fetch_roster_finish, function in WockyRoster
    wocky_roster_get_all_contacts, function in WockyRoster
    wocky_roster_get_contact, function in WockyRoster
    wocky_roster_new, function in WockyRoster
    wocky_roster_remove_contact_async, function in WockyRoster
    wocky_roster_remove_contact_finish, function in WockyRoster
    wocky_roster_subscription_to_string, function in WockyRoster

    S

    WockySaslAuthClass, struct in WockySaslAuth
    wocky_sasl_auth_add_handler, function in WockySaslAuth
    wocky_sasl_auth_authenticate_async, function in WockySaslAuth
    wocky_sasl_auth_authenticate_finish, function in WockySaslAuth
    wocky_sasl_auth_new, function in WockySaslAuth
    sasl_calculate_hmac_sha1, function in wocky-sasl-utils
    wocky_sasl_digest_md5_new, function in wocky-sasl-digest-md5
    sasl_generate_base64_nonce, function in wocky-sasl-utils
    wocky_sasl_plain_new, function in wocky-sasl-plain
    wocky_sasl_scram_new, function in wocky-sasl-scram
    wocky_send_ll_pep_event, function in wocky-pubsub-helpers
    WockySession, struct in wocky-types
    WockySession:connection, object property in wocky-types
    WockySession:contact-factory, object property in wocky-types
    WockySession:full-jid, object property in wocky-types
    WockySession:porter, object property in wocky-types
    WockySessionClass, struct in WockySession
    wocky_session_get_contact_factory, function in WockySession
    wocky_session_get_jid, function in WockySession
    wocky_session_get_porter, function in WockySession
    wocky_session_new_ll, function in WockySession
    wocky_session_new_with_connection, function in WockySession
    wocky_session_set_jid, function in WockySession
    wocky_session_start, function in WockySession
    WOCKY_SHA1_BLOCK_SIZE, macro in wocky-sasl-utils
    WOCKY_SHA1_DIGEST_SIZE, macro in wocky-sasl-utils
    WockySIError, enum in wocky-xmpp-error
    WOCKY_SI_ERROR, macro in wocky-xmpp-error
    wocky_si_error_quark, function in wocky-xmpp-error
    WockyStanzaClass, struct in WockyStanza
    WockyStanzaSubType, enum in WockyStanza
    WockyStanzaType, enum in WockyStanza
    wocky_stanza_build, function in WockyStanza
    wocky_stanza_build_iq_error, function in WockyStanza
    wocky_stanza_build_iq_error_va, function in WockyStanza
    wocky_stanza_build_iq_result, function in WockyStanza
    wocky_stanza_build_iq_result_va, function in WockyStanza
    wocky_stanza_build_to_contact, function in WockyStanza
    wocky_stanza_build_va, function in WockyStanza
    wocky_stanza_copy, function in WockyStanza
    wocky_stanza_error_to_node, function in wocky-xmpp-error
    wocky_stanza_extract_errors, function in WockyStanza
    wocky_stanza_extract_stream_error, function in WockyStanza
    wocky_stanza_get_from, function in WockyStanza
    wocky_stanza_get_from_contact, function in WockyStanza
    wocky_stanza_get_to, function in WockyStanza
    wocky_stanza_get_top_node, function in WockyStanza
    wocky_stanza_get_to_contact, function in WockyStanza
    wocky_stanza_get_type_info, function in WockyStanza
    wocky_stanza_new, function in WockyStanza
    wocky_stanza_set_from_contact, function in WockyStanza
    wocky_stanza_set_to_contact, function in WockyStanza
    wocky_strdiff, function in wocky-utils

    T

    WOCKY_TELEPATHY_NS_CAPS, macro in wocky-namespaces
    WOCKY_TELEPATHY_NS_CLIQUE, macro in wocky-namespaces
    WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS, macro in wocky-namespaces
    WOCKY_TELEPATHY_NS_TUBES, macro in wocky-namespaces
    WockyTLSCertStatus, enum in Wocky OpenSSL TLS
    WockyTLSCertType, enum in Wocky OpenSSL TLS
    WockyTLSConnection, struct in Wocky OpenSSL TLS
    WockyTLSConnection:session, object property in Wocky OpenSSL TLS
    WockyTLSConnectorClass, struct in WockyTLSConnector
    WockyTLSHandlerClass, struct in WockyTLSHandler
    WockyTLSHandlerVerifyAsyncFunc, user_function in WockyTLSHandler
    WockyTLSHandlerVerifyFinishFunc, user_function in WockyTLSHandler
    WockyTLSSession, struct in Wocky OpenSSL TLS
    WockyTLSSession:base-stream, object property in Wocky OpenSSL TLS
    WockyTLSSession:dh-bits, object property in Wocky OpenSSL TLS
    WockyTLSSession:server, object property in Wocky OpenSSL TLS
    WockyTLSSession:x509-cert, object property in Wocky OpenSSL TLS
    WockyTLSSession:x509-key, object property in Wocky OpenSSL TLS
    WockyTLSVerificationLevel, enum in Wocky OpenSSL TLS
    WOCKY_TLS_CERT_ERROR, macro in Wocky OpenSSL TLS
    wocky_tls_cert_error_quark, function in Wocky OpenSSL TLS
    wocky_tls_connector_new, function in WockyTLSConnector
    wocky_tls_connector_secure_async, function in WockyTLSConnector
    wocky_tls_connector_secure_finish, function in WockyTLSConnector
    WOCKY_TLS_ERROR, macro in Wocky OpenSSL TLS
    wocky_tls_error_quark, function in Wocky OpenSSL TLS
    wocky_tls_handler_add_ca, function in WockyTLSHandler
    wocky_tls_handler_add_crl, function in WockyTLSHandler
    wocky_tls_handler_get_cas, function in WockyTLSHandler
    wocky_tls_handler_get_crls, function in WockyTLSHandler
    wocky_tls_handler_new, function in WockyTLSHandler
    wocky_tls_handler_verify_async, function in WockyTLSHandler
    wocky_tls_handler_verify_finish, function in WockyTLSHandler
    wocky_tls_session_add_ca, function in Wocky OpenSSL TLS
    wocky_tls_session_add_crl, function in Wocky OpenSSL TLS
    wocky_tls_session_get_peers_certificate, function in Wocky OpenSSL TLS
    wocky_tls_session_handshake, function in Wocky OpenSSL TLS
    wocky_tls_session_handshake_async, function in Wocky OpenSSL TLS
    wocky_tls_session_handshake_finish, function in Wocky OpenSSL TLS
    wocky_tls_session_new, function in Wocky OpenSSL TLS
    wocky_tls_session_server_new, function in Wocky OpenSSL TLS
    wocky_tls_session_verify_peer, function in Wocky OpenSSL TLS

    W

    WOCKY_W3C_NS_XHTML, macro in wocky-namespaces

    X

    WockyXep0115CapabilitiesGetDataFormsFunc, user_function in WockyXep0115Capabilities
    WockyXep0115CapabilitiesHasFeatureFunc, user_function in WockyXep0115Capabilities
    WockyXep0115CapabilitiesInterface, struct in WockyXep0115Capabilities
    WOCKY_XEP77_NS_REGISTER, macro in wocky-namespaces
    wocky_xep_0115_capabilities_get_data_forms, function in WockyXep0115Capabilities
    wocky_xep_0115_capabilities_has_feature, function in WockyXep0115Capabilities
    WockyXmppConnectionClass, struct in WockyXmppConnection
    WockyXmppConnectionError, enum in WockyXmppConnection
    WockyXmppError, enum in wocky-xmpp-error
    WockyXmppErrorDomain, struct in wocky-xmpp-error
    WockyXmppErrorSpecialization, struct in wocky-xmpp-error
    WockyXmppErrorType, enum in wocky-xmpp-error
    WockyXmppReaderClass, struct in WockyXmppReader
    WockyXmppReaderError, enum in WockyXmppReader
    WockyXmppReaderState, enum in WockyXmppReader
    WockyXmppStreamError, enum in wocky-xmpp-error
    WockyXmppWriterClass, struct in WockyXmppWriter
    WOCKY_XMPP_CONNECTION_ERROR, macro in WockyXmppConnection
    wocky_xmpp_connection_error_quark, function in WockyXmppConnection
    wocky_xmpp_connection_force_close_async, function in WockyXmppConnection
    wocky_xmpp_connection_force_close_finish, function in WockyXmppConnection
    wocky_xmpp_connection_new, function in WockyXmppConnection
    wocky_xmpp_connection_new_id, function in WockyXmppConnection
    wocky_xmpp_connection_recv_open_async, function in WockyXmppConnection
    wocky_xmpp_connection_recv_open_finish, function in WockyXmppConnection
    wocky_xmpp_connection_recv_stanza_async, function in WockyXmppConnection
    wocky_xmpp_connection_recv_stanza_finish, function in WockyXmppConnection
    wocky_xmpp_connection_reset, function in WockyXmppConnection
    wocky_xmpp_connection_send_close_async, function in WockyXmppConnection
    wocky_xmpp_connection_send_close_finish, function in WockyXmppConnection
    wocky_xmpp_connection_send_open_async, function in WockyXmppConnection
    wocky_xmpp_connection_send_open_finish, function in WockyXmppConnection
    wocky_xmpp_connection_send_stanza_async, function in WockyXmppConnection
    wocky_xmpp_connection_send_stanza_finish, function in WockyXmppConnection
    wocky_xmpp_connection_send_whitespace_ping_async, function in WockyXmppConnection
    wocky_xmpp_connection_send_whitespace_ping_finish, function in WockyXmppConnection
    WOCKY_XMPP_ERROR, macro in wocky-xmpp-error
    wocky_xmpp_error_deinit, function in wocky-xmpp-error
    wocky_xmpp_error_description, function in wocky-xmpp-error
    wocky_xmpp_error_extract, function in wocky-xmpp-error
    wocky_xmpp_error_init, function in wocky-xmpp-error
    wocky_xmpp_error_quark, function in wocky-xmpp-error
    wocky_xmpp_error_register_domain, function in wocky-xmpp-error
    wocky_xmpp_error_string, function in wocky-xmpp-error
    WOCKY_XMPP_NS_AMP, macro in wocky-namespaces
    WOCKY_XMPP_NS_BIND, macro in wocky-namespaces
    WOCKY_XMPP_NS_DATA, macro in wocky-namespaces
    WOCKY_XMPP_NS_DELAY, macro in wocky-namespaces
    WOCKY_XMPP_NS_EVENT, macro in wocky-namespaces
    WOCKY_XMPP_NS_FEATURENEG, macro in wocky-namespaces
    WOCKY_XMPP_NS_IBB, macro in wocky-namespaces
    WOCKY_XMPP_NS_IQ_OOB, macro in wocky-namespaces
    WOCKY_XMPP_NS_JABBER_CLIENT, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE_ERRORS, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE_RTP, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE_RTP_AUDIO, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE_RTP_ERRORS, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE_RTP_INFO, macro in wocky-namespaces
    WOCKY_XMPP_NS_JINGLE_RTP_VIDEO, macro in wocky-namespaces
    WOCKY_XMPP_NS_PING, macro in wocky-namespaces
    WOCKY_XMPP_NS_PUBSUB, macro in wocky-namespaces
    WOCKY_XMPP_NS_PUBSUB_ERRORS, macro in wocky-namespaces
    WOCKY_XMPP_NS_PUBSUB_EVENT, macro in wocky-namespaces
    WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG, macro in wocky-namespaces
    WOCKY_XMPP_NS_PUBSUB_OWNER, macro in wocky-namespaces
    WOCKY_XMPP_NS_ROSTER, macro in wocky-namespaces
    WOCKY_XMPP_NS_SASL_AUTH, macro in wocky-namespaces
    WOCKY_XMPP_NS_SESSION, macro in wocky-namespaces
    WOCKY_XMPP_NS_SI, macro in wocky-namespaces
    WOCKY_XMPP_NS_STANZAS, macro in wocky-namespaces
    WOCKY_XMPP_NS_STREAM, macro in wocky-namespaces
    WOCKY_XMPP_NS_STREAMS, macro in wocky-namespaces
    WOCKY_XMPP_NS_TLS, macro in wocky-namespaces
    WOCKY_XMPP_NS_XHTML_IM, macro in wocky-namespaces
    WOCKY_XMPP_NS_X_OOB, macro in wocky-namespaces
    WOCKY_XMPP_READER_ERROR, macro in WockyXmppReader
    wocky_xmpp_reader_error_quark, function in WockyXmppReader
    wocky_xmpp_reader_get_error, function in WockyXmppReader
    wocky_xmpp_reader_get_state, function in WockyXmppReader
    wocky_xmpp_reader_new, function in WockyXmppReader
    wocky_xmpp_reader_new_no_stream, function in WockyXmppReader
    wocky_xmpp_reader_peek_stanza, function in WockyXmppReader
    wocky_xmpp_reader_pop_stanza, function in WockyXmppReader
    wocky_xmpp_reader_push, function in WockyXmppReader
    wocky_xmpp_reader_reset, function in WockyXmppReader
    wocky_xmpp_stanza_error_to_string, function in wocky-xmpp-error
    WOCKY_XMPP_STREAM_ERROR, macro in wocky-xmpp-error
    wocky_xmpp_stream_error_from_node, function in wocky-xmpp-error
    wocky_xmpp_stream_error_quark, function in wocky-xmpp-error
    wocky_xmpp_writer_flush, function in WockyXmppWriter
    wocky_xmpp_writer_new, function in WockyXmppWriter
    wocky_xmpp_writer_new_no_stream, function in WockyXmppWriter
    wocky_xmpp_writer_stream_close, function in WockyXmppWriter
    wocky_xmpp_writer_stream_open, function in WockyXmppWriter
    wocky_xmpp_writer_write_node_tree, function in WockyXmppWriter
    wocky_xmpp_writer_write_stanza, function in WockyXmppWriter
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyDiscoIdentity.html0000644000175000017500000004700212051456453027361 0ustar00wjtwjt00000000000000 WockyDiscoIdentity

    WockyDiscoIdentity

    WockyDiscoIdentity — Structure holding XMPP disco identity information.

    Object Hierarchy

      GBoxed
       +----WockyDiscoIdentity
    

    Description

    Contains information regarding the identity information in disco replies, as described in XEP-0030.

    Details

    struct WockyDiscoIdentity

    struct WockyDiscoIdentity {
      gchar *category;
      gchar *type;
      gchar *lang;
      gchar *name;
    };
    

    A structure used to hold information regarding an identity from a disco reply as described in XEP-0030.

    gchar *category;

    the identity category

    gchar *type;

    the identity type

    gchar *lang;

    the identity language

    gchar *name;

    the identity name

    wocky_disco_identity_array_copy ()

    GPtrArray *         wocky_disco_identity_array_copy     (const GPtrArray *source);

    Copies an array of WockyDiscoIdentity objects. The returned array contains new copies of the contents of the source array.

    source :

    The source array to be copied.

    Returns :

    A newly instantiated array with new copies of the contents of the source array. See: wocky_disco_identity_array_new()

    wocky_disco_identity_array_free ()

    void                wocky_disco_identity_array_free     (GPtrArray *arr);

    Frees an array of WockyDiscoIdentity objects created with wocky_disco_identity_array_new() or returned by wocky_disco_identity_array_copy().

    Note that if this method is called with an array created with g_ptr_array_new(), the caller should also free the array contents.

    See: wocky_disco_identity_array_new(), wocky_disco_identity_array_copy()

    arr :

    Array to be freed.

    wocky_disco_identity_array_new ()

    GPtrArray *         wocky_disco_identity_array_new      (void);

    Creates a new array of WockyDiscoIdentity structures.

    Returns :

    A newly instantiated array. wocky_disco_identity_array_free() should beq used to free the memory allocated by this array. See: wocky_disco_identity_array_free()

    wocky_disco_identity_cmp ()

    gint                wocky_disco_identity_cmp            (WockyDiscoIdentity *left,
                                                             WockyDiscoIdentity *right);

    Compares left and right. It returns an integer less than, equal to, or greater than zero if left is found, respectively, to be less than, to match, or be greater than right.

    This function can be casted to a GCompareFunc to sort a list of WockyDiscoIdentity structures.

    left :

    a WockyDiscoIdentity

    right :

    a WockyDiscoIdentity

    Returns :

    the result of comparing left and right

    wocky_disco_identity_copy ()

    WockyDiscoIdentity * wocky_disco_identity_copy          (const WockyDiscoIdentity *source);

    Creates a new WockyDiscoIdentity structure with the data given by source. The copy also copies the internal data so source can be freed after this function is called.

    source :

    the WockyDiscoIdentity to copy

    Returns :

    a new WockyDiscoIdentity which is a deep copy of source

    wocky_disco_identity_free ()

    void                wocky_disco_identity_free           (WockyDiscoIdentity *identity);

    Frees the memory used by identity.

    identity :

    a WockyDiscoIdentity

    wocky_disco_identity_new ()

    WockyDiscoIdentity * wocky_disco_identity_new           (const gchar *category,
                                                             const gchar *type,
                                                             const gchar *lang,
                                                             const gchar *name);

    category :

    disco category

    type :

    disco type

    lang :

    disco language

    name :

    disco name

    Returns :

    a new WockyDiscoIdentity which should be freed using wocky_disco_identity_free().
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyNodeTree.html0000644000175000017500000002417612051456453026322 0ustar00wjtwjt00000000000000 WockyNodeTree

    WockyNodeTree

    WockyNodeTree

    Description

    Details

    struct WockyNodeTreeClass

    struct WockyNodeTreeClass {
    };
    

    The class of a WockyNodeTree.


    wocky_node_tree_get_top_node ()

    WockyNode *         wocky_node_tree_get_top_node        (WockyNodeTree *self);

    wocky_node_tree_new ()

    WockyNodeTree *     wocky_node_tree_new                 (const gchar *name,
                                                             const gchar *ns,
                                                             ...);

    Build a node-tree from a list of arguments. Example:

    Example 2. 

    1
    2
    3
    4
    5
    wocky_node_tree_new ("html", "http://www.w3.org/1999/xhtml",
       '(', "body", '@', "textcolor", "red",
          '$', "Wocky wooo",
       ')',
      NULL);


    name :

    The name of the toplevel node

    ns :

    The namespace of the toplevel node

    ... :

    the description of the node tree to build, terminated with NULL

    Returns :

    a new node-tree object

    wocky_node_tree_new_from_node ()

    WockyNodeTree *     wocky_node_tree_new_from_node       (WockyNode *node);

    Build a new WockyNodeTree that contains a copy of the given node.

    node :

    The node to copy

    Returns :

    a new node-tree object

    wocky_node_tree_new_va ()

    WockyNodeTree *     wocky_node_tree_new_va              (const gchar *name,
                                                             const char *ns,
                                                             va_list va);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/style.css0000644000175000017500000001210012051456453024544 0ustar00wjtwjt00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-muc-enumtypes.html0000644000175000017500000000457412051456453030677 0ustar00wjtwjt00000000000000 wocky-muc-enumtypes

    wocky-muc-enumtypes

    wocky-muc-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/annotation-glossary.html0000644000175000017500000000510312051456453027600 0ustar00wjtwjt00000000000000 Annotation Glossary

    Annotation Glossary

    O

    out

    Parameter for returning results. Default is transfer full.

    A

    allow-none

    NULL is ok, both for passing and for returning.

    E

    element-type

    Generics and defining elements of containers and arrays.

    T

    transfer full

    Free data after the code is done.

    transfer none

    Don't free data after the code is done.

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-utils.html0000644000175000017500000001255112051456453030156 0ustar00wjtwjt00000000000000 wocky-sasl-utils

    wocky-sasl-utils

    wocky-sasl-utils

    Synopsis

    #define             WOCKY_SHA1_BLOCK_SIZE
    #define             WOCKY_SHA1_DIGEST_SIZE
    GByteArray *        sasl_calculate_hmac_sha1            (guint8 *key,
                                                             gsize key_len,
                                                             guint8 *text,
                                                             gsize text_len);
    gchar *             sasl_generate_base64_nonce          (void);
    

    Description

    Details

    WOCKY_SHA1_BLOCK_SIZE

    #define WOCKY_SHA1_BLOCK_SIZE 64
    

    WOCKY_SHA1_DIGEST_SIZE

    #define WOCKY_SHA1_DIGEST_SIZE 20
    

    sasl_calculate_hmac_sha1 ()

    GByteArray *        sasl_calculate_hmac_sha1            (guint8 *key,
                                                             gsize key_len,
                                                             guint8 *text,
                                                             gsize text_len);

    sasl_generate_base64_nonce ()

    gchar *             sasl_generate_base64_nonce          (void);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-node-protected.html0000644000175000017500000005416612051456453032300 0ustar00wjtwjt00000000000000 wocky-pubsub-node-protected

    wocky-pubsub-node-protected

    wocky-pubsub-node-protected

    Synopsis

    WockyPorter *       wocky_pubsub_node_get_porter        (WockyPubsubNode *self);
    WockyStanza *       wocky_pubsub_node_make_delete_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **delete_node);
    WockyStanza *       wocky_pubsub_node_make_get_configuration_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **configure_node);
    WockyStanza *       wocky_pubsub_node_make_list_affiliates_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **affiliations_node);
    WockyStanza *       wocky_pubsub_node_make_list_subscribers_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **subscriptions_node);
    WockyStanza *       wocky_pubsub_node_make_modify_affiliates_stanza
                                                            (WockyPubsubNode *self,
                                                             const GList *affiliates,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **affiliations_node);
    WockyStanza *       wocky_pubsub_node_make_subscribe_stanza
                                                            (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **subscribe_node);
    WockyStanza *       wocky_pubsub_node_make_unsubscribe_stanza
                                                            (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             const gchar *subid,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **unsubscribe_node);
    GList *             wocky_pubsub_node_parse_affiliations
                                                            (WockyPubsubNode *self,
                                                             WockyNode *affiliations_node);
    

    Description

    Details

    wocky_pubsub_node_get_porter ()

    WockyPorter *       wocky_pubsub_node_get_porter        (WockyPubsubNode *self);

    wocky_pubsub_node_make_delete_stanza ()

    WockyStanza *       wocky_pubsub_node_make_delete_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **delete_node);

    wocky_pubsub_node_make_get_configuration_stanza ()

    WockyStanza *       wocky_pubsub_node_make_get_configuration_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **configure_node);

    self :

    a pubsub node

    pubsub_node :

    location at which to store a pointer to the <pubsub/> node, or NULL

    configure_node :

    location at which to store a pointer to the <configure/> node, or NULL

    Returns :

    an IQ stanza to retrieve the configuration of self

    wocky_pubsub_node_make_list_affiliates_stanza ()

    WockyStanza *       wocky_pubsub_node_make_list_affiliates_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **affiliations_node);

    wocky_pubsub_node_make_list_subscribers_stanza ()

    WockyStanza *       wocky_pubsub_node_make_list_subscribers_stanza
                                                            (WockyPubsubNode *self,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **subscriptions_node);

    wocky_pubsub_node_make_modify_affiliates_stanza ()

    WockyStanza *       wocky_pubsub_node_make_modify_affiliates_stanza
                                                            (WockyPubsubNode *self,
                                                             const GList *affiliates,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **affiliations_node);

    self :

    a pubsub node

    affiliates :

    a list of WockyPubsubAffiliation structures, describing only the affiliations which should be changed.

    pubsub_node :

    location at which to store a pointer to the <pubsub/> node, or NULL

    affiliations_node :

    location at which to store a pointer to the <affiliations/> node, or NULL

    Returns :

    an IQ stanza to modify the entities affiliated to a node that you own.

    wocky_pubsub_node_make_subscribe_stanza ()

    WockyStanza *       wocky_pubsub_node_make_subscribe_stanza
                                                            (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **subscribe_node);

    wocky_pubsub_node_make_unsubscribe_stanza ()

    WockyStanza *       wocky_pubsub_node_make_unsubscribe_stanza
                                                            (WockyPubsubNode *self,
                                                             const gchar *jid,
                                                             const gchar *subid,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **unsubscribe_node);

    wocky_pubsub_node_parse_affiliations ()

    GList *             wocky_pubsub_node_parse_affiliations
                                                            (WockyPubsubNode *self,
                                                             WockyNode *affiliations_node);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-http-proxy.html0000644000175000017500000000746412051456453030223 0ustar00wjtwjt00000000000000 wocky-http-proxy

    wocky-http-proxy

    wocky-http-proxy

    Object Hierarchy

      GObject
       +----WockyHttpProxy
    

    Implemented Interfaces

    WockyHttpProxy implements GProxy.

    Description

    Details

    WockyHttpProxy

    typedef struct _WockyHttpProxy WockyHttpProxy;

    WockyHttpProxyClass

    typedef struct _WockyHttpProxyClass WockyHttpProxyClass;
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyNode.html0000644000175000017500000037224212051456453026634 0ustar00wjtwjt00000000000000 WockyNode

    WockyNode

    WockyNode — representation of a XMPP node

    Synopsis

    #include <wocky/wocky-node.h>
    
    struct              WockyNode;
    enum                WockyNodeBuildTag;
                        WockyNodeIter;
    void                wocky_node_add_build                (WockyNode *node,
                                                             ...);
    void                wocky_node_add_build_va             (WockyNode *node,
                                                             va_list va);
    WockyNode *         wocky_node_add_child                (WockyNode *node,
                                                             const gchar *name);
    WockyNode *         wocky_node_add_child_ns             (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);
    WockyNode *         wocky_node_add_child_ns_q           (WockyNode *node,
                                                             const gchar *name,
                                                             GQuark ns);
    WockyNode *         wocky_node_add_child_with_content   (WockyNode *node,
                                                             const gchar *name,
                                                             const char *content);
    WockyNode *         wocky_node_add_child_with_content_ns
                                                            (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *content,
                                                             const gchar *ns);
    WockyNode *         wocky_node_add_child_with_content_ns_q
                                                            (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *content,
                                                             GQuark ns);
    void                wocky_node_add_node_tree            (WockyNode *node,
                                                             WockyNodeTree *tree);
    void                wocky_node_append_content           (WockyNode *node,
                                                             const gchar *content);
    void                wocky_node_append_content_n         (WockyNode *node,
                                                             const gchar *content,
                                                             gsize size);
    const gchar *       wocky_node_attribute_ns_get_prefix_from_quark
                                                            (GQuark ns);
    const gchar *       wocky_node_attribute_ns_get_prefix_from_urn
                                                            (const gchar *urn);
    void                wocky_node_attribute_ns_set_prefix  (GQuark ns,
                                                             const gchar *prefix);
    void                wocky_node_deinit                   (void);
    gboolean            (*wocky_node_each_attr_func)        (const gchar *key,
                                                             const gchar *value,
                                                             const gchar *pref,
                                                             const gchar *ns,
                                                             gpointer user_data);
    void                wocky_node_each_attribute           (WockyNode *node,
                                                             wocky_node_each_attr_func func,
                                                             gpointer user_data);
    void                wocky_node_each_child               (WockyNode *node,
                                                             wocky_node_each_child_func func,
                                                             gpointer user_data);
    gboolean            (*wocky_node_each_child_func)       (WockyNode *node,
                                                             gpointer user_data);
    gboolean            wocky_node_equal                    (WockyNode *node0,
                                                             WockyNode *node1);
    void                wocky_node_free                     (WockyNode *node);
    const gchar *       wocky_node_get_attribute            (WockyNode *node,
                                                             const gchar *key);
    const gchar *       wocky_node_get_attribute_ns         (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *ns);
    WockyNode *         wocky_node_get_child                (WockyNode *node,
                                                             const gchar *name);
    WockyNode *         wocky_node_get_child_ns             (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);
    const gchar *       wocky_node_get_content_from_child   (WockyNode *node,
                                                             const gchar *name);
    const gchar *       wocky_node_get_content_from_child_ns
                                                            (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);
    WockyNode *         wocky_node_get_first_child          (WockyNode *node);
    WockyNode *         wocky_node_get_first_child_ns       (WockyNode *node,
                                                             const gchar *ns);
    const gchar *       wocky_node_get_language             (WockyNode *node);
    const gchar *       wocky_node_get_ns                   (WockyNode *node);
    gboolean            wocky_node_has_ns                   (WockyNode *node,
                                                             const gchar *ns);
    gboolean            wocky_node_has_ns_q                 (WockyNode *node,
                                                             GQuark ns);
    void                wocky_node_init                     (void);
    gboolean            wocky_node_is_superset              (WockyNode *node,
                                                             WockyNode *subset);
    void                wocky_node_iter_init                (WockyNodeIter *iter,
                                                             WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);
    gboolean            wocky_node_iter_next                (WockyNodeIter *iter,
                                                             WockyNode **next);
    gboolean            wocky_node_matches                  (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);
    gboolean            wocky_node_matches_q                (WockyNode *node,
                                                             const gchar *name,
                                                             GQuark ns);
    WockyNode *         wocky_node_new                      (const char *name,
                                                             const gchar *ns);
    void                wocky_node_prepend_node_tree        (WockyNode *node,
                                                             WockyNodeTree *tree);
    void                wocky_node_set_attribute            (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value);
    void                wocky_node_set_attribute_n          (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             gsize value_size);
    void                wocky_node_set_attribute_n_ns       (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             gsize value_size,
                                                             const gchar *ns);
    void                wocky_node_set_attribute_ns         (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             const gchar *ns);
    void                wocky_node_set_attributes           (WockyNode *node,
                                                             const gchar *key,
                                                             ...);
    void                wocky_node_set_content              (WockyNode *node,
                                                             const gchar *content);
    void                wocky_node_set_language             (WockyNode *node,
                                                             const gchar *lang);
    void                wocky_node_set_language_n           (WockyNode *node,
                                                             const gchar *lang,
                                                             gsize lang_size);
    gchar *             wocky_node_to_string                (WockyNode *node);
    

    Description

    Low level representation of a XMPP node. Provides ways to set various parameters on the node, such as content, language, namespaces and prefixes. It also offers methods to lookup children of a node.

    Details

    struct WockyNode

    struct WockyNode {
      gchar *name;
      gchar *content;
    };
    

    A single WockyNode structure that relates to an element in an XMPP stanza.

    gchar *name;

    name of the node

    gchar *content;

    content of the node

    enum WockyNodeBuildTag

    typedef enum {
      WOCKY_NODE_START = '(',
      WOCKY_NODE_TEXT = '$',
      WOCKY_NODE_END = 41, /* this is actually ')', but gtk-doc is broken: bgo#644291 */
      WOCKY_NODE_ATTRIBUTE = '@',
      WOCKY_NODE_XMLNS = ':',
      WOCKY_NODE_ASSIGN_TO = '*',
      WOCKY_NODE_LANGUAGE = '#'
    } WockyNodeBuildTag;
    

    Tags for building a stanza using wocky_stanza_build() or wocky_node_add_build().

    WOCKY_NODE_START

    Start of a node

    WOCKY_NODE_TEXT

    Text content of a node

    WOCKY_NODE_END

    End of a node

    WOCKY_NODE_ATTRIBUTE

    A node attribute

    WOCKY_NODE_XMLNS

    A node XML namespace

    WOCKY_NODE_ASSIGN_TO

    a WockyNode to assign

    WOCKY_NODE_LANGUAGE


    WockyNodeIter

    typedef struct {
    } WockyNodeIter;
    

    Iterate over a node's children. See wocky_node_iter_init() for more details.


    wocky_node_add_build ()

    void                wocky_node_add_build                (WockyNode *node,
                                                             ...);

    Add a node subtree to an existing parent node.

    Example 1. 

    1
    2
    3
    4
    5
    wocky_node_add_build (node,
       '(', "body",
           '$', "Telepathy rocks!",
       ')',
      NULL);


    The above examples adds the following subtree under the given node:

    <body>
       Telepathy rocks!
    </body>
    

    node :

    The node under which to add a new subtree

    ... :

    the description of the stanza to build, terminated with NULL

    wocky_node_add_build_va ()

    void                wocky_node_add_build_va             (WockyNode *node,
                                                             va_list va);

    wocky_node_add_child ()

    WockyNode *         wocky_node_add_child                (WockyNode *node,
                                                             const gchar *name);

    Adds a WockyNode with the specified name to an already existing node.

    node :

    a WockyNode

    name :

    the name of the child to add

    Returns :

    the newly added WockyNode.

    wocky_node_add_child_ns ()

    WockyNode *         wocky_node_add_child_ns             (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);

    Adds a WockyNode with the specified name to an already existing node, under the specified namespace. If the namespace is NULL, this is equivalent to wocky_node_add_child().

    node :

    a WockyNode

    name :

    the name of the child to add

    ns :

    a namespace

    Returns :

    the newly added WockyNode.

    wocky_node_add_child_ns_q ()

    WockyNode *         wocky_node_add_child_ns_q           (WockyNode *node,
                                                             const gchar *name,
                                                             GQuark ns);

    Adds a WockyNode with the specified name to an already existing node, under the specified namespace. If the namespace is 0, this is equivalent to wocky_node_add_child().

    node :

    a WockyNode

    name :

    the name of the child to add

    ns :

    a namespace

    Returns :

    the newly added WockyNode.

    wocky_node_add_child_with_content ()

    WockyNode *         wocky_node_add_child_with_content   (WockyNode *node,
                                                             const gchar *name,
                                                             const char *content);

    Adds a WockyNode with the specified name and containing the specified content to an already existing node.

    node :

    a WockyNode

    name :

    the name of the child to add

    content :

    the content of the child to add

    Returns :

    the newly added WockyNode.

    wocky_node_add_child_with_content_ns ()

    WockyNode *         wocky_node_add_child_with_content_ns
                                                            (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *content,
                                                             const gchar *ns);

    Adds a WockyNode with the specified name and the specified content to an already existing node, under the specified namespace. If the namespace is NULL, this is equivalent to wocky_node_add_child_with_content().

    node :

    a WockyNode

    name :

    the name of the child to add

    content :

    the content of the child to add

    ns :

    a namespace

    Returns :

    the newly added WockyNode.

    wocky_node_add_child_with_content_ns_q ()

    WockyNode *         wocky_node_add_child_with_content_ns_q
                                                            (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *content,
                                                             GQuark ns);

    Adds a WockyNode with the specified name and the specified content to an already existing node, under the specified namespace. If the namespace is 0, this is equivalent to wocky_node_add_child_with_content().

    node :

    a WockyNode

    name :

    the name of the child to add

    content :

    the content of the child to add

    ns :

    a namespace

    Returns :

    the newly added WockyNode.

    wocky_node_add_node_tree ()

    void                wocky_node_add_node_tree            (WockyNode *node,
                                                             WockyNodeTree *tree);

    Copies the nodes from tree, and appends them to node's children.

    node :

    A node

    tree :

    The node tree to add

    wocky_node_append_content ()

    void                wocky_node_append_content           (WockyNode *node,
                                                             const gchar *content);

    Appends some content to the content of a WockyNode.

    node :

    a WockyNode

    content :

    the content to append to the node

    wocky_node_append_content_n ()

    void                wocky_node_append_content_n         (WockyNode *node,
                                                             const gchar *content,
                                                             gsize size);

    Appends a specified number of content bytes to the content of a WockyNode.

    node :

    a WockyNode

    content :

    the content to append to the node

    size :

    the size of the content to append

    wocky_node_attribute_ns_get_prefix_from_quark ()

    const gchar *       wocky_node_attribute_ns_get_prefix_from_quark
                                                            (GQuark ns);

    Gets the prefix of the namespace identified by the quark.

    ns :

    a quark corresponding to an XML namespace URN

    Returns :

    a string containing the prefix of the namespace ns.

    wocky_node_attribute_ns_get_prefix_from_urn ()

    const gchar *       wocky_node_attribute_ns_get_prefix_from_urn
                                                            (const gchar *urn);

    Gets the prefix of the namespace identified by the URN.

    urn :

    a string containing an URN

    Returns :

    a string containing the prefix of the namespace urn.

    wocky_node_attribute_ns_set_prefix ()

    void                wocky_node_attribute_ns_set_prefix  (GQuark ns,
                                                             const gchar *prefix);

    Sets a desired prefix for a namespace.

    ns :

    a GQuark

    prefix :

    a string containing the desired prefix

    wocky_node_deinit ()

    void                wocky_node_deinit                   (void);

    Releases all the resources used by the WockyNode caches.


    wocky_node_each_attr_func ()

    gboolean            (*wocky_node_each_attr_func)        (const gchar *key,
                                                             const gchar *value,
                                                             const gchar *pref,
                                                             const gchar *ns,
                                                             gpointer user_data);

    Specifies the type of functions passed to wocky_node_each_attribute().

    key :

    the attribute's key

    value :

    the attribute's value

    pref :

    the attribute's prefix

    ns :

    the attribute's namespace

    user_data :

    user data passed to wocky_node_each_attribute()

    Returns :

    FALSE to stop further attributes from being examined.

    wocky_node_each_attribute ()

    void                wocky_node_each_attribute           (WockyNode *node,
                                                             wocky_node_each_attr_func func,
                                                             gpointer user_data);

    Calls a function for each attribute of a WockyNode.

    node :

    a WockyNode

    func :

    the function to be called on each node's attribute

    user_data :

    user data to pass to the function

    wocky_node_each_child ()

    void                wocky_node_each_child               (WockyNode *node,
                                                             wocky_node_each_child_func func,
                                                             gpointer user_data);

    Calls a function for each child of a WockyNode.

    node :

    a WockyNode

    func :

    the function to be called on each node's child

    user_data :

    user data to pass to the function

    wocky_node_each_child_func ()

    gboolean            (*wocky_node_each_child_func)       (WockyNode *node,
                                                             gpointer user_data);

    Specifies the type of functions passed to wocky_node_each_child().

    node :

    a WockyNode

    user_data :

    user data passed to wocky_node_each_child()

    Returns :

    FALSE to stop further children from being examined.

    wocky_node_equal ()

    gboolean            wocky_node_equal                    (WockyNode *node0,
                                                             WockyNode *node1);

    Compares two WockyNodes for equality.

    node0 :

    a WockyNode

    node1 :

    a WockyNode to compare to node0

    Returns :

    TRUE if the two nodes are equal.

    wocky_node_free ()

    void                wocky_node_free                     (WockyNode *node);

    Convenience function that frees the passed in WockyNode and all of its children.

    node :

    a WockyNode.

    wocky_node_get_attribute ()

    const gchar *       wocky_node_get_attribute            (WockyNode *node,
                                                             const gchar *key);

    Returns the value of an attribute in a WockyNode.

    node :

    a WockyNode

    key :

    the attribute name

    Returns :

    the value of the attribute key, or NULL if node doesn't have such attribute.

    wocky_node_get_attribute_ns ()

    const gchar *       wocky_node_get_attribute_ns         (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *ns);

    Returns the value of an attribute in a WockyNode, limiting the search within a specific namespace. If the namespace is NULL, this is equivalent to wocky_node_get_attribute().

    node :

    a WockyNode

    key :

    the attribute name

    ns :

    the namespace to search within, or NULL

    Returns :

    the value of the attribute key, or NULL if node doesn't have such attribute in ns.

    wocky_node_get_child ()

    WockyNode *         wocky_node_get_child                (WockyNode *node,
                                                             const gchar *name);

    Gets a child of a node, searching by name.

    node :

    a WockyNode

    name :

    the name of the child to get

    Returns :

    a WockyNode.

    wocky_node_get_child_ns ()

    WockyNode *         wocky_node_get_child_ns             (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);

    Gets the child of a node, searching by name and limiting the search to the specified namespace. If the namespace is NULL, this is equivalent to wocky_node_get_child()

    node :

    a WockyNode

    name :

    the name of the child to get

    ns :

    the namespace of the child to get, or NULL

    Returns :

    a WockyNode.

    wocky_node_get_content_from_child ()

    const gchar *       wocky_node_get_content_from_child   (WockyNode *node,
                                                             const gchar *name);

    Retrieves the content from a child of a node, if it exists.

    node :

    a WockyNode

    name :

    the name of the child whose content to retrieve

    Returns :

    the content of the child of node named name, or NULL if node has no such child.

    wocky_node_get_content_from_child_ns ()

    const gchar *       wocky_node_get_content_from_child_ns
                                                            (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);

    Retrieves the content from a child of a node, if it exists.

    node :

    a WockyNode

    name :

    the name of the child whose content to retrieve

    ns :

    the namespace of the child whose content to retrieve

    Returns :

    the content of the child of node named name in ns, or NULL if node has no such child.

    wocky_node_get_first_child ()

    WockyNode *         wocky_node_get_first_child          (WockyNode *node);

    Convenience function to return the first child of a WockyNode.

    node :

    a WockyNode

    Returns :

    a WockyNode, or NULL if node has no children.

    wocky_node_get_first_child_ns ()

    WockyNode *         wocky_node_get_first_child_ns       (WockyNode *node,
                                                             const gchar *ns);

    Returns the first child of node whose namespace is ns, saving you the bother of faffing around with a WockyNodeIter.

    node :

    a WockyNode

    ns :

    the namespace of the child node you seek.

    Returns :

    the first child of node whose namespace is ns, or NULL if none is found.

    wocky_node_get_language ()

    const gchar *       wocky_node_get_language             (WockyNode *node);

    Gets the language of a WockyNode

    node :

    a WockyNode

    Returns :

    a string containing the language of the node.

    wocky_node_get_ns ()

    const gchar *       wocky_node_get_ns                   (WockyNode *node);

    Gets the namespace of a WockyNode

    node :

    a WockyNode

    Returns :

    a string containing the namespace of the node.

    wocky_node_has_ns ()

    gboolean            wocky_node_has_ns                   (WockyNode *node,
                                                             const gchar *ns);

    wocky_node_has_ns_q ()

    gboolean            wocky_node_has_ns_q                 (WockyNode *node,
                                                             GQuark ns);

    wocky_node_init ()

    void                wocky_node_init                     (void);

    Initializes the caches used by WockyNode. This should be always called before using WockyNode structs.


    wocky_node_is_superset ()

    gboolean            wocky_node_is_superset              (WockyNode *node,
                                                             WockyNode *subset);

    node :

    the WockyNode to test

    subset :

    the supposed subset

    Returns :

    TRUE if node is a superset of subset.

    wocky_node_iter_init ()

    void                wocky_node_iter_init                (WockyNodeIter *iter,
                                                             WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);

    Initializes an iterator that can be used to iterate over the children of node, filtered by name and ns

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    WockyNodeIter iter;
    WockyNode *child;
    
    wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza),
       "payload-type",
       WOCKY_XMPP_NS_JINGLE_RTP);
    while (wocky_node_iter_next (iter, &child))
      {
        /* do something with the child */
      }

    iter :

    unitialized iterator

    node :

    Node whose children to iterate over

    name :

    Name to filter on or NULL

    ns :

    namespace to filter on or NULL

    wocky_node_iter_next ()

    gboolean            wocky_node_iter_next                (WockyNodeIter *iter,
                                                             WockyNode **next);

    Advances iter to the next child that matches its filter. if FALSE is returned next is not set and the iterator becomes invalid

    iter :

    an initialized WockyNodeIter

    next :

    a location to store the next child

    Returns :

    FALSE if the last child has been reached

    wocky_node_matches ()

    gboolean            wocky_node_matches                  (WockyNode *node,
                                                             const gchar *name,
                                                             const gchar *ns);

    Checks whether a node has a particular name and namespace.

    node :

    a WockyNode

    name :

    the expected element name, which may not be NULL

    ns :

    the expected element namespace, which may not be NULL

    Returns :

    TRUE if node is named name, in namespace ns.

    wocky_node_matches_q ()

    gboolean            wocky_node_matches_q                (WockyNode *node,
                                                             const gchar *name,
                                                             GQuark ns);

    Checks whether a node has a particular name and namespace.

    node :

    a WockyNode

    name :

    the expected element name, which may not be NULL

    ns :

    the expected element namespace, which may not be 0

    Returns :

    TRUE if node is named name, in namespace ns.

    wocky_node_new ()

    WockyNode *         wocky_node_new                      (const char *name,
                                                             const gchar *ns);

    Convenience function which creates a WockyNode and sets its name to name.

    name :

    the node's name (may not be NULL)

    ns :

    the nodes namespace (may not be NULL)

    Returns :

    a newly allocated WockyNode.

    wocky_node_prepend_node_tree ()

    void                wocky_node_prepend_node_tree        (WockyNode *node,
                                                             WockyNodeTree *tree);

    Copies the nodes from tree, and inserts them as the first child of node, before any existing children.

    node :

    a node

    tree :

    the node tree to prepend to node's children

    wocky_node_set_attribute ()

    void                wocky_node_set_attribute            (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value);

    Sets an attribute in a WockyNode to a specific value.

    node :

    a WockyNode

    key :

    the attribute name to set

    value :

    the value to set

    wocky_node_set_attribute_n ()

    void                wocky_node_set_attribute_n          (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             gsize value_size);

    Sets a new attribute to a WockyNode, with the supplied values.

    node :

    a WockyNode

    key :

    the attribute to set

    value :

    the value to set

    value_size :

    the number of bytes of value to set as a value

    wocky_node_set_attribute_n_ns ()

    void                wocky_node_set_attribute_n_ns       (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             gsize value_size,
                                                             const gchar *ns);

    Sets a new attribute to a WockyNode, with the supplied values. If the namespace is NULL, this is equivalent to wocky_node_set_attribute_n().

    node :

    a WockyNode

    key :

    the attribute to set

    value :

    the value to set

    value_size :

    the number of bytes of value to set as a value

    ns :

    a namespace, or NULL

    wocky_node_set_attribute_ns ()

    void                wocky_node_set_attribute_ns         (WockyNode *node,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             const gchar *ns);

    Sets an attribute in a WockyNode, within a specific namespace. If the namespace is NULL, this is equivalent to wocky_node_set_attribute().

    node :

    a WockyNode

    key :

    the attribute name to set

    value :

    the value to set

    ns :

    a namespace, or NULL

    wocky_node_set_attributes ()

    void                wocky_node_set_attributes           (WockyNode *node,
                                                             const gchar *key,
                                                             ...);

    Sets attributes in a WockyNode to specific values.

    node :

    a WockyNode

    key :

    the attribute name to set

    ... :

    pairs of keys and values, terminated by NULL

    wocky_node_set_content ()

    void                wocky_node_set_content              (WockyNode *node,
                                                             const gchar *content);

    Sets the content of a WockyNode.

    node :

    a WockyNode

    content :

    the content to set to the node

    wocky_node_set_language ()

    void                wocky_node_set_language             (WockyNode *node,
                                                             const gchar *lang);

    Sets the language of a WockyNode.

    node :

    a WockyNode

    lang :

    a NULL-terminated string containing the language

    wocky_node_set_language_n ()

    void                wocky_node_set_language_n           (WockyNode *node,
                                                             const gchar *lang,
                                                             gsize lang_size);

    Sets the language of a WockyNode.

    node :

    a WockyNode

    lang :

    a language

    lang_size :

    the length of lang, in bytes.

    wocky_node_to_string ()

    gchar *             wocky_node_to_string                (WockyNode *node);

    Obtains a string representation of a WockyNode.

    node :

    a WockyNode

    Returns :

    a newly allocated string containing a serialization of the node.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyDataForm.html0000644000175000017500000011067012051456453027437 0ustar00wjtwjt00000000000000 WockyDataForm

    WockyDataForm

    WockyDataForm — An object to represent an XMPP data form

    Synopsis

    #include <wocky/wocky-data-form.h>
    
    #define             WOCKY_DATA_FORM_ERROR
    struct              WockyDataFormClass;
    enum                WockyDataFormError;
    struct              WockyDataFormField;
    struct              WockyDataFormFieldOption;
    enum                WockyDataFormFieldType;
    void                wocky_data_form_add_to_node         (WockyDataForm *self,
                                                             WockyNode *node);
    GQuark              wocky_data_form_error_quark         (void);
    gint                wocky_data_form_field_cmp           (const WockyDataFormField *left,
                                                             const WockyDataFormField *right);
    const gchar *       wocky_data_form_get_instructions    (WockyDataForm *self);
    const gchar *       wocky_data_form_get_title           (WockyDataForm *self);
    WockyDataForm *     wocky_data_form_new_from_form       (WockyNode *node,
                                                             GError **error);
    WockyDataForm *     wocky_data_form_new_from_node       (WockyNode *x,
                                                             GError **error);
    gboolean            wocky_data_form_parse_result        (WockyDataForm *self,
                                                             WockyNode *node,
                                                             GError **error);
    gboolean            wocky_data_form_set_boolean         (WockyDataForm *self,
                                                             const gchar *field_name,
                                                             gboolean field_value,
                                                             gboolean create_if_missing);
    gboolean            wocky_data_form_set_string          (WockyDataForm *self,
                                                             const gchar *field_name,
                                                             const gchar *field_value,
                                                             gboolean create_if_missing);
    gboolean            wocky_data_form_set_strv            (WockyDataForm *self,
                                                             const gchar *field_name,
                                                             const gchar * const *field_values,
                                                             gboolean create_if_missing);
    gboolean            wocky_data_form_set_type            (WockyDataForm *self,
                                                             const gchar *form_type);
    void                wocky_data_form_submit              (WockyDataForm *self,
                                                             WockyNode *node);
    

    Object Hierarchy

      GEnum
       +----WockyDataFormError
    
      GEnum
       +----WockyDataFormFieldType
    

    Description

    An object that represents an XMPP data form as described in XEP-0004.

    Details

    WOCKY_DATA_FORM_ERROR

    #define WOCKY_DATA_FORM_ERROR (wocky_data_form_error_quark ())
    

    struct WockyDataFormClass

    struct WockyDataFormClass {
    };
    

    The class of a WockyDataForm.


    enum WockyDataFormError

    typedef enum {
      WOCKY_DATA_FORM_ERROR_NOT_FORM,
      WOCKY_DATA_FORM_ERROR_WRONG_TYPE,
    } WockyDataFormError;
    

    WockyDataForm specific errors.

    WOCKY_DATA_FORM_ERROR_NOT_FORM

    Node is not a data form

    WOCKY_DATA_FORM_ERROR_WRONG_TYPE

    Data form is of the wrong type

    struct WockyDataFormField

    struct WockyDataFormField {
      WockyDataFormFieldType type;
      gchar *var;
      gchar *label;
      gchar *desc;
      gboolean required;
      GValue *default_value;
      /* a GStrv of actual values so can be {"1", NULL} or {"false", NULL}
       * for BOOLEAN or {"hi", "there", NULL} TEXT_MULTI, for example. */
      gchar **raw_value_contents;
      GValue *value;
      /* for LIST_MULTI and LIST_SINGLE only.
       * List of (WockyDataFormFieldOption *)*/
      GSList *options;
    };
    

    Details about a single data form field in a WockyDataForm.

    WockyDataFormFieldType type;

    the type of the field

    gchar *var;

    the field name

    gchar *label;

    the label of the field

    gchar *desc;

    the description of the field

    gboolean required;

    TRUE if the field is required, otherwise FALSE

    GValue *default_value;

    the default of the field

    gchar **raw_value_contents;

    GValue *value;

    the field value

    GSList *options;

    a GSList of WockyDataFormFieldOptions if type if WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI or WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE

    struct WockyDataFormFieldOption

    struct WockyDataFormFieldOption {
      gchar *label;
      gchar *value;
    };
    

    A single data form field option.

    gchar *label;

    the option label

    gchar *value;

    the option value

    enum WockyDataFormFieldType

    typedef enum {
      WOCKY_DATA_FORM_FIELD_TYPE_UNSPECIFIED, /*< skip >*/
      WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN,
      WOCKY_DATA_FORM_FIELD_TYPE_FIXED,
      WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN,
      WOCKY_DATA_FORM_FIELD_TYPE_JID_MULTI,
      WOCKY_DATA_FORM_FIELD_TYPE_JID_SINGLE,
      WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI,
      WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE,
      WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI,
      WOCKY_DATA_FORM_FIELD_TYPE_TEXT_PRIVATE,
      WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE
    } WockyDataFormFieldType;
    

    Data form field types, as documented in XEP-0004 §3.3.

    WOCKY_DATA_FORM_FIELD_TYPE_UNSPECIFIED

    Unspecified field type

    WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN

    Boolean field type

    WOCKY_DATA_FORM_FIELD_TYPE_FIXED

    Fixed description field type

    WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN

    Hidden field type

    WOCKY_DATA_FORM_FIELD_TYPE_JID_MULTI

    A list of multiple JIDs

    WOCKY_DATA_FORM_FIELD_TYPE_JID_SINGLE

    A single JID

    WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI

    Many options to choose one or more from

    WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE

    Many options to choose one from

    WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI

    Multiple lines of text

    WOCKY_DATA_FORM_FIELD_TYPE_TEXT_PRIVATE

    A single line of text that should be obscured (by, say, asterisks)

    WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE

    A single line of text

    wocky_data_form_add_to_node ()

    void                wocky_data_form_add_to_node         (WockyDataForm *self,
                                                             WockyNode *node);

    Adds a node tree with default values of self based on the defaults set on each field when first created.

    This function is for adding a data form to an existing node, like the query node of a disco response. wocky_data_form_submit(), in contrast, is for adding a node tree which submits the data form based on the current values set on its fields.

    self :

    the WockyDataForm object

    node :

    a node to which to add the form

    wocky_data_form_error_quark ()

    GQuark              wocky_data_form_error_quark         (void);

    wocky_data_form_field_cmp ()

    gint                wocky_data_form_field_cmp           (const WockyDataFormField *left,
                                                             const WockyDataFormField *right);

    wocky_data_form_get_instructions ()

    const gchar *       wocky_data_form_get_instructions    (WockyDataForm *self);

    wocky_data_form_get_title ()

    const gchar *       wocky_data_form_get_title           (WockyDataForm *self);

    wocky_data_form_new_from_form ()

    WockyDataForm *     wocky_data_form_new_from_form       (WockyNode *node,
                                                             GError **error);

    wocky_data_form_new_from_node ()

    WockyDataForm *     wocky_data_form_new_from_node       (WockyNode *x,
                                                             GError **error);

    wocky_data_form_parse_result ()

    gboolean            wocky_data_form_parse_result        (WockyDataForm *self,
                                                             WockyNode *node,
                                                             GError **error);

    wocky_data_form_set_boolean ()

    gboolean            wocky_data_form_set_boolean         (WockyDataForm *self,
                                                             const gchar *field_name,
                                                             gboolean field_value,
                                                             gboolean create_if_missing);

    self :

    a data form

    field_name :

    the name of a boolean field of self

    field_value :

    the value to fill in for field_name

    create_if_missing :

    if no field named field_name exists, create it

    Returns :

    TRUE if the field was successfully filled in; FALSE if the field did not exist or does not accept a boolean

    wocky_data_form_set_string ()

    gboolean            wocky_data_form_set_string          (WockyDataForm *self,
                                                             const gchar *field_name,
                                                             const gchar *field_value,
                                                             gboolean create_if_missing);

    self :

    a data form

    field_name :

    the name of a string field of self

    field_value :

    the value to fill in for field_name

    create_if_missing :

    if no field named field_name exists, create it

    Returns :

    TRUE if the field was successfully filled in; FALSE if the field did not exist or does not accept a string

    wocky_data_form_set_strv ()

    gboolean            wocky_data_form_set_strv            (WockyDataForm *self,
                                                             const gchar *field_name,
                                                             const gchar * const *field_values,
                                                             gboolean create_if_missing);

    wocky_data_form_set_type ()

    gboolean            wocky_data_form_set_type            (WockyDataForm *self,
                                                             const gchar *form_type);

    Creates a hidden FORM_TYPE field in self and sets its value to form_type. This is intended only to be used on empty forms created for blind submission.

    self :

    a WockyDataForm

    form_type :

    the URI to use as the FORM_TYPE field; may not be NULL

    Returns :

    TRUE if the form's type was set; FALSE if the form already had a type.

    wocky_data_form_submit ()

    void                wocky_data_form_submit              (WockyDataForm *self,
                                                             WockyNode *node);

    Adds a node tree which submits self based on the current values set on self's fields.

    self :

    a data form

    node :

    a node to which to add a form submission
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyMuc.html0000644000175000017500000011262412051456453026467 0ustar00wjtwjt00000000000000 WockyMuc

    WockyMuc

    WockyMuc

    Synopsis

    enum                WockyMucAffiliation;
    struct              WockyMucClass;
    enum                WockyMucFeature;
                        WockyMucMember;
    enum                WockyMucMsgState;
    enum                WockyMucMsgType;
    enum                WockyMucRole;
    enum                WockyMucState;
    enum                WockyMucStatusCode;
    WockyMucAffiliation wocky_muc_affiliation               (WockyMuc *muc);
    WockyStanza *       wocky_muc_create_presence           (WockyMuc *muc,
                                                             WockyStanzaSubType type,
                                                             const gchar *status);
    void                wocky_muc_disco_info_async          (WockyMuc *muc,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancel,
                                                             gpointer data);
    gboolean            wocky_muc_disco_info_finish         (WockyMuc *muc,
                                                             GAsyncResult *res,
                                                             GError **error);
    WockyMucState       wocky_muc_get_state                 (WockyMuc *muc);
    void                wocky_muc_initiate_async            (WockyMuc *muc,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancel,
                                                             gpointer data);
    gboolean            wocky_muc_initiate_finish           (GObject *source,
                                                             GAsyncResult *res,
                                                             GError **error);
    const gchar *       wocky_muc_jid                       (WockyMuc *muc);
    void                wocky_muc_join                      (WockyMuc *muc,
                                                             GCancellable *cancel);
    GHashTable *        wocky_muc_members                   (WockyMuc *muc);
    WockyMucRole        wocky_muc_role                      (WockyMuc *muc);
    const gchar *       wocky_muc_user                      (WockyMuc *muc);
    

    Object Hierarchy

      GEnum
       +----WockyMucAffiliation
    
      GFlags
       +----WockyMucFeature
    
      GEnum
       +----WockyMucMsgState
    
      GEnum
       +----WockyMucMsgType
    
      GEnum
       +----WockyMucRole
    
      GEnum
       +----WockyMucState
    
      GFlags
       +----WockyMucStatusCode
    

    Description

    Details

    enum WockyMucAffiliation

    typedef enum {
      WOCKY_MUC_AFFILIATION_OUTCAST = -1,
      WOCKY_MUC_AFFILIATION_NONE = 0,
      WOCKY_MUC_AFFILIATION_MEMBER,
      WOCKY_MUC_AFFILIATION_ADMIN,
      WOCKY_MUC_AFFILIATION_OWNER,
    } WockyMucAffiliation;
    

    WockyMuc affiliations as described in XEP-0045 §5.2.

    WOCKY_MUC_AFFILIATION_OUTCAST

    outcast affiliation

    WOCKY_MUC_AFFILIATION_NONE

    no affiliation

    WOCKY_MUC_AFFILIATION_MEMBER

    member affiliation

    WOCKY_MUC_AFFILIATION_ADMIN

    admin affiliation

    WOCKY_MUC_AFFILIATION_OWNER

    owner affiliation

    struct WockyMucClass

    struct WockyMucClass {
    };
    

    The class of a WockyMuc.


    enum WockyMucFeature

    typedef enum {
      WOCKY_MUC_MODERN = 1,
      WOCKY_MUC_FORM_REGISTER = (1 << 1),
      WOCKY_MUC_FORM_ROOMCONFIG = (1 << 2),
      WOCKY_MUC_FORM_ROOMINFO = (1 << 3),
      WOCKY_MUC_HIDDEN = (1 << 4),
      WOCKY_MUC_MEMBERSONLY = (1 << 5),
      WOCKY_MUC_MODERATED = (1 << 6),
      WOCKY_MUC_NONANONYMOUS = (1 << 7),
      WOCKY_MUC_OPEN = (1 << 8),
      WOCKY_MUC_PASSWORDPROTECTED = (1 << 9),
      WOCKY_MUC_PERSISTENT = (1 << 10),
      WOCKY_MUC_PUBLIC = (1 << 11),
      WOCKY_MUC_ROOMS = (1 << 12),
      WOCKY_MUC_SEMIANONYMOUS = (1 << 13),
      WOCKY_MUC_TEMPORARY = (1 << 14),
      WOCKY_MUC_UNMODERATED = (1 << 15),
      WOCKY_MUC_UNSECURED = (1 << 16),
      WOCKY_MUC_OBSOLETE = (1 << 17),
    } WockyMucFeature;
    

    WockyMuc feature flags.

    WOCKY_MUC_MODERN

    the MUC is modern, as documented in XEP-0045

    WOCKY_MUC_FORM_REGISTER

    the MUC has support for the mucregister FORM_TYPE

    WOCKY_MUC_FORM_ROOMCONFIG

    the MUC has support for the mucregister FORM_TYPE

    WOCKY_MUC_FORM_ROOMINFO

    the MUC has support for the mucregister FORM_TYPE

    WOCKY_MUC_HIDDEN

    the MUC is hidden

    WOCKY_MUC_MEMBERSONLY

    only members can join this MUC

    WOCKY_MUC_MODERATED

    the MUC is moderated

    WOCKY_MUC_NONANONYMOUS

    the MUC is non-anonymous

    WOCKY_MUC_OPEN

    the MUC is open

    WOCKY_MUC_PASSWORDPROTECTED

    the MUC is password protected

    WOCKY_MUC_PERSISTENT

    the MUC is persistent

    WOCKY_MUC_PUBLIC

    the MUC is public

    WOCKY_MUC_ROOMS

    the MUC has a list of MUC rooms

    WOCKY_MUC_SEMIANONYMOUS

    the MUC is semi-anonymous

    WOCKY_MUC_TEMPORARY

    the MUC is temporary

    WOCKY_MUC_UNMODERATED

    the MUC is unmoderated

    WOCKY_MUC_UNSECURED

    the MUC is unsecured

    WOCKY_MUC_OBSOLETE

    the MUC has obsolete groupchat 1.0 features

    WockyMucMember

    typedef struct {
      gchar *from;   /* room@service/nick     */
      gchar *jid;    /* owner@domain/resource */
      gchar *nick;   /* nick */
      WockyMucRole role;
      WockyMucAffiliation affiliation;
      gchar *status; /* user set status string */
      WockyStanza *presence_stanza;
    } WockyMucMember;
    

    gchar *from;

    the JID of the member (roomserver/nick)

    gchar *jid;

    the JID of the owner (ownerdomain/resource)

    gchar *nick;

    the nickname of the member

    WockyMucRole role;

    the WockyMucRole of the member

    WockyMucAffiliation affiliation;

    the WockyMucAffiliation of the member

    gchar *status;

    the user set status string

    WockyStanza *presence_stanza;

    the WockyStanza that was received regarding the member's presence

    enum WockyMucMsgState

    typedef enum {
      WOCKY_MUC_MSG_STATE_NONE = -1,
      WOCKY_MUC_MSG_STATE_ACTIVE,
      WOCKY_MUC_MSG_STATE_COMPOSING,
      WOCKY_MUC_MSG_STATE_INACTIVE,
      WOCKY_MUC_MSG_STATE_PAUSED,
    } WockyMucMsgState;
    

    XMPP MUC message states as documeted in XEP-0085.

    WOCKY_MUC_MSG_STATE_NONE

    no message state applies

    WOCKY_MUC_MSG_STATE_ACTIVE

    the contact in the MUC is active

    WOCKY_MUC_MSG_STATE_COMPOSING

    the contact in the MUC is composing a message

    WOCKY_MUC_MSG_STATE_INACTIVE

    the contact in the MUC is inactive

    WOCKY_MUC_MSG_STATE_PAUSED

    the contact in the MUC has paused composing a message

    enum WockyMucMsgType

    typedef enum {
      WOCKY_MUC_MSG_NONE,
      WOCKY_MUC_MSG_NORMAL,
      WOCKY_MUC_MSG_ACTION,
      WOCKY_MUC_MSG_NOTICE,
    } WockyMucMsgType;
    

    XMPP MUC message types.

    WOCKY_MUC_MSG_NONE

    no message type

    WOCKY_MUC_MSG_NORMAL

    a normal message

    WOCKY_MUC_MSG_ACTION

    an action message

    WOCKY_MUC_MSG_NOTICE

    a notice message

    enum WockyMucRole

    typedef enum {
      WOCKY_MUC_ROLE_NONE = 0,
      WOCKY_MUC_ROLE_VISITOR,
      WOCKY_MUC_ROLE_PARTICIPANT,
      WOCKY_MUC_ROLE_MODERATOR
    } WockyMucRole;
    

    WockyMuc roles as described in XEP-0045 §5.1.

    WOCKY_MUC_ROLE_NONE

    no role

    WOCKY_MUC_ROLE_VISITOR

    visitor role

    WOCKY_MUC_ROLE_PARTICIPANT

    participant role

    WOCKY_MUC_ROLE_MODERATOR

    moderator role

    enum WockyMucState

    typedef enum {
      WOCKY_MUC_CREATED = 0,
      WOCKY_MUC_INITIATED,
      WOCKY_MUC_AUTH,
      WOCKY_MUC_JOINED,
      WOCKY_MUC_ENDED,
    } WockyMucState;
    

    WockyMuc states.

    WOCKY_MUC_CREATED

    the WockyMuc has been created

    WOCKY_MUC_INITIATED

    the MUC has been initiated on the server

    WOCKY_MUC_AUTH

    the user is authenticating with the MUC

    WOCKY_MUC_JOINED

    the user has joined the MUC and can chat

    WOCKY_MUC_ENDED

    the MUC has ended

    enum WockyMucStatusCode

    typedef enum {
      WOCKY_MUC_CODE_UNKNOWN = 0,
      WOCKY_MUC_CODE_ONYMOUS = 1 << 0,
      WOCKY_MUC_CODE_AF_CHANGE_OOB = 1 << 1,
      WOCKY_MUC_CODE_CFG_SHOW_UNAVAILABLE = 1 << 2,
      WOCKY_MUC_CODE_CFG_HIDE_UNAVAILABLE = 1 << 3,
      WOCKY_MUC_CODE_CFG_NONPRIVACY = 1 << 4,
      WOCKY_MUC_CODE_OWN_PRESENCE = 1 << 5,
      WOCKY_MUC_CODE_CFG_LOGGING_ENABLED = 1 << 6,
      WOCKY_MUC_CODE_CFG_LOGGING_DISABLED = 1 << 7,
      WOCKY_MUC_CODE_CFG_ONYMOUS = 1 << 8,
      WOCKY_MUC_CODE_CFG_SEMIONYMOUS = 1 << 9,
      WOCKY_MUC_CODE_CFG_ANONYMOUS = 1 << 10,
      WOCKY_MUC_CODE_NEW_ROOM = 1 << 11,
      WOCKY_MUC_CODE_NICK_CHANGE_FORCED = 1 << 12,
      WOCKY_MUC_CODE_BANNED = 1 << 13,
      WOCKY_MUC_CODE_NICK_CHANGE_USER = 1 << 14,
      WOCKY_MUC_CODE_KICKED = 1 << 15,
      WOCKY_MUC_CODE_KICKED_AFFILIATION = 1 << 16,
      WOCKY_MUC_CODE_KICKED_ROOM_PRIVATISED = 1 << 17,
      WOCKY_MUC_CODE_KICKED_SHUTDOWN = 1 << 18,
    } WockyMucStatusCode;
    

    MUC status codes, as defined by XEP-0045 §15.6.

    WOCKY_MUC_CODE_UNKNOWN

    Unknown code

    WOCKY_MUC_CODE_ONYMOUS

    Room entered is not anonymous

    WOCKY_MUC_CODE_AF_CHANGE_OOB

    Affiliation changed when not present

    WOCKY_MUC_CODE_CFG_SHOW_UNAVAILABLE

    Unavailable members visible

    WOCKY_MUC_CODE_CFG_HIDE_UNAVAILABLE

    Unavailable members invisible

    WOCKY_MUC_CODE_CFG_NONPRIVACY

    Non-privacy config change

    WOCKY_MUC_CODE_OWN_PRESENCE

    User's own presence

    WOCKY_MUC_CODE_CFG_LOGGING_ENABLED

    Logging enabled

    WOCKY_MUC_CODE_CFG_LOGGING_DISABLED

    Logging disabled

    WOCKY_MUC_CODE_CFG_ONYMOUS

    Room is now non-anonymous

    WOCKY_MUC_CODE_CFG_SEMIONYMOUS

    Room is now semi-anonymous

    WOCKY_MUC_CODE_CFG_ANONYMOUS

    Room is now fully-anonymous

    WOCKY_MUC_CODE_NEW_ROOM

    Room created (eg by joining)

    WOCKY_MUC_CODE_NICK_CHANGE_FORCED

    Service enforced nick change

    WOCKY_MUC_CODE_BANNED

    User has been banned

    WOCKY_MUC_CODE_NICK_CHANGE_USER

    User's nick changed

    WOCKY_MUC_CODE_KICKED

    Kicked from the room

    WOCKY_MUC_CODE_KICKED_AFFILIATION

    Kicked (affiliation change)

    WOCKY_MUC_CODE_KICKED_ROOM_PRIVATISED

    Kicked (room is now members-only)

    WOCKY_MUC_CODE_KICKED_SHUTDOWN

    Kicked (shutdown)

    wocky_muc_affiliation ()

    WockyMucAffiliation wocky_muc_affiliation               (WockyMuc *muc);

    wocky_muc_create_presence ()

    WockyStanza *       wocky_muc_create_presence           (WockyMuc *muc,
                                                             WockyStanzaSubType type,
                                                             const gchar *status);

    wocky_muc_disco_info_async ()

    void                wocky_muc_disco_info_async          (WockyMuc *muc,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancel,
                                                             gpointer data);

    wocky_muc_disco_info_finish ()

    gboolean            wocky_muc_disco_info_finish         (WockyMuc *muc,
                                                             GAsyncResult *res,
                                                             GError **error);

    wocky_muc_get_state ()

    WockyMucState       wocky_muc_get_state                 (WockyMuc *muc);

    wocky_muc_initiate_async ()

    void                wocky_muc_initiate_async            (WockyMuc *muc,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancel,
                                                             gpointer data);

    wocky_muc_initiate_finish ()

    gboolean            wocky_muc_initiate_finish           (GObject *source,
                                                             GAsyncResult *res,
                                                             GError **error);

    wocky_muc_jid ()

    const gchar *       wocky_muc_jid                       (WockyMuc *muc);

    wocky_muc_join ()

    void                wocky_muc_join                      (WockyMuc *muc,
                                                             GCancellable *cancel);

    wocky_muc_members ()

    GHashTable *        wocky_muc_members                   (WockyMuc *muc);

    wocky_muc_role ()

    WockyMucRole        wocky_muc_role                      (WockyMuc *muc);

    wocky_muc_user ()

    const gchar *       wocky_muc_user                      (WockyMuc *muc);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/ch01.html0000644000175000017500000002366212051456453024332 0ustar00wjtwjt00000000000000 API Reference

    API Reference

    WockyAuthHandler
    wocky-auth-registry-enumtypes
    WockyAuthRegistry
    WockyBareContact — Wrapper around a roster item.
    WockyC2SPorter — Wrapper around a WockyXmppConnection providing a higher level API.
    WockyCapsCache
    wocky-connector-enumtypes
    WockyCapsHash — Utilities for computing verification string hash
    WockyConnector — Low-level XMPP connection generator.
    WockyContactFactory — creates and looks up WockyContact objects
    WockyContact
    wocky-data-form-enumtypes
    WockyDataForm — An object to represent an XMPP data form
    wocky-debug
    wocky
    wocky-heartbeat-source
    wocky-http-proxy
    WockyDiscoIdentity — Structure holding XMPP disco identity information.
    WockyJabberAuth
    wocky-jabber-auth-digest
    wocky-jabber-auth-password
    WockyMetaPorter
    wocky-muc-enumtypes
    WockyMuc
    wocky-namespaces
    WockyNode — representation of a XMPP node
    WockyNodeTree
    WockyPepService — Object to represent a single PEP service
    WockyPing — support for pings/keepalives
    WockyPorter
    wocky-pubsub-helpers
    wocky-pubsub-node-enumtypes
    WockyPubsubNode
    wocky-pubsub-node-protected
    wocky-pubsub-service-enumtypes
    WockyPubsubService
    wocky-pubsub-service-protected
    WockyResourceContact
    WockyRoster — TODO
    WockySaslAuth
    wocky-sasl-digest-md5
    wocky-sasl-utils
    wocky-sasl-plain
    wocky-sasl-scram
    WockySession
    WockyStanza
    WockyTLSConnector
    wocky-tls-enumtypes
    Wocky OpenSSL TLS — Establish TLS sessions
    WockyTLSHandler
    wocky-utils
    WockyXmppConnection — Low-level XMPP connection.
    wocky-xmpp-error-enumtypes
    wocky-xmpp-error
    wocky-xmpp-reader-enumtypes
    WockyXmppReader — Xmpp XML to stanza deserializer
    WockyXmppWriter — Xmpp stanza to XML serializer
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-service-enumtypes.html0000644000175000017500000000505412051456453033043 0ustar00wjtwjt00000000000000 wocky-pubsub-service-enumtypes

    wocky-pubsub-service-enumtypes

    wocky-pubsub-service-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-xmpp-reader-enumtypes.html0000644000175000017500000000474412051456453032336 0ustar00wjtwjt00000000000000 wocky-xmpp-reader-enumtypes

    wocky-xmpp-reader-enumtypes

    wocky-xmpp-reader-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/right.png0000644000175000017500000000073012051456453024523 0ustar00wjtwjt00000000000000PNG  IHDRw=bKGD pHYs  ~tIME2 I%=eIDATx!o@.'**M0$$?1~vIeEuLl&4䝠Bݛ|>$ݶoc wocky-utils

    wocky-utils

    wocky-utils

    Synopsis

    gchar *             wocky_absolutize_path               (const gchar *path);
    gchar *             wocky_compose_jid                   (const gchar *node,
                                                             const gchar *domain,
                                                             const gchar *resource);
    gboolean            wocky_decode_jid                    (const gchar *jid,
                                                             gchar **node,
                                                             gchar **domain,
                                                             gchar **resource);
    gboolean            wocky_enum_from_nick                (GType enum_type,
                                                             const gchar *nick,
                                                             gint *value);
    const gchar *       wocky_enum_to_nick                  (GType enum_type,
                                                             gint value);
    GString *           wocky_g_string_dup                  (const GString *str);
    void                wocky_g_string_free                 (GString *str);
    GValue *            wocky_g_value_slice_dup             (const GValue *value);
    void                wocky_g_value_slice_free            (GValue *value);
    GValue *            wocky_g_value_slice_new             (GType type);
    GValue *            wocky_g_value_slice_new_boolean     (gboolean b);
    GValue *            wocky_g_value_slice_new_boxed       (GType type,
                                                             gconstpointer p);
    GValue *            wocky_g_value_slice_new_double      (double d);
    GValue *            wocky_g_value_slice_new_int         (gint n);
    GValue *            wocky_g_value_slice_new_int64       (gint64 n);
    GValue *            wocky_g_value_slice_new_static_boxed
                                                            (GType type,
                                                             gconstpointer p);
    GValue *            wocky_g_value_slice_new_static_string
                                                            (const gchar *string);
    GValue *            wocky_g_value_slice_new_string      (const gchar *string);
    GValue *            wocky_g_value_slice_new_take_boxed  (GType type,
                                                             gpointer p);
    GValue *            wocky_g_value_slice_new_take_string (gchar *string);
    GValue *            wocky_g_value_slice_new_uint        (guint n);
    GValue *            wocky_g_value_slice_new_uint64      (guint64 n);
    #define             wocky_implement_finish_copy_pointer (source,
                                                             tag,
                                                             copy_func,
                                                             out_param)
    #define             wocky_implement_finish_return_copy_pointer(source,
                                                             tag,
                                                             copy_func)
    #define             wocky_implement_finish_return_pointer(source,
                                                             tag)
    #define             wocky_implement_finish_void         (source,
                                                             tag)
    GList *             wocky_list_deep_copy                (GBoxedCopyFunc copy,
                                                             const GList *items);
    gchar *             wocky_normalise_jid                 (const gchar *jid);
    gboolean            wocky_strdiff                       (const gchar *left,
                                                             const gchar *right);
    

    Description

    Details

    wocky_absolutize_path ()

    gchar *             wocky_absolutize_path               (const gchar *path);

    Return an absolute form of path. This cleans up duplicate slashes, "." or ".." path segments, etc., and prepends g_get_current_dir() if necessary, but does not necessarily resolve symlinks.

    path :

    an absolute or relative path

    Returns :

    an absolute path which must be freed with g_free(), or possibly NULL for invalid filenames

    wocky_compose_jid ()

    gchar *             wocky_compose_jid                   (const gchar *node,
                                                             const gchar *domain,
                                                             const gchar *resource);

    Composes a JID from its parts. If node is empty or NULL, the '@' separator is also omitted; if resource is empty or NULL, the '/' separator is also omitted.

    node :

    the node part of a JID, possibly empty or NULL

    domain :

    the non-NULL domain part of a JID

    resource :

    the resource part of a JID, possibly empty or NULL

    Returns :

    a JID constructed from node, domain and resource

    wocky_decode_jid ()

    gboolean            wocky_decode_jid                    (const gchar *jid,
                                                             gchar **node,
                                                             gchar **domain,
                                                             gchar **resource);

    If the JID is valid, returns TRUE and sets the caller's node/domain/resource pointers if they are not NULL. The node and resource pointers will be set to NULL if the respective part is not present in the JID. The node and domain are lower-cased because the Jabber protocol treats them case-insensitively.

    XXX: Do nodeprep/resourceprep and length checking.

    See RFC 3920 §3.

    jid :

    a JID

    node :

    address to which return the username/room part of the JID

    domain :

    address to which return the server/service part of the JID

    resource :

    address to which return the resource/nick part of the JID

    Returns :

    TRUE if the JID is valid

    wocky_enum_from_nick ()

    gboolean            wocky_enum_from_nick                (GType enum_type,
                                                             const gchar *nick,
                                                             gint *value);

    enum_type :

    the GType of a subtype of GEnum

    nick :

    a non-NULL string purporting to be the nickname of a value of enum_type

    value :

    the address at which to store the value of enum_type corresponding to nick if this functions returns TRUE; if this function returns FALSE, this variable will be left untouched.

    Returns :

    TRUE if nick is a member of enum_type, or FALSE otherwise

    wocky_enum_to_nick ()

    const gchar *       wocky_enum_to_nick                  (GType enum_type,
                                                             gint value);

    enum_type :

    the GType of a subtype of GEnum

    value :

    a value of enum_type

    Returns :

    the nickname of value, or NULL if it is not, in fact, a value of enum_type

    wocky_g_string_dup ()

    GString *           wocky_g_string_dup                  (const GString *str);

    wocky_g_string_free ()

    void                wocky_g_string_free                 (GString *str);

    wocky_g_value_slice_dup ()

    GValue *            wocky_g_value_slice_dup             (const GValue *value);

    value :

    A GValue

    Returns :

    a newly allocated copy of value, to be freed with wocky_g_value_slice_free() or g_slice_free().

    Since 0.5.14


    wocky_g_value_slice_free ()

    void                wocky_g_value_slice_free            (GValue *value);

    Unset and free a slice-allocated GValue.

    (GDestroyNotify) wocky_g_value_slice_free can be used as a destructor for values in a GHashTable, for example.

    value :

    A GValue which was allocated with the g_slice API

    wocky_g_value_slice_new ()

    GValue *            wocky_g_value_slice_new             (GType type);

    Slice-allocate an empty GValue. wocky_g_value_slice_new_boolean() and similar functions are likely to be more convenient to use for the types supported.

    type :

    The type desired for the new GValue

    Returns :

    a newly allocated, newly initialized GValue, to be freed with wocky_g_value_slice_free() or g_slice_free().

    Since 0.5.14


    wocky_g_value_slice_new_boolean ()

    GValue *            wocky_g_value_slice_new_boolean     (gboolean b);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    b :

    a boolean value

    Returns :

    a GValue of type G_TYPE_BOOLEAN with value b, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_boxed ()

    GValue *            wocky_g_value_slice_new_boxed       (GType type,
                                                             gconstpointer p);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    type :

    a boxed type

    p :

    a pointer of type type, which will be copied

    Returns :

    a GValue of type type whose value is a copy of p, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_double ()

    GValue *            wocky_g_value_slice_new_double      (double d);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    d :

    a number

    Returns :

    a GValue of type G_TYPE_DOUBLE with value n, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_int ()

    GValue *            wocky_g_value_slice_new_int         (gint n);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    n :

    an integer

    Returns :

    a GValue of type G_TYPE_INT with value n, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_int64 ()

    GValue *            wocky_g_value_slice_new_int64       (gint64 n);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    n :

    a 64-bit integer

    Returns :

    a GValue of type G_TYPE_INT64 with value n, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_static_boxed ()

    GValue *            wocky_g_value_slice_new_static_boxed
                                                            (GType type,
                                                             gconstpointer p);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    type :

    a boxed type

    p :

    a pointer of type type, which must remain valid forever

    Returns :

    a GValue of type type whose value is p, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_static_string ()

    GValue *            wocky_g_value_slice_new_static_string
                                                            (const gchar *string);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    string :

    a static string which must remain valid forever, to be pointed to by the value

    Returns :

    a GValue of type G_TYPE_STRING whose value is string, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_string ()

    GValue *            wocky_g_value_slice_new_string      (const gchar *string);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    string :

    a string to be copied into the value

    Returns :

    a GValue of type G_TYPE_STRING whose value is a copy of string, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_take_boxed ()

    GValue *            wocky_g_value_slice_new_take_boxed  (GType type,
                                                             gpointer p);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    type :

    a boxed type

    p :

    a pointer of type type which will be freed with g_boxed_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

    Returns :

    a GValue of type type whose value is p, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_take_string ()

    GValue *            wocky_g_value_slice_new_take_string (gchar *string);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    string :

    a string which will be freed with g_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

    Returns :

    a GValue of type G_TYPE_STRING whose value is string, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_uint ()

    GValue *            wocky_g_value_slice_new_uint        (guint n);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    n :

    an unsigned integer

    Returns :

    a GValue of type G_TYPE_UINT with value n, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_g_value_slice_new_uint64 ()

    GValue *            wocky_g_value_slice_new_uint64      (guint64 n);

    Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

    n :

    a 64-bit unsigned integer

    Returns :

    a GValue of type G_TYPE_UINT64 with value n, to be freed with wocky_g_value_slice_free() or g_slice_free()

    Since 0.7.27


    wocky_implement_finish_copy_pointer()

    #define             wocky_implement_finish_copy_pointer(source, tag, copy_func, \
                    out_param)

    wocky_implement_finish_return_copy_pointer()

    #define             wocky_implement_finish_return_copy_pointer(source, tag, \
                    copy_func)

    wocky_implement_finish_return_pointer()

    #define             wocky_implement_finish_return_pointer(source, tag)

    wocky_implement_finish_void()

    #define             wocky_implement_finish_void(source, tag)

    wocky_list_deep_copy ()

    GList *             wocky_list_deep_copy                (GBoxedCopyFunc copy,
                                                             const GList *items);

    wocky_normalise_jid ()

    gchar *             wocky_normalise_jid                 (const gchar *jid);

    jid :

    a JID

    Returns :

    a normalised JID, using the same rules as wocky_decode_jid(), or NULL if the JID could not be sensibly decoded. This value should be freed when you are done with it.

    wocky_strdiff ()

    gboolean            wocky_strdiff                       (const gchar *left,
                                                             const gchar *right);

    Return TRUE if the given strings are different. Unlike strcmp this function will handle null pointers, treating them as distinct from any string.

    left :

    The first string to compare (may be NULL)

    right :

    The second string to compare (may be NULL)

    Returns :

    FALSE if left and right are both NULL, or if neither is NULL and both have the same contents; TRUE otherwise
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-jabber-auth-digest.html0000644000175000017500000000734012051456453031517 0ustar00wjtwjt00000000000000 wocky-jabber-auth-digest

    wocky-jabber-auth-digest

    wocky-jabber-auth-digest

    Synopsis

    WockyJabberAuthDigest * wocky_jabber_auth_digest_new    (const gchar *server,
                                                             const gchar *password);
    

    Description

    Details

    wocky_jabber_auth_digest_new ()

    WockyJabberAuthDigest * wocky_jabber_auth_digest_new    (const gchar *server,
                                                             const gchar *password);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyCapsCache.html0000644000175000017500000003457412051456453026432 0ustar00wjtwjt00000000000000 WockyCapsCache

    WockyCapsCache

    WockyCapsCache

    Object Hierarchy

      GObject
       +----WockyCapsCache
    

    Properties

      "path"                     gchar*                : Read / Write / Construct Only
    

    Description

    Details

    struct WockyCapsCache

    struct WockyCapsCache;

    An object providing a permanent cache for capabilities.


    struct WockyCapsCacheClass

    struct WockyCapsCacheClass {
    };
    

    The class of a WockyCapsCache.


    wocky_caps_cache_dup_shared ()

    WockyCapsCache *    wocky_caps_cache_dup_shared         (void);

    Returns a new or existing WockyCapsCache object.

    The returned WockyCapsCache is cached; the same WockyCapsCache object will be returned by this function repeatedly in the same process. At the end of the process, the caller should call wocky_caps_cache_free_shared() to shared the shared WockyCapsCache object.

    Returns :

    a new, or cached, WockyCapsCache.

    wocky_caps_cache_free_shared ()

    void                wocky_caps_cache_free_shared        (void);

    Free the shared WockyCapsCache instance which was created by calling wocky_caps_cache_dup_shared(), or do nothing if said function was not called.


    wocky_caps_cache_insert ()

    void                wocky_caps_cache_insert             (WockyCapsCache *self,
                                                             const gchar *node,
                                                             WockyNodeTree *query_node);

    Adds a new item to the caps cache. node is associated with query_node so that subsequent calls to wocky_caps_cache_lookup() with the same node value will return query_node.

    self :

    a WockyCapsCache

    node :

    the capability node

    query_node :

    the query WockyNodeTree associated with node

    wocky_caps_cache_lookup ()

    WockyNodeTree *     wocky_caps_cache_lookup             (WockyCapsCache *self,
                                                             const gchar *node);

    Look up node in the caps cache self. The caller is responsible for unreffing the returned WockyNodeTree.

    self :

    a WockyCapsCache

    node :

    the node to look up in the cache

    Returns :

    a WockyNodeTree if node was found in the cache, or NULL if a match was not found

    wocky_caps_cache_new ()

    WockyCapsCache *    wocky_caps_cache_new                (const gchar *path);

    Convenience function to create a new WockyCapsCache.

    path :

    full path to where the cache SQLite database should be stored

    Returns :

    a new WockyCapsCache.

    Property Details

    The "path" property

      "path"                     gchar*                : Read / Write / Construct Only

    The path on disk to the SQLite database where this WockyCapsCache stores its information.

    Default value: NULL

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyAuthRegistry.html0000644000175000017500000021465012051456453027245 0ustar00wjtwjt00000000000000 WockyAuthRegistry

    WockyAuthRegistry

    WockyAuthRegistry

    Synopsis

    #define             WOCKY_AUTH_ERROR
    #define             WOCKY_AUTH_MECH_JABBER_DIGEST
    #define             WOCKY_AUTH_MECH_JABBER_PASSWORD
    #define             WOCKY_AUTH_MECH_SASL_DIGEST_MD5
    #define             WOCKY_AUTH_MECH_SASL_PLAIN
    #define             WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1
    enum                WockyAuthError;
    struct              WockyAuthRegistry;
    void                (*WockyAuthRegistryChallengeAsyncFunc)
                                                            (WockyAuthRegistry *self,
                                                             const GString *challenge_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            (*WockyAuthRegistryChallengeFinishFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             GString **response,
                                                             GError **error);
    struct              WockyAuthRegistryClass;
    void                (*WockyAuthRegistryFailureFunc)     (WockyAuthRegistry *self,
                                                             GError *error);
    void                (*WockyAuthRegistryStartAuthAsyncFunc)
                                                            (WockyAuthRegistry *self,
                                                             const GSList *mechanisms,
                                                             gboolean allow_plain,
                                                             gboolean is_secure_channel,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             const gchar *server,
                                                             const gchar *session_id,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            (*WockyAuthRegistryStartAuthFinishFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             WockyAuthRegistryStartData **start_data,
                                                             GError **error);
                        WockyAuthRegistryStartData;
    void                (*WockyAuthRegistrySuccessAsyncFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            (*WockyAuthRegistrySuccessFinishFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    GQuark              wocky_auth_error_quark              (void);
    void                wocky_auth_registry_add_handler     (WockyAuthRegistry *self,
                                                             WockyAuthHandler *handler);
    void                wocky_auth_registry_challenge_async (WockyAuthRegistry *self,
                                                             const GString *challenge_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_auth_registry_challenge_finish
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *res,
                                                             GString **response,
                                                             GError **error);
    void                wocky_auth_registry_failure         (WockyAuthRegistry *self,
                                                             GError *error);
    WockyAuthRegistry * wocky_auth_registry_new             (void);
    void                wocky_auth_registry_start_auth_async
                                                            (WockyAuthRegistry *self,
                                                             const GSList *mechanisms,
                                                             gboolean allow_plain,
                                                             gboolean is_secure_channel,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             const gchar *server,
                                                             const gchar *session_id,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_auth_registry_start_auth_finish
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             WockyAuthRegistryStartData **start_data,
                                                             GError **error);
    WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup
                                                            (WockyAuthRegistryStartData *start_data);
    void                wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data);
    WockyAuthRegistryStartData * wocky_auth_registry_start_data_new
                                                            (const gchar *mechanism,
                                                             const GString *initial_response);
    void                wocky_auth_registry_success_async   (WockyAuthRegistry *self,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_auth_registry_success_finish  (WockyAuthRegistry *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    gboolean            wocky_auth_registry_supports_one_of (WockyAuthRegistry *self,
                                                             const GSList *mechanisms,
                                                             gboolean allow_plain);
    

    Object Hierarchy

      GEnum
       +----WockyAuthError
    
      GObject
       +----WockyAuthRegistry
    

    Description

    Details

    WOCKY_AUTH_ERROR

    #define             WOCKY_AUTH_ERROR

    WOCKY_AUTH_MECH_JABBER_DIGEST

    #define WOCKY_AUTH_MECH_JABBER_DIGEST "X-WOCKY-JABBER-DIGEST"
    

    WOCKY_AUTH_MECH_JABBER_PASSWORD

    #define WOCKY_AUTH_MECH_JABBER_PASSWORD "X-WOCKY-JABBER-PASSWORD"
    

    WOCKY_AUTH_MECH_SASL_DIGEST_MD5

    #define WOCKY_AUTH_MECH_SASL_DIGEST_MD5 "DIGEST-MD5"
    

    WOCKY_AUTH_MECH_SASL_PLAIN

    #define WOCKY_AUTH_MECH_SASL_PLAIN "PLAIN"
    

    WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1

    #define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1 "SCRAM-SHA-1"
    

    enum WockyAuthError

    typedef enum {
      WOCKY_AUTH_ERROR_INIT_FAILED,
      WOCKY_AUTH_ERROR_NOT_SUPPORTED,
      WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS,
      WOCKY_AUTH_ERROR_NETWORK,
      WOCKY_AUTH_ERROR_INVALID_REPLY,
      WOCKY_AUTH_ERROR_NO_CREDENTIALS,
      WOCKY_AUTH_ERROR_FAILURE,
      WOCKY_AUTH_ERROR_CONNRESET,
      WOCKY_AUTH_ERROR_STREAM,
      WOCKY_AUTH_ERROR_RESOURCE_CONFLICT,
      WOCKY_AUTH_ERROR_NOT_AUTHORIZED,
    } WockyAuthError;
    

    WockyAuthRegistry specific errors.

    WOCKY_AUTH_ERROR_INIT_FAILED

    Failed to initialize our auth support

    WOCKY_AUTH_ERROR_NOT_SUPPORTED

    Server doesn't support this authentication method

    WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS

    Server doesn't support any mechanisms that we support

    WOCKY_AUTH_ERROR_NETWORK

    Couldn't send our stanzas to the server

    WOCKY_AUTH_ERROR_INVALID_REPLY

    Server sent an invalid reply

    WOCKY_AUTH_ERROR_NO_CREDENTIALS

    Failure to provide user credentials

    WOCKY_AUTH_ERROR_FAILURE

    Server sent a failure

    WOCKY_AUTH_ERROR_CONNRESET

    disconnected

    WOCKY_AUTH_ERROR_STREAM

    XMPP stream error while authing

    WOCKY_AUTH_ERROR_RESOURCE_CONFLICT

    Resource conflict (relevant in in jabber auth)

    WOCKY_AUTH_ERROR_NOT_AUTHORIZED

    Provided credentials are not valid

    struct WockyAuthRegistry

    struct WockyAuthRegistry;

    WockyAuthRegistryChallengeAsyncFunc ()

    void                (*WockyAuthRegistryChallengeAsyncFunc)
                                                            (WockyAuthRegistry *self,
                                                             const GString *challenge_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Recieves a challenge and asynchronously provides a reply. By default the challenge is passed on to the chosen WockyAuthHandler.

    self :

    a WockyAuthRegistry object

    challenge_data :

    the challenge data string

    callback :

    a callback to call when finished

    user_data :

    data to pass to callback

    WockyAuthRegistryChallengeFinishFunc ()

    gboolean            (*WockyAuthRegistryChallengeFinishFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             GString **response,
                                                             GError **error);

    Finishes a GAsyncResult from WockyAuthRegistryChallengeAsyncFunc. By default it extracts a GString response from the given GSimpleAsyncResult and copies it to the out param.

    self :

    a WockyAuthRegistry object

    result :

    a GAsyncResult object

    response :

    a location to be filled with the response string

    error :

    a location to fill with a GError if an error is hit, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    struct WockyAuthRegistryClass

    struct WockyAuthRegistryClass {
      WockyAuthRegistryStartAuthAsyncFunc start_auth_async_func;
      WockyAuthRegistryStartAuthFinishFunc start_auth_finish_func;
    
      WockyAuthRegistryChallengeAsyncFunc challenge_async_func;
      WockyAuthRegistryChallengeFinishFunc challenge_finish_func;
    
      WockyAuthRegistrySuccessAsyncFunc success_async_func;
      WockyAuthRegistrySuccessFinishFunc success_finish_func;
    
      WockyAuthRegistryFailureFunc failure_func;
    };
    

    The class of a WockyAuthRegistry.

    WockyAuthRegistryStartAuthAsyncFunc start_auth_async_func;

    a function to call to start an asynchronous start auth operation; see wocky_auth_registry_start_auth_async() for more details.

    WockyAuthRegistryStartAuthFinishFunc start_auth_finish_func;

    a function to call to finish an asynchronous start auth operation; see wocky_auth_registry_start_auth_finish() for more details.

    WockyAuthRegistryChallengeAsyncFunc challenge_async_func;

    a function to call to start an asynchronous challenge operation; see wocky_auth_registry_challenge_async() for more details.

    WockyAuthRegistryChallengeFinishFunc challenge_finish_func;

    a function to call to finish an asynchronous challenge operation; see wocky_auth_registry_challenge_finish() for more details.

    WockyAuthRegistrySuccessAsyncFunc success_async_func;

    a function to call to start an asynchronous success operation; see wocky_auth_registry_success_async() for more details.

    WockyAuthRegistrySuccessFinishFunc success_finish_func;

    a function to call to finish an asynchronous success operation; see wocky_auth_registry_success_finish() for more details.

    WockyAuthRegistryFailureFunc failure_func;

    a function to call on failure; see wocky_auth_registry_failure() for more details.

    WockyAuthRegistryFailureFunc ()

    void                (*WockyAuthRegistryFailureFunc)     (WockyAuthRegistry *self,
                                                             GError *error);

    Notifies the client of a server-side error. By default this is not implemented.

    self :

    a WockyAuthRegistry object

    error :

    a GError describing the failure

    WockyAuthRegistryStartAuthAsyncFunc ()

    void                (*WockyAuthRegistryStartAuthAsyncFunc)
                                                            (WockyAuthRegistry *self,
                                                             const GSList *mechanisms,
                                                             gboolean allow_plain,
                                                             gboolean is_secure_channel,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             const gchar *server,
                                                             const gchar *session_id,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Starts a async authentication: chooses mechanism and gets initial data. The default function chooses a WockyAuthHandler by which mechanism it supports and gets the initial data from the chosen handler.

    self :

    a WockyAuthRegistry object

    mechanisms :

    a list of avahilable mechanisms

    allow_plain :

    TRUE if PLAIN is allowed, otherwise FALSE

    is_secure_channel :

    TRUE if channel is secure, otherwise FALSE

    username :

    the username

    password :

    the password

    server :

    the server

    session_id :

    the session ID

    callback :

    a callback to be called when finished

    user_data :

    data to pass to callback

    WockyAuthRegistryStartAuthFinishFunc ()

    gboolean            (*WockyAuthRegistryStartAuthFinishFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             WockyAuthRegistryStartData **start_data,
                                                             GError **error);

    Called to finish the GAsyncResult task for authentication start. By default, it extracts a WockyAuthRegistryStartData pointer from a given GSimpleAsyncResult and copies it to the out param.

    self :

    a WockyAuthRegistry object

    result :

    a GAsyncResult object

    start_data :

    a location to fill with a WockyAuthRegistryStartData structure

    error :

    a location to fill with a GError if an error is hit, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    WockyAuthRegistryStartData

    typedef struct {
      gchar *mechanism;
      GString *initial_response;
    } WockyAuthRegistryStartData;
    

    A structure to hold the mechanism and response data.

    gchar *mechanism;

    the name of the mechanism

    GString *initial_response;

    the data in the response

    WockyAuthRegistrySuccessAsyncFunc ()

    void                (*WockyAuthRegistrySuccessAsyncFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Notifies the registry of authentication success, and allows a last ditch attempt at aborting the authentication at the client's discretion.

    self :

    a WockyAuthRegistry object

    callback :

    a callback to be called when finished

    user_data :

    data to pass to callback

    WockyAuthRegistrySuccessFinishFunc ()

    gboolean            (*WockyAuthRegistrySuccessFinishFunc)
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes a GAsyncResult from WockyAuthRegistrySuccessAsyncFunc. It checks for any errors set on the given GSimpleAsyncResult, copies the GError to an out param and returns FALSE if there was an error.

    self :

    a WockyAuthRegistry object

    result :

    a GAsyncResult object

    error :

    a location to fill with a GError if an error is hit, or NULL

    Returns :

    TRUE on success, otherwise FALSE

    wocky_auth_error_quark ()

    GQuark              wocky_auth_error_quark              (void);

    wocky_auth_registry_add_handler ()

    void                wocky_auth_registry_add_handler     (WockyAuthRegistry *self,
                                                             WockyAuthHandler *handler);

    wocky_auth_registry_challenge_async ()

    void                wocky_auth_registry_challenge_async (WockyAuthRegistry *self,
                                                             const GString *challenge_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_auth_registry_challenge_finish ()

    gboolean            wocky_auth_registry_challenge_finish
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *res,
                                                             GString **response,
                                                             GError **error);

    wocky_auth_registry_failure ()

    void                wocky_auth_registry_failure         (WockyAuthRegistry *self,
                                                             GError *error);

    wocky_auth_registry_new ()

    WockyAuthRegistry * wocky_auth_registry_new             (void);

    wocky_auth_registry_start_auth_async ()

    void                wocky_auth_registry_start_auth_async
                                                            (WockyAuthRegistry *self,
                                                             const GSList *mechanisms,
                                                             gboolean allow_plain,
                                                             gboolean is_secure_channel,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             const gchar *server,
                                                             const gchar *session_id,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_auth_registry_start_auth_finish ()

    gboolean            wocky_auth_registry_start_auth_finish
                                                            (WockyAuthRegistry *self,
                                                             GAsyncResult *result,
                                                             WockyAuthRegistryStartData **start_data,
                                                             GError **error);

    wocky_auth_registry_start_data_dup ()

    WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup
                                                            (WockyAuthRegistryStartData *start_data);

    wocky_auth_registry_start_data_free ()

    void                wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data);

    wocky_auth_registry_start_data_new ()

    WockyAuthRegistryStartData * wocky_auth_registry_start_data_new
                                                            (const gchar *mechanism,
                                                             const GString *initial_response);

    wocky_auth_registry_success_async ()

    void                wocky_auth_registry_success_async   (WockyAuthRegistry *self,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_auth_registry_success_finish ()

    gboolean            wocky_auth_registry_success_finish  (WockyAuthRegistry *self,
                                                             GAsyncResult *res,
                                                             GError **error);

    wocky_auth_registry_supports_one_of ()

    gboolean            wocky_auth_registry_supports_one_of (WockyAuthRegistry *self,
                                                             const GSList *mechanisms,
                                                             gboolean allow_plain);

    Checks whether at least one of mechanisms is supported by Wocky. At present, Wocky itself only implements password-based authentication mechanisms.

    self :

    a WockyAuthRegistry

    allow_plain :

    Whether auth in plain text is allowed

    mechanisms :

    a GSList of gchar* of auth mechanisms

    Returns :

    TRUE if one of the mechanisms is supported by wocky, FALSE otherwise.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyXmppConnection.html0000644000175000017500000016254212051456453030713 0ustar00wjtwjt00000000000000 WockyXmppConnection

    WockyXmppConnection

    WockyXmppConnection — Low-level XMPP connection.

    Synopsis

    #define             WOCKY_XMPP_CONNECTION_ERROR
    struct              WockyXmppConnectionClass;
    enum                WockyXmppConnectionError;
    GQuark              wocky_xmpp_connection_error_quark   (void);
    void                wocky_xmpp_connection_force_close_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_xmpp_connection_force_close_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);
    WockyXmppConnection * wocky_xmpp_connection_new         (GIOStream *stream);
    gchar *             wocky_xmpp_connection_new_id        (WockyXmppConnection *self);
    void                wocky_xmpp_connection_recv_open_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_xmpp_connection_recv_open_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             gchar **to,
                                                             gchar **from,
                                                             gchar **version,
                                                             gchar **lang,
                                                             gchar **id,
                                                             GError **error);
    void                wocky_xmpp_connection_recv_stanza_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyStanza *       wocky_xmpp_connection_recv_stanza_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_xmpp_connection_reset         (WockyXmppConnection *connection);
    void                wocky_xmpp_connection_send_close_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_xmpp_connection_send_close_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_xmpp_connection_send_open_async
                                                            (WockyXmppConnection *connection,
                                                             const gchar *to,
                                                             const gchar *from,
                                                             const gchar *version,
                                                             const gchar *lang,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_xmpp_connection_send_open_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_xmpp_connection_send_stanza_async
                                                            (WockyXmppConnection *connection,
                                                             WockyStanza *stanza,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_xmpp_connection_send_stanza_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_xmpp_connection_send_whitespace_ping_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_xmpp_connection_send_whitespace_ping_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);
    

    Description

    Sends and receives WockyStanzas from an underlying GIOStream.

    Details

    WOCKY_XMPP_CONNECTION_ERROR

    #define WOCKY_XMPP_CONNECTION_ERROR (wocky_xmpp_connection_error_quark ())
    

    Get access to the error quark of the xmpp connection.


    struct WockyXmppConnectionClass

    struct WockyXmppConnectionClass {
    };
    

    The class of a WockyXmppConnection.


    enum WockyXmppConnectionError

    typedef enum {
      WOCKY_XMPP_CONNECTION_ERROR_EOS,
      WOCKY_XMPP_CONNECTION_ERROR_CLOSED,
      WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN,
      WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED,
      WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN,
    } WockyXmppConnectionError;
    

    The WockyXmppConnection specific errors that can occur while reading a stream.

    WOCKY_XMPP_CONNECTION_ERROR_EOS

    Connection got closed before receiving an XMPP stream close.

    WOCKY_XMPP_CONNECTION_ERROR_CLOSED

    Other side closed the xmpp stream.

    WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN

    Trying to send or receive while the connection isn't open.

    WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED

    Trying to send or receive while the connection is closed.

    WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN

    Trying to send or receive the connection opening when it's already open

    wocky_xmpp_connection_error_quark ()

    GQuark              wocky_xmpp_connection_error_quark   (void);

    Get the error quark used by the connection.

    Returns :

    the quark for connection errors.

    wocky_xmpp_connection_force_close_async ()

    void                wocky_xmpp_connection_force_close_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_xmpp_connection_force_close_finish ()

    gboolean            wocky_xmpp_connection_force_close_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_xmpp_connection_new ()

    WockyXmppConnection * wocky_xmpp_connection_new         (GIOStream *stream);

    Convenience function to create a new WockyXmppConnection.

    stream :

    GIOStream over wich all the data will be sent/received.

    Returns :

    a new WockyXmppConnection.

    wocky_xmpp_connection_new_id ()

    gchar *             wocky_xmpp_connection_new_id        (WockyXmppConnection *self);

    self :

    a WockyXmppConnection.

    Returns :

    A short unique string for usage as the id attribute on a stanza (free after usage).

    wocky_xmpp_connection_recv_open_async ()

    void                wocky_xmpp_connection_recv_open_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous receiving of an XMPP stream opening over the stream. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_recv_open_finish() to get the result of the operation.

    connection :

    a WockyXmppConnection.

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_xmpp_connection_recv_open_finish ()

    gboolean            wocky_xmpp_connection_recv_open_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             gchar **to,
                                                             gchar **from,
                                                             gchar **version,
                                                             gchar **lang,
                                                             gchar **id,
                                                             GError **error);

    Finishes receiving a stream opening.

    connection :

    a WockyXmppConnection.

    result :

    a GAsyncResult.

    to :

    Optional location to store the to attribute in the XMPP open stanza will be stored (free after usage).

    from :

    Optional location to store the from attribute in the XMPP open stanza will be stored (free after usage).

    version :

    Optional location to store the version attribute in the XMPP open stanza will be stored (free after usage).

    lang :

    Optional location to store the lang attribute in the XMPP open stanza will be stored (free after usage).

    id :

    Optional location to store the Session ID of the XMPP stream (free after usage)

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE if the opening was succesfully received, FALSE on error.

    wocky_xmpp_connection_recv_stanza_async ()

    void                wocky_xmpp_connection_recv_stanza_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Asynchronous receive a WockyStanza. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_recv_stanza_finish() to get the result of the operation.

    Can only be called after wocky_xmpp_connection_recv_open_async has finished its operation.

    connection :

    a WockyXmppConnection

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_xmpp_connection_recv_stanza_finish ()

    WockyStanza *       wocky_xmpp_connection_recv_stanza_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes receiving a stanza

    connection :

    a WockyXmppConnection.

    result :

    a GAsyncResult.

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    A WockyStanza or NULL on error (unref after usage)

    wocky_xmpp_connection_reset ()

    void                wocky_xmpp_connection_reset         (WockyXmppConnection *connection);

    Reset the XMPP Connection. After the reset the connection is back in its initial state (as if wocky_xmpp_connection_send_open_async() and wocky_xmpp_connection_recv_open_async() were never called).

    connection :

    a WockyXmppConnection.

    wocky_xmpp_connection_send_close_async ()

    void                wocky_xmpp_connection_send_close_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of an XMPP stream close. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_close_finish() to get the result of the operation.

    Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.

    connection :

    a WockyXmppConnection.

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_xmpp_connection_send_close_finish ()

    gboolean            wocky_xmpp_connection_send_close_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes send the xmpp stream close.

    connection :

    a WockyXmppConnection.

    result :

    a GAsyncResult.

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE on success or FALSE on error.

    wocky_xmpp_connection_send_open_async ()

    void                wocky_xmpp_connection_send_open_async
                                                            (WockyXmppConnection *connection,
                                                             const gchar *to,
                                                             const gchar *from,
                                                             const gchar *version,
                                                             const gchar *lang,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of an XMPP stream opening over the stream. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_open_finish() to get the result of the operation.

    connection :

    a WockyXmppConnection.

    to :

    destination in the XMPP opening (can be NULL).

    from :

    sender in the XMPP opening (can be NULL).

    version :

    XMPP version sent (can be NULL).

    lang :

    language sent (can be NULL).

    id :

    XMPP Stream ID, if any, or NULL

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_xmpp_connection_send_open_finish ()

    gboolean            wocky_xmpp_connection_send_open_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes sending a stream opening.

    connection :

    a WockyXmppConnection.

    result :

    a GAsyncResult.

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE if the opening was succesfully sent, FALSE on error.

    wocky_xmpp_connection_send_stanza_async ()

    void                wocky_xmpp_connection_send_stanza_async
                                                            (WockyXmppConnection *connection,
                                                             WockyStanza *stanza,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of a WockyStanza. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_stanza_finish() to get the result of the operation.

    Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.

    connection :

    a WockyXmppConnection

    stanza :

    WockyStanza to send.

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_xmpp_connection_send_stanza_finish ()

    gboolean            wocky_xmpp_connection_send_stanza_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes sending a stanza.

    connection :

    a WockyXmppConnection.

    result :

    a GAsyncResult.

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE if the stanza was succesfully sent, FALSE on error.

    wocky_xmpp_connection_send_whitespace_ping_async ()

    void                wocky_xmpp_connection_send_whitespace_ping_async
                                                            (WockyXmppConnection *connection,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of a whitespace ping. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_whitespace_ping_finish() to get the result of the operation.

    Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.

    connection :

    a WockyXmppConnection

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_xmpp_connection_send_whitespace_ping_finish ()

    gboolean            wocky_xmpp_connection_send_whitespace_ping_finish
                                                            (WockyXmppConnection *connection,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes sending a whitespace ping.

    connection :

    a WockyXmppConnection.

    result :

    a GAsyncResult.

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE if the ping was succesfully sent, FALSE on error.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyBareContact.html0000644000175000017500000007726112051456453027005 0ustar00wjtwjt00000000000000 WockyBareContact

    WockyBareContact

    WockyBareContact — Wrapper around a roster item.

    Description

    Stores information regarding a roster item and provides a higher level API for altering its details.

    Details

    struct WockyBareContactClass

    struct WockyBareContactClass {
    };
    

    The class of a WockyBareContact.


    wocky_bare_contact_add_group ()

    void                wocky_bare_contact_add_group        (WockyBareContact *contact,
                                                             const gchar *group);

    Adds group to contact's groups.

    contact :

    a WockyBareContact instance

    group :

    a group

    wocky_bare_contact_add_resource ()

    void                wocky_bare_contact_add_resource     (WockyBareContact *contact,
                                                             WockyResourceContact *resource);

    Adds resource to the contact's resources. The WockyBareContact instance doesn't assume a reference to resource.

    contact :

    a WockyBareContact instance

    resource :

    a WockyResourceContact instance

    wocky_bare_contact_copy ()

    WockyBareContact *  wocky_bare_contact_copy             (WockyBareContact *contact);

    Convenience function to obtain a copy of the given WockyBareContact.

    contact :

    a WockyBareContact instance

    Returns :

    a newly created WockyBareContact which is a copy of the given one.

    wocky_bare_contact_debug_print ()

    void                wocky_bare_contact_debug_print      (WockyBareContact *contact);

    Prints debug information for the given WockyBareContact.

    contact :

    a WockyBareContact instance

    wocky_bare_contact_equal ()

    gboolean            wocky_bare_contact_equal            (WockyBareContact *a,
                                                             WockyBareContact *b);

    Compares whether two WockyBareContact instances refer to the same roster item.

    a :

    a WockyBareContact instance

    b :

    a WockyBareContact instance to compare with a

    Returns :

    TRUE if the two contacts match.

    wocky_bare_contact_get_groups ()

    const gchar * const * wocky_bare_contact_get_groups     (WockyBareContact *contact);

    Returns the list of the groups of contact.

    contact :

    a WockyBareContact instance

    Returns :

    a list of contact's groups

    wocky_bare_contact_get_jid ()

    const gchar *       wocky_bare_contact_get_jid          (WockyBareContact *contact);

    Returns the JID of the contact wrapped by contact.

    contact :

    a WockyBareContact instance

    Returns :

    contact's JID.

    wocky_bare_contact_get_name ()

    const gchar *       wocky_bare_contact_get_name         (WockyBareContact *contact);

    Returns the name of the contact wrapped by contact.

    contact :

    WockyBareContact instance

    Returns :

    contact's name

    wocky_bare_contact_get_resources ()

    GSList *            wocky_bare_contact_get_resources    (WockyBareContact *contact);

    Gets a GSList of all the contact's resources. You should call g_slist_free on the list when done with it.

    contact :

    a WockyBareContact instance

    Returns :

    a GSList of WockyResourceContact objects.

    wocky_bare_contact_get_subscription ()

    WockyRosterSubscriptionFlags wocky_bare_contact_get_subscription
                                                            (WockyBareContact *contact);

    Gets the subscription type contact has.

    contact :

    a WockyBareContact instance

    Returns :

    contact's subscription.

    wocky_bare_contact_in_group ()

    gboolean            wocky_bare_contact_in_group         (WockyBareContact *contact,
                                                             const gchar *group);

    Determines whether the given contact is in group.

    contact :

    a WockyBareContact instance

    group :

    a group

    Returns :

    TRUE if the contact is in the given group.

    wocky_bare_contact_new ()

    WockyBareContact *  wocky_bare_contact_new              (const gchar *jid);

    Creates a new WockyBareContact for a given JID.

    jid :

    the JID of the contact to create

    Returns :

    a newly constructed WockyBareContact

    wocky_bare_contact_remove_group ()

    void                wocky_bare_contact_remove_group     (WockyBareContact *contact,
                                                             const gchar *group);

    Removes group from the contact's groups.

    contact :

    a WockyBareContact instance

    group :

    a group

    wocky_bare_contact_set_groups ()

    void                wocky_bare_contact_set_groups       (WockyBareContact *contact,
                                                             gchar **groups);

    Sets contact's groups.

    contact :

    a WockyBareContact instance

    groups :

    a list of groups

    wocky_bare_contact_set_name ()

    void                wocky_bare_contact_set_name         (WockyBareContact *contact,
                                                             const gchar *name);

    Sets contact's name to name.

    contact :

    a WockyBareContact instance

    name :

    the name to set contact

    wocky_bare_contact_set_subscription ()

    void                wocky_bare_contact_set_subscription (WockyBareContact *contact,
                                                             WockyRosterSubscriptionFlags subscription);

    Sets the subscription of contact.

    contact :

    a WockyBareContact instance

    subscription :

    the new subscription type
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockySaslAuth.html0000644000175000017500000002571512051456453027473 0ustar00wjtwjt00000000000000 WockySaslAuth

    WockySaslAuth

    WockySaslAuth

    Synopsis

    struct              WockySaslAuthClass;
    void                wocky_sasl_auth_add_handler         (WockySaslAuth *sasl,
                                                             WockyAuthHandler *handler);
    void                wocky_sasl_auth_authenticate_async  (WockySaslAuth *sasl,
                                                             WockyStanza *features,
                                                             gboolean allow_plain,
                                                             gboolean is_secure,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_sasl_auth_authenticate_finish (WockySaslAuth *sasl,
                                                             GAsyncResult *result,
                                                             GError **error);
    WockySaslAuth *     wocky_sasl_auth_new                 (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             WockyXmppConnection *connection,
                                                             WockyAuthRegistry *auth_registry);
    

    Description

    Details

    struct WockySaslAuthClass

    struct WockySaslAuthClass {
    };
    

    The class of a WockySaslAuth.


    wocky_sasl_auth_add_handler ()

    void                wocky_sasl_auth_add_handler         (WockySaslAuth *sasl,
                                                             WockyAuthHandler *handler);

    wocky_sasl_auth_authenticate_async ()

    void                wocky_sasl_auth_authenticate_async  (WockySaslAuth *sasl,
                                                             WockyStanza *features,
                                                             gboolean allow_plain,
                                                             gboolean is_secure,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_sasl_auth_authenticate_finish ()

    gboolean            wocky_sasl_auth_authenticate_finish (WockySaslAuth *sasl,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_sasl_auth_new ()

    WockySaslAuth *     wocky_sasl_auth_new                 (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             WockyXmppConnection *connection,
                                                             WockyAuthRegistry *auth_registry);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-tls-enumtypes.html0000644000175000017500000000463512051456453030713 0ustar00wjtwjt00000000000000 wocky-tls-enumtypes

    wocky-tls-enumtypes

    wocky-tls-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-heartbeat-source.html0000644000175000017500000001740312051456453031314 0ustar00wjtwjt00000000000000 wocky-heartbeat-source

    wocky-heartbeat-source

    wocky-heartbeat-source

    Synopsis

    void                (*WockyHeartbeatCallback)           (gpointer user_data);
    GSource *           wocky_heartbeat_source_new          (guint max_interval);
    void                wocky_heartbeat_source_update_interval
                                                            (GSource *source,
                                                             guint max_interval);
    

    Description

    Details

    WockyHeartbeatCallback ()

    void                (*WockyHeartbeatCallback)           (gpointer user_data);

    wocky_heartbeat_source_new ()

    GSource *           wocky_heartbeat_source_new          (guint max_interval);

    Creates a source which calls its callback at least every max_interval seconds. This is similar to g_timeout_source_new_seconds(), except that the callback may be called slightly earlier than requested, in sync with other periodic network activity (from other XMPP connections, or other applications entirely).

    When calling g_source_set_callback() on this source, the supplied callback's signature should match WockyHeartbeatCallback.

    max_interval :

    the maximum interval between calls to the source's callback, in seconds. Pass 0 to prevent the callback being called.

    Returns :

    the newly-created source.

    wocky_heartbeat_source_update_interval ()

    void                wocky_heartbeat_source_update_interval
                                                            (GSource *source,
                                                             guint max_interval);

    Updates the interval between calls to source's callback. The new interval may not take effect until after the next call to the callback.

    source :

    a source returned by wocky_heartbeat_source_new()

    max_interval :

    the new maximum interval between calls to the source's callback, in seconds. Pass 0 to stop the callback being called.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-xmpp-error.html0000644000175000017500000014175112051456453030176 0ustar00wjtwjt00000000000000 wocky-xmpp-error

    wocky-xmpp-error

    wocky-xmpp-error

    Object Hierarchy

      GEnum
       +----WockyJingleError
    
      GEnum
       +----WockySIError
    
      GEnum
       +----WockyXmppError
    
      GEnum
       +----WockyXmppErrorType
    
      GEnum
       +----WockyXmppStreamError
    

    Description

    Details

    WOCKY_JINGLE_ERROR

    #define WOCKY_JINGLE_ERROR (wocky_jingle_error_quark ())
    

    WOCKY_SI_ERROR

    #define WOCKY_SI_ERROR (wocky_si_error_quark ())
    

    WOCKY_XMPP_ERROR

    #define WOCKY_XMPP_ERROR (wocky_xmpp_error_quark ())
    

    WOCKY_XMPP_STREAM_ERROR

    #define WOCKY_XMPP_STREAM_ERROR (wocky_xmpp_stream_error_quark ())
    

    Get access to the error quark of the xmpp stream errors.


    enum WockyJingleError

    typedef enum {
        WOCKY_JINGLE_ERROR_OUT_OF_ORDER,
        WOCKY_JINGLE_ERROR_TIE_BREAK,
        WOCKY_JINGLE_ERROR_UNKNOWN_SESSION,
        WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO
    } WockyJingleError;
    

    Jingle specific errors.

    WOCKY_JINGLE_ERROR_OUT_OF_ORDER

    the request cannot occur at this point in the state machine

    WOCKY_JINGLE_ERROR_TIE_BREAK

    the request is rejected because it was sent while the initiator was awaiting a reply on a similar request

    WOCKY_JINGLE_ERROR_UNKNOWN_SESSION

    the 'sid' attribute specifies a session that is unknown to the recipient

    WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO

    the recipient does not support the informational payload of a session-info action.

    enum WockySIError

    typedef enum {
        WOCKY_SI_ERROR_NO_VALID_STREAMS,
        WOCKY_SI_ERROR_BAD_PROFILE
    } WockySIError;
    

    SI specific errors.

    WOCKY_SI_ERROR_NO_VALID_STREAMS

    none of the available streams are acceptable

    WOCKY_SI_ERROR_BAD_PROFILE

    the profile is not understood or invalid

    enum WockyXmppError

    typedef enum {
        WOCKY_XMPP_ERROR_UNDEFINED_CONDITION = 0, /* 500 */
    
        WOCKY_XMPP_ERROR_REDIRECT,                /* 302 */
        WOCKY_XMPP_ERROR_GONE,                    /* 302 */
    
        WOCKY_XMPP_ERROR_BAD_REQUEST,             /* 400 */
        WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST,      /* 400 */
        WOCKY_XMPP_ERROR_JID_MALFORMED,           /* 400 */
    
        WOCKY_XMPP_ERROR_NOT_AUTHORIZED,          /* 401 */
    
        WOCKY_XMPP_ERROR_PAYMENT_REQUIRED,        /* 402 */
    
        WOCKY_XMPP_ERROR_FORBIDDEN,               /* 403 */
    
        WOCKY_XMPP_ERROR_ITEM_NOT_FOUND,          /* 404 */
        WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE,   /* 404 */
        WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND, /* 404 */
    
        WOCKY_XMPP_ERROR_NOT_ALLOWED,             /* 405 */
    
        WOCKY_XMPP_ERROR_NOT_ACCEPTABLE,          /* 406 */
    
        WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED,   /* 407 */
        WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED,   /* 407 */
    
        WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT,   /* 408, 504 */
    
        WOCKY_XMPP_ERROR_CONFLICT,                /* 409 */
    
        WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR,   /* 500 */
        WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT,     /* 500 */
    
        WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED, /* 501 */
    
        WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE,     /* 502, 503, 510 */
    } WockyXmppError;
    

    Possible XMPP stream errors, as defined by RFC 3920 §9.3.3.

    WOCKY_XMPP_ERROR_UNDEFINED_CONDITION

    he error condition is not one of those defined by the other conditions in this list

    WOCKY_XMPP_ERROR_REDIRECT

    the recipient or server is redirecting requests for this information to another entity

    WOCKY_XMPP_ERROR_GONE

    the recipient or server can no longer be contacted at this address

    WOCKY_XMPP_ERROR_BAD_REQUEST

    the sender has sent XML that is malformed or that cannot be processed

    WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST

    the recipient or server understood the request but was not expecting it at this time

    WOCKY_XMPP_ERROR_JID_MALFORMED

    the sending entity has provided or communicated an XMPP address

    WOCKY_XMPP_ERROR_NOT_AUTHORIZED

    the sender must provide proper credentials before being allowed to perform the action, or has provided improper credentials

    WOCKY_XMPP_ERROR_PAYMENT_REQUIRED

    the requesting entity is not authorized to access the requested service because payment is required

    WOCKY_XMPP_ERROR_FORBIDDEN

    the requesting entity does not possess the required permissions to perform the action

    WOCKY_XMPP_ERROR_ITEM_NOT_FOUND

    he addressed JID or item requested cannot be found

    WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE

    the intended recipient is temporarily unavailable

    WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND

    a remote server or service specified as part or all of the JID of the intended recipient does not exist

    WOCKY_XMPP_ERROR_NOT_ALLOWED

    the recipient or server does not allow any entity to perform the action

    WOCKY_XMPP_ERROR_NOT_ACCEPTABLE

    the recipient or server understands the request but is refusing to process it because it does not meet criteria defined by the recipient or server

    WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED

    the requesting entity is not authorized to access the requested service because registration is required

    WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED

    the requesting entity is not authorized to access the requested service because a subscription is required

    WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT

    a remote server or service specified as part or all of the JID of the intended recipient (or required to fulfill a request) could not be contacted within a reasonable amount of time

    WOCKY_XMPP_ERROR_CONFLICT

    access cannot be granted because an existing resource or session exists with the same name or address

    WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR

    the server could not process the stanza because of a misconfiguration or an otherwise-undefined internal server error

    WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT

    the server or recipient lacks the system resources necessary to service the request

    WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED

    the feature requested is not implemented by the recipient or server and therefore cannot be processed

    WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE

    the server or recipient does not currently provide the requested service

    struct WockyXmppErrorDomain

    struct WockyXmppErrorDomain {
      GQuark domain;
      GType enum_type;
      WockyXmppErrorSpecialization *codes;
    };
    

    A struct to represent extra XMPP error domains added.

    GQuark domain;

    a GQuark of the error domain

    GType enum_type;

    the GType of the error enum

    WockyXmppErrorSpecialization *codes;

    a NULL-terminated array of of WockyXmppErrorSpecializations

    struct WockyXmppErrorSpecialization

    struct WockyXmppErrorSpecialization {
      const gchar *description;
      WockyXmppError specializes;
      gboolean override_type;
      WockyXmppErrorType type;
    };
    

    A struct to represent a specialization of an existing WockyXmppError member.

    const gchar *description;

    description of the error

    WockyXmppError specializes;

    which WockyXmppError this error specializes

    gboolean override_type;

    TRUE if type should be used, or FALSE if the default error type for specializes should be used

    WockyXmppErrorType type;

    the XMPP error type

    enum WockyXmppErrorType

    typedef enum {
      WOCKY_XMPP_ERROR_TYPE_CANCEL,
      WOCKY_XMPP_ERROR_TYPE_CONTINUE,
      WOCKY_XMPP_ERROR_TYPE_MODIFY,
      WOCKY_XMPP_ERROR_TYPE_AUTH,
      WOCKY_XMPP_ERROR_TYPE_WAIT
    } WockyXmppErrorType;
    

    XMPP error types as described in RFC 3920 §9.3.2.

    WOCKY_XMPP_ERROR_TYPE_CANCEL

    do not retry (the error is unrecoverable)

    WOCKY_XMPP_ERROR_TYPE_CONTINUE

    proceed (the condition was only a warning)

    WOCKY_XMPP_ERROR_TYPE_MODIFY

    retry after changing the data sent

    WOCKY_XMPP_ERROR_TYPE_AUTH

    retry after providing credentials

    WOCKY_XMPP_ERROR_TYPE_WAIT

    retry after waiting (the error is temporary)

    enum WockyXmppStreamError

    typedef enum {
      WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT,
      WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX,
      WOCKY_XMPP_STREAM_ERROR_CONFLICT,
      WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT,
      WOCKY_XMPP_STREAM_ERROR_HOST_GONE,
      WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN,
      WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING,
      WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR,
      WOCKY_XMPP_STREAM_ERROR_INVALID_FROM,
      WOCKY_XMPP_STREAM_ERROR_INVALID_ID,
      WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE,
      WOCKY_XMPP_STREAM_ERROR_INVALID_XML,
      WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED,
      WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION,
      WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED,
      WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT,
      WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML,
      WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST,
      WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN,
      WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION,
      WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING,
      WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE,
      WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION,
      WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED,
      WOCKY_XMPP_STREAM_ERROR_UNKNOWN,
    } WockyXmppStreamError;
    

    Stream-level error conditions as described in RFC 3920 §4.7.3.

    WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT

    the entity has sent XML that cannot be processed

    WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX

    the entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that requires such a prefix

    WOCKY_XMPP_STREAM_ERROR_CONFLICT

    the server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream

    WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT

    the entity has not generated any traffic over the stream for some period of time

    WOCKY_XMPP_STREAM_ERROR_HOST_GONE

    the value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server

    WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN

    the value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server

    WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING

    a stanza sent between two servers lacks a 'to' or 'from' attribute (or the attribute has no value)

    WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR

    the server has experienced a misconfiguration or an otherwise-undefined internal error that prevents it from servicing the stream

    WOCKY_XMPP_STREAM_ERROR_INVALID_FROM

    the JID or hostname provided in a 'from' address does not match an authorized JID or validated domain negotiated between servers via SASL or dialback, or between a client and a server via authentication and resource binding

    WOCKY_XMPP_STREAM_ERROR_INVALID_ID

    the stream ID or dialback ID is invalid or does not match an ID previously provided

    WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE

    the streams namespace name is something other than "http://etherx.jabber.org/streams" or the dialback namespace name is something other than "jabber:server:dialback"

    WOCKY_XMPP_STREAM_ERROR_INVALID_XML

    the entity has sent invalid XML over the stream to a server that performs validation

    WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED

    the entity has attempted to send data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation

    WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION

    the entity has violated some local service policy

    WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED

    the server is unable to properly connect to a remote entity that is required for authentication or authorization

    WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT

    the server lacks the system resources necessary to service the stream

    WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML

    the entity has attempted to send restricted XML features such as a comment, processing instruction, DTD, entity reference, or unescaped character

    WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST

    the server will not provide service to the initiating entity but is redirecting traffic to another host

    WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN

    the server is being shut down and all active streams are being closed

    WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION

    the error condition is not one of those defined by the other conditions in this list

    WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING

    the initiating entity has encoded the stream in an encoding that is not supported by the server

    WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE

    the initiating entity has sent a first-level child of the stream that is not supported by the server

    WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION

    the value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server

    WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED

    the initiating entity has sent XML that is not well-formed

    WOCKY_XMPP_STREAM_ERROR_UNKNOWN

    an unknown stream error

    wocky_jingle_error_quark ()

    GQuark              wocky_jingle_error_quark            (void);

    wocky_si_error_quark ()

    GQuark              wocky_si_error_quark                (void);

    wocky_stanza_error_to_node ()

    WockyNode *         wocky_stanza_error_to_node          (const GError *error,
                                                             WockyNode *parent_node);

    wocky_xmpp_error_deinit ()

    void                wocky_xmpp_error_deinit             (void);

    wocky_xmpp_error_description ()

    const gchar *       wocky_xmpp_error_description        (WockyXmppError error);

    error :

    a core stanza error

    Returns :

    a description of the error, in English, as specified in XMPP Core

    wocky_xmpp_error_extract ()

    void                wocky_xmpp_error_extract            (WockyNode *error,
                                                             WockyXmppErrorType *type,
                                                             GError **core,
                                                             GError **specialized,
                                                             WockyNode **specialized_node);

    Given an <error/> node, breaks it down into values describing the error. type and core are guaranteed to be set; specialized and specialized_node will be set if a recognised application-specific error is found, and the latter will be set to NULL if no application-specific error is found.

    Any or all of the out parameters may be NULL to ignore the value. The value stored in specialized_node is borrowed from stanza, and is only valid as long as the latter is alive.

    error :

    the <error/> child of a stanza with type='error'

    type :

    location at which to store the error type

    core :

    location at which to store an error in the domain WOCKY_XMPP_ERROR

    specialized :

    location at which to store an error in an application-specific domain, if one is found

    specialized_node :

    location at which to store the node representing an application-specific error, if one is found

    wocky_xmpp_error_init ()

    void                wocky_xmpp_error_init               (void);

    wocky_xmpp_error_quark ()

    GQuark              wocky_xmpp_error_quark              (void);

    wocky_xmpp_error_register_domain ()

    void                wocky_xmpp_error_register_domain    (WockyXmppErrorDomain *domain);

    Registers a new set of application-specific stanza errors. This allows GErrors in that domain to be passed to wocky_stanza_error_to_node(), and to be recognized and returned by wocky_xmpp_error_extract() (and wocky_stanza_extract_errors(), by extension).

    domain :

    a description of the error domain

    wocky_xmpp_error_string ()

    const gchar *       wocky_xmpp_error_string             (WockyXmppError error);

    error :

    a core stanza error

    Returns :

    the name of the tag corresponding to error

    wocky_xmpp_stanza_error_to_string ()

    const gchar *       wocky_xmpp_stanza_error_to_string   (GError *error);

    Returns the name of the XMPP stanza error element represented by error. This is intended for use in debugging messages, with GErrors returned by wocky_stanza_extract_errors().

    error :

    an error in the domain WOCKY_XMPP_ERROR, or another domain registered with wocky_xmpp_error_register_domain() (such as WOCKY_JINGLE_ERROR).

    Returns :

    the error code as a string, or NULL if error->domain is not known to Wocky.

    wocky_xmpp_stream_error_from_node ()

    GError *            wocky_xmpp_stream_error_from_node   (WockyNode *error);

    error :

    the root node of a WOCKY_STANZA_TYPE_STREAM_ERROR stanza

    Returns :

    a GError in the WOCKY_XMPP_STREAM_ERROR domain.

    wocky_xmpp_stream_error_quark ()

    GQuark              wocky_xmpp_stream_error_quark       (void);

    Get the error quark used for stream errors

    Returns :

    the quark for stream errors.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-service-protected.html0000644000175000017500000004030712051456453033003 0ustar00wjtwjt00000000000000 wocky-pubsub-service-protected

    wocky-pubsub-service-protected

    wocky-pubsub-service-protected

    Synopsis

    WockyStanza *       wocky_pubsub_service_create_create_node_stanza
                                                            (WockyPubsubService *self,
                                                             const gchar *name,
                                                             WockyDataForm *config,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **create_node);
    WockyStanza *       wocky_pubsub_service_create_retrieve_subscriptions_stanza
                                                            (WockyPubsubService *self,
                                                             WockyPubsubNode *node,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **subscriptions_node);
    WockyPorter *       wocky_pubsub_service_get_porter     (WockyPubsubService *self);
    WockyPubsubNode *   wocky_pubsub_service_handle_create_node_reply
                                                            (WockyPubsubService *self,
                                                             WockyNodeTree *create_tree,
                                                             const gchar *requested_name,
                                                             GError **error);
    WockyPubsubSubscription * wocky_pubsub_service_parse_subscription
                                                            (WockyPubsubService *self,
                                                             WockyNode *subscription_node,
                                                             const gchar *parent_node_attr,
                                                             GError **error);
    GList *             wocky_pubsub_service_parse_subscriptions
                                                            (WockyPubsubService *self,
                                                             WockyNode *subscriptions_node,
                                                             GList **subscription_nodes);
    

    Description

    Details

    wocky_pubsub_service_create_create_node_stanza ()

    WockyStanza *       wocky_pubsub_service_create_create_node_stanza
                                                            (WockyPubsubService *self,
                                                             const gchar *name,
                                                             WockyDataForm *config,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **create_node);

    wocky_pubsub_service_create_retrieve_subscriptions_stanza ()

    WockyStanza *       wocky_pubsub_service_create_retrieve_subscriptions_stanza
                                                            (WockyPubsubService *self,
                                                             WockyPubsubNode *node,
                                                             WockyNode **pubsub_node,
                                                             WockyNode **subscriptions_node);

    wocky_pubsub_service_get_porter ()

    WockyPorter *       wocky_pubsub_service_get_porter     (WockyPubsubService *self);

    wocky_pubsub_service_handle_create_node_reply ()

    WockyPubsubNode *   wocky_pubsub_service_handle_create_node_reply
                                                            (WockyPubsubService *self,
                                                             WockyNodeTree *create_tree,
                                                             const gchar *requested_name,
                                                             GError **error);

    Handles the body of a reply to a create node request. This is ever-so-slightly involved, because the server is allowed to omit the body of the reply if you specified a node name and it created a node with that name, but it may also tell you "hey, you asked for 'ringo', but I gave you 'george'". Good times.

    self :

    a pubsub service

    create_tree :

    the <create/> tree from the reply to an attempt to create a node, or NULL if none was present in the reply.

    requested_name :

    the name we asked the server to use for the node, or NULL if we requested an instant node

    error :

    location at which to store an error

    Returns :

    a pubsub node if the reply made sense, or NULL with error set if not.

    wocky_pubsub_service_parse_subscription ()

    WockyPubsubSubscription * wocky_pubsub_service_parse_subscription
                                                            (WockyPubsubService *self,
                                                             WockyNode *subscription_node,
                                                             const gchar *parent_node_attr,
                                                             GError **error);

    wocky_pubsub_service_parse_subscriptions ()

    GList *             wocky_pubsub_service_parse_subscriptions
                                                            (WockyPubsubService *self,
                                                             WockyNode *subscriptions_node,
                                                             GList **subscription_nodes);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyTLSHandler.html0000644000175000017500000005065312051456453027706 0ustar00wjtwjt00000000000000 WockyTLSHandler

    WockyTLSHandler

    WockyTLSHandler

    Synopsis

    struct              WockyTLSHandlerClass;
    void                (*WockyTLSHandlerVerifyAsyncFunc)   (WockyTLSHandler *self,
                                                             WockyTLSSession *tls_session,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            (*WockyTLSHandlerVerifyFinishFunc)  (WockyTLSHandler *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    gboolean            wocky_tls_handler_add_ca            (WockyTLSHandler *self,
                                                             const gchar *path);
    gboolean            wocky_tls_handler_add_crl           (WockyTLSHandler *self,
                                                             const gchar *path);
    GSList *            wocky_tls_handler_get_cas           (WockyTLSHandler *self);
    GSList *            wocky_tls_handler_get_crls          (WockyTLSHandler *self);
    WockyTLSHandler *   wocky_tls_handler_new               (gboolean ignore_ssl_errors);
    void                wocky_tls_handler_verify_async      (WockyTLSHandler *self,
                                                             WockyTLSSession *tls_session,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_tls_handler_verify_finish     (WockyTLSHandler *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    

    Description

    Details

    struct WockyTLSHandlerClass

    struct WockyTLSHandlerClass {
      WockyTLSHandlerVerifyAsyncFunc verify_async_func;
      WockyTLSHandlerVerifyFinishFunc verify_finish_func;
    };
    

    The class of a WockyTLSHandler.

    WockyTLSHandlerVerifyAsyncFunc verify_async_func;

    a function to call to start an asychronous verify operation; see wocky_tls_handler_verify_async() for more details

    WockyTLSHandlerVerifyFinishFunc verify_finish_func;

    a function to call to finish an asychronous verify operation; see wocky_tls_handler_verify_finish() for more details

    WockyTLSHandlerVerifyAsyncFunc ()

    void                (*WockyTLSHandlerVerifyAsyncFunc)   (WockyTLSHandler *self,
                                                             WockyTLSSession *tls_session,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    WockyTLSHandlerVerifyFinishFunc ()

    gboolean            (*WockyTLSHandlerVerifyFinishFunc)  (WockyTLSHandler *self,
                                                             GAsyncResult *res,
                                                             GError **error);

    wocky_tls_handler_add_ca ()

    gboolean            wocky_tls_handler_add_ca            (WockyTLSHandler *self,
                                                             const gchar *path);

    Sensible default paths (under Debian derived distributions) are:

    * for gnutls: /etc/ssl/certs/ca-certificates.crt * for openssl: /etc/ssl/certs

    Certificates my also be found under /usr/share/ca-certificates/... if the user wishes to pick and choose which CAs to use.

    self :

    a WockyTLSHandler instance

    path :

    a path to a directory or file containing PEM encoded CA certificates

    Returns :

    a gboolean indicating whether the path was resolved. Does not indicate that there was actually a file or directory there or that any CAs were actually found. The CAs won't actually be loaded until just before the TLS session setup is attempted.

    wocky_tls_handler_add_crl ()

    gboolean            wocky_tls_handler_add_crl           (WockyTLSHandler *self,
                                                             const gchar *path);

    This function does not descend subdirectories automatically.

    self :

    a WockyTLSHandler instance

    path :

    a path to a directory or file containing PEM encoded CRLs

    Returns :

    a gboolean indicating whether the path was resolved. Does not indicate that there was actually a file or directory there or that any CRLs were actually found. The CRLs won't actually be loaded until just before the TLS session setup is attempted.

    wocky_tls_handler_get_cas ()

    GSList *            wocky_tls_handler_get_cas           (WockyTLSHandler *self);

    wocky_tls_handler_get_crls ()

    GSList *            wocky_tls_handler_get_crls          (WockyTLSHandler *self);

    wocky_tls_handler_new ()

    WockyTLSHandler *   wocky_tls_handler_new               (gboolean ignore_ssl_errors);

    wocky_tls_handler_verify_async ()

    void                wocky_tls_handler_verify_async      (WockyTLSHandler *self,
                                                             WockyTLSSession *tls_session,
                                                             const gchar *peername,
                                                             GStrv extra_identities,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_tls_handler_verify_finish ()

    gboolean            wocky_tls_handler_verify_finish     (WockyTLSHandler *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/WockyResourceContact.html0000644000175000017500000001750012051456453027711 0ustar00wjtwjt00000000000000 WockyResourceContact

    WockyResourceContact

    WockyResourceContact

    Description

    Details

    struct WockyResourceContactClass

    struct WockyResourceContactClass {
    };
    

    The class of a WockyResourceContact.


    wocky_resource_contact_equal ()

    gboolean            wocky_resource_contact_equal        (WockyResourceContact *a,
                                                             WockyResourceContact *b);

    wocky_resource_contact_get_bare_contact ()

    WockyBareContact *  wocky_resource_contact_get_bare_contact
                                                            (WockyResourceContact *contact);

    wocky_resource_contact_get_resource ()

    const gchar *       wocky_resource_contact_get_resource (WockyResourceContact *contact);

    wocky_resource_contact_new ()

    WockyResourceContact * wocky_resource_contact_new       (WockyBareContact *bare,
                                                             const gchar *resource);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyPorter.html0000644000175000017500000034365612051456453027231 0ustar00wjtwjt00000000000000 WockyPorter

    WockyPorter

    WockyPorter

    Synopsis

    #define             WOCKY_PORTER_ERROR
    #define             WOCKY_PORTER_HANDLER_PRIORITY_MAX
    #define             WOCKY_PORTER_HANDLER_PRIORITY_MIN
    #define             WOCKY_PORTER_HANDLER_PRIORITY_NORMAL
    enum                WockyPorterError;
    gboolean            (*WockyPorterHandlerFunc)           (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             gpointer user_data);
    struct              WockyPorterInterface;
    void                wocky_porter_acknowledge_iq         (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             ...);
    void                wocky_porter_close_async            (WockyPorter *porter,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_porter_close_finish           (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);
    GQuark              wocky_porter_error_quark            (void);
    void                wocky_porter_force_close_async      (WockyPorter *porter,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_porter_force_close_finish     (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);
    const gchar *       wocky_porter_get_bare_jid           (WockyPorter *self);
    const gchar *       wocky_porter_get_full_jid           (WockyPorter *self);
    const gchar *       wocky_porter_get_resource           (WockyPorter *self);
    guint               wocky_porter_register_handler_from  (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             ...);
    guint               wocky_porter_register_handler_from_anyone
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             ...);
    guint               wocky_porter_register_handler_from_anyone_by_stanza
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             WockyStanza *stanza);
    guint               wocky_porter_register_handler_from_anyone_va
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             va_list ap);
    guint               wocky_porter_register_handler_from_by_stanza
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             WockyStanza *stanza);
    guint               wocky_porter_register_handler_from_va
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             va_list ap);
    void                wocky_porter_send                   (WockyPorter *porter,
                                                             WockyStanza *stanza);
    void                wocky_porter_send_async             (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_porter_send_finish            (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_porter_send_iq_async          (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    void                wocky_porter_send_iq_error          (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             WockyXmppError error_code,
                                                             const gchar *message);
    WockyStanza *       wocky_porter_send_iq_finish         (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_porter_send_iq_gerror         (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             const GError *error);
    void                wocky_porter_start                  (WockyPorter *porter);
    void                wocky_porter_unregister_handler     (WockyPorter *porter,
                                                             guint id);
    

    Description

    Details

    WOCKY_PORTER_ERROR

    #define WOCKY_PORTER_ERROR (wocky_porter_error_quark ())
    

    Get access to the error quark of the xmpp porter.


    WOCKY_PORTER_HANDLER_PRIORITY_MAX

    #define WOCKY_PORTER_HANDLER_PRIORITY_MAX G_MAXUINT
    

    WOCKY_PORTER_HANDLER_PRIORITY_MIN

    #define WOCKY_PORTER_HANDLER_PRIORITY_MIN 0
    

    WOCKY_PORTER_HANDLER_PRIORITY_NORMAL

    #define WOCKY_PORTER_HANDLER_PRIORITY_NORMAL (guint) (G_MAXUINT / 2)
    

    enum WockyPorterError

    typedef enum {
      WOCKY_PORTER_ERROR_NOT_STARTED,
      WOCKY_PORTER_ERROR_CLOSING,
      WOCKY_PORTER_ERROR_CLOSED,
      WOCKY_PORTER_ERROR_NOT_IQ,
      WOCKY_PORTER_ERROR_FORCIBLY_CLOSED,
    } WockyPorterError;
    

    The WockyPorter specific errors.

    WOCKY_PORTER_ERROR_NOT_STARTED

    The WockyPorter has not been started yet

    WOCKY_PORTER_ERROR_CLOSING

    The WockyPorter is closing

    WOCKY_PORTER_ERROR_CLOSED

    The WockyPorter is closed

    WOCKY_PORTER_ERROR_NOT_IQ

    The WockyStanza is not an IQ

    WOCKY_PORTER_ERROR_FORCIBLY_CLOSED

    The WockyPorter has been forced to close

    WockyPorterHandlerFunc ()

    gboolean            (*WockyPorterHandlerFunc)           (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             gpointer user_data);

    Handler called when a matching stanza has been received by the WockyPorter.

    If a handler returns TRUE, this means that it has taken responsibility for handling the stanza and (if applicable) sending a reply.

    If a handler returns FALSE, this indicates that it has declined to process the stanza. The next handler (if any) is invoked.

    A handler must not assume that stanza will continue to exist after the handler has returned, unless it has taken a reference to stanza using g_object_ref().

    porter :

    the WockyPorter dispatching the WockyStanza

    stanza :

    the WockyStanza being dispatched

    user_data :

    the data passed when the handler has been registered

    Returns :

    TRUE if the stanza has been handled, FALSE if not

    struct WockyPorterInterface

    struct WockyPorterInterface {
      GTypeInterface parent_iface;
    
      const gchar * (*get_full_jid) (WockyPorter *self);
      const gchar * (*get_bare_jid) (WockyPorter *self);
      const gchar * (*get_resource) (WockyPorter *self);
    
      void (*start) (WockyPorter *porter);
    
      void (*send_async) (WockyPorter *porter,
          WockyStanza *stanza,
          GCancellable *cancellable,
          GAsyncReadyCallback callback,
          gpointer user_data);
    
      gboolean (*send_finish) (WockyPorter *porter,
          GAsyncResult *result,
          GError **error);
    
      guint (*register_handler_from_by_stanza) (
          WockyPorter *self,
          WockyStanzaType type,
          WockyStanzaSubType sub_type,
          const gchar *from,
          guint priority,
          WockyPorterHandlerFunc callback,
          gpointer user_data,
          WockyStanza *stanza);
    
      guint (*register_handler_from_anyone_by_stanza) (
          WockyPorter *self,
          WockyStanzaType type,
          WockyStanzaSubType sub_type,
          guint priority,
          WockyPorterHandlerFunc callback,
          gpointer user_data,
          WockyStanza *stanza);
    
      void (*unregister_handler) (WockyPorter *self,
          guint id);
    
      void (*close_async) (WockyPorter *self,
          GCancellable *cancellable,
          GAsyncReadyCallback callback,
          gpointer user_data);
    
      gboolean (*close_finish) (WockyPorter *self,
          GAsyncResult *result,
          GError **error);
    
      void (*send_iq_async) (WockyPorter *porter,
          WockyStanza *stanza,
          GCancellable *cancellable,
          GAsyncReadyCallback callback,
          gpointer user_data);
    
      WockyStanza * (*send_iq_finish) (WockyPorter *porter,
          GAsyncResult *result,
          GError **error);
    
      void (*force_close_async) (WockyPorter *porter,
          GCancellable *cancellable,
          GAsyncReadyCallback callback,
          gpointer user_data);
    
      gboolean (*force_close_finish) (WockyPorter *porter,
          GAsyncResult *result,
          GError **error);
    };
    

    The vtable for a porter implementation.

    GTypeInterface parent_iface;

    Fields shared with GTypeInterface.

    get_full_jid ()

    Return the full JID of the user according to the porter; see wocky_porter_get_full_jid() for more details.

    get_bare_jid ()

    Return the bare JID of the user according to the porter; see wocky_porter_get_full_jid() for more details.

    get_resource ()

    Return the resource of the user according to the porter; see wocky_porter_get_full_jid() for more details.

    start ()

    Start the porter; see wocky_porter_start() for more details.

    send_async ()

    Start an asynchronous stanza send operation; see wocky_porter_send_async() for more details.

    send_finish ()

    Finish an asynchronous stanza send operation; see wocky_porter_send_finish() for more details.

    register_handler_from_by_stanza ()

    Register a stanza handler from a specific contact; see wocky_porter_register_handler_from_by_stanza() for more details.

    register_handler_from_anyone_by_stanza ()

    Register a stanza hander from any contact; see wocky_porter_register_handler_from_anyone_by_stanza() for more details.

    unregister_handler ()

    Unregister a stanza handler; see wocky_porter_unregister_handler() for more details.

    close_async ()

    Start an asynchronous porter close operation; see wocky_porter_close_async() for more details.

    close_finish ()

    Finish an asynchronous porter close operation; see wocky_porter_close_finish() for more details.

    send_iq_async ()

    Start an asynchronous IQ stanza send operation; see wocky_porter_send_iq_async() for more details.

    send_iq_finish ()

    Finish an asynchronous IQ stanza send operation; see wocky_porter_send_iq_finish() for more details.

    force_close_async ()

    Start an asynchronous porter force close operation; see wocky_porter_force_close_async() for more details.

    force_close_finish ()

    Finish an asynchronous porter force close operation; see wocky_porter_force_close_finish() for more details.

    wocky_porter_acknowledge_iq ()

    void                wocky_porter_acknowledge_iq         (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             ...);

    Sends an acknowledgement for stanza back to the sender, as a shorthand for calling wocky_stanza_build_iq_result() and wocky_porter_send().

    porter :

    a WockyPorter

    stanza :

    a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

    ... :

    a wocky_stanza_build() specification; pass NULL to include no body in the reply.

    wocky_porter_close_async ()

    void                wocky_porter_close_async            (WockyPorter *porter,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous closing of a WockyPorter. This fires the WockyPorter::closing signal, flushes the sending queue, closes the XMPP stream and waits that the other side closes the XMPP stream as well. When this is done, callback is called. You can then call wocky_porter_close_finish() to get the result of the operation.

    porter :

    a WockyPorter

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    callback to call when the request is satisfied

    user_data :

    the data to pass to callback function

    wocky_porter_close_finish ()

    gboolean            wocky_porter_close_finish           (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes a close operation.

    porter :

    a WockyPorter

    result :

    a GAsyncResult

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE on success or FALSE on error.

    wocky_porter_error_quark ()

    GQuark              wocky_porter_error_quark            (void);

    Get the error quark used by the porter.

    Returns :

    the quark for porter errors.

    wocky_porter_force_close_async ()

    void                wocky_porter_force_close_async      (WockyPorter *porter,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Force the WockyPorter to close the TCP connection of the underlying WockyXmppConnection. If a close operation is pending, it will be completed with the WOCKY_PORTER_ERROR_FORCIBLY_CLOSED error. When the connection has been closed, callback will be called. You can then call wocky_porter_force_close_finish() to get the result of the operation.

    porter :

    a WockyPorter

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    callback to call when the request is satisfied

    user_data :

    the data to pass to callback function

    wocky_porter_force_close_finish ()

    gboolean            wocky_porter_force_close_finish     (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes a force close operation.

    porter :

    a WockyPorter

    result :

    a GAsyncResult

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE on success or FALSE on error.

    wocky_porter_get_bare_jid ()

    const gchar *       wocky_porter_get_bare_jid           (WockyPorter *self);

    self :

    a porter

    Returns :

    the value of "bare-jid". [transfer none]

    wocky_porter_get_full_jid ()

    const gchar *       wocky_porter_get_full_jid           (WockyPorter *self);

    self :

    a porter

    Returns :

    the value of "full-jid". [transfer none]

    wocky_porter_get_resource ()

    const gchar *       wocky_porter_get_resource           (WockyPorter *self);

    self :

    a porter

    Returns :

    the value of "resource". [transfer none]

    wocky_porter_register_handler_from ()

    guint               wocky_porter_register_handler_from  (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             ...);

    Register a new stanza handler. Stanza handlers are called when the Porter receives a new stanza matching the rules of the handler. Matching handlers are sorted by priority and are called until one claims to have handled the stanza (by returning TRUE).

    If from is a bare JID, then the resource of the JID in the from attribute will be ignored: In other words, a handler registered against a bare JID will match _all_ stanzas from a JID with the same node and domain: "foo@bar.org" will match "foo@bar.org", "foo@bar.org/moose" and so forth.

    To register an IQ handler from Juliet for all the Jingle stanzas related to one Jingle session:

    1
    2
    3
    4
    5
    6
    7
    8
    id = wocky_porter_register_handler (porter,
      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL,
      WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, jingle_cb,
      "juliet@example.com/Balcony",
      '(', "jingle",
        ':', "urn:xmpp:jingle:1",
        '@', "sid", "my_sid",
      ')', NULL);

    To match stanzas from any sender, see wocky_porter_register_handler_from_anyone(). If the porter is a WockyC2SPorter, one can match stanzas sent by the server; see wocky_c2s_porter_register_handler_from_server().

    self :

    A WockyPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    from :

    the JID whose messages this handler is intended for (may not be NULL)

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    ... :

    a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_porter_register_handler_from_anyone ()

    guint               wocky_porter_register_handler_from_anyone
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             ...);

    Registers a handler for incoming stanzas from anyone, including those where the from attribute is missing.

    For example, to register a handler matching all message stanzas received from anyone, call:

    1
    2
    3
    4
    id = wocky_porter_register_handler (porter,
      WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL,
      WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, message_received_cb, NULL,
      NULL);

    As a more interesting example, the following matches incoming PEP notifications for contacts' geolocation information:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    id = wocky_porter_register_handler_from_anyone (porter,
       WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
       WOCKY_PORTER_HANDLER_PRIORITY_MAX,
       msg_event_cb, self,
       '(', "event",
         ':', WOCKY_XMPP_NS_PUBSUB_EVENT,
         '(', "items",
           '@', "node", "http://jabber.org/protocol/geoloc",
         ')',
       ')',
       NULL);

    self :

    A WockyPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    ... :

    a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_porter_register_handler_from_anyone_by_stanza ()

    guint               wocky_porter_register_handler_from_anyone_by_stanza
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             WockyStanza *stanza);

    A WockyStanza version of wocky_porter_register_handler_from_anyone(); see that function for more details.

    self :

    A WockyPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    stanza :

    a WockyStanza. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_porter_register_handler_from_anyone_va ()

    guint               wocky_porter_register_handler_from_anyone_va
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             va_list ap);

    A va_list version of wocky_porter_register_handler_from_anyone(); see that function for more details.

    self :

    A WockyPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    ap :

    a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_porter_register_handler_from_by_stanza ()

    guint               wocky_porter_register_handler_from_by_stanza
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             WockyStanza *stanza);

    A WockyStanza version of wocky_porter_register_handler_from(); see that function for more details.

    self :

    A WockyPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    from :

    the JID whose messages this handler is intended for (may not be NULL)

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    stanza :

    a WockyStanza. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_porter_register_handler_from_va ()

    guint               wocky_porter_register_handler_from_va
                                                            (WockyPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             const gchar *from,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             va_list ap);

    A va_list version of wocky_porter_register_handler_from(); see that function for more details.

    self :

    A WockyPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    from :

    the JID whose messages this handler is intended for (may not be NULL)

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    ap :

    a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_porter_send ()

    void                wocky_porter_send                   (WockyPorter *porter,
                                                             WockyStanza *stanza);

    Send a WockyStanza. This is a convenient function to not have to call wocky_porter_send_async() with lot of NULL arguments if you don't care to know when the stanza has been actually sent.

    porter :

    a WockyPorter

    stanza :

    the WockyStanza to send

    wocky_porter_send_async ()

    void                wocky_porter_send_async             (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of a WockyStanza. When the stanza has been sent callback will be called. You can then call wocky_porter_send_finish() to get the result of the operation.

    porter :

    a WockyPorter

    stanza :

    the WockyStanza to send

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    callback to call when the request is satisfied

    user_data :

    the data to pass to callback function

    wocky_porter_send_finish ()

    gboolean            wocky_porter_send_finish            (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes sending a WockyStanza.

    porter :

    a WockyPorter

    result :

    a GAsyncResult

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE on success or FALSE on error.

    wocky_porter_send_iq_async ()

    void                wocky_porter_send_iq_async          (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of a WockyStanza of type WOCKY_STANZA_TYPE_IQ and sub-type WOCKY_STANZA_SUB_TYPE_GET or WOCKY_STANZA_SUB_TYPE_SET. When the reply to this IQ has been received callback will be called. You can then call wocky_porter_send_iq_finish to get the reply stanza.

    porter :

    a WockyPorter

    stanza :

    the WockyStanza to send

    cancellable :

    optional GCancellable object, NULL to ignore

    callback :

    callback to call when the request is satisfied

    user_data :

    the data to pass to callback function

    wocky_porter_send_iq_error ()

    void                wocky_porter_send_iq_error          (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             WockyXmppError error_code,
                                                             const gchar *message);

    Sends an error reply for stanza back to its sender, with the given error_code and message, and including the child element from the original stanza.

    To send error replies with more detailed error elements, see wocky_porter_send_iq_gerror(), or use wocky_stanza_build_iq_error() and wocky_porter_send() directly, possibly using wocky_stanza_error_to_node() to construct the error element.

    porter :

    the porter whence stanza came

    stanza :

    a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

    error_code :

    an XMPP Core stanza error code

    message :

    an optional error message to include with the reply. [allow-none]

    wocky_porter_send_iq_finish ()

    WockyStanza *       wocky_porter_send_iq_finish         (WockyPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);

    Get the reply of an IQ query.

    porter :

    a WockyPorter

    result :

    a GAsyncResult

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    a reffed WockyStanza on success, NULL on error

    wocky_porter_send_iq_gerror ()

    void                wocky_porter_send_iq_gerror         (WockyPorter *porter,
                                                             WockyStanza *stanza,
                                                             const GError *error);

    Sends an error reply for stanza back to its sender, building the <error/> element from the given error. To send error replies with simple XMPP Core stanza errors in the WOCKY_XMPP_ERROR domain, wocky_porter_send_iq_error() may be more convenient to use.

    porter :

    the porter whence stanza came

    stanza :

    a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

    error :

    an error whose domain is either WOCKY_XMPP_ERROR, some other stanza error domain supplied with Wocky (such as WOCKY_JINGLE_ERROR or WOCKY_SI_ERROR), or a custom domain registered with wocky_xmpp_error_register_domain()

    wocky_porter_start ()

    void                wocky_porter_start                  (WockyPorter *porter);

    Start a WockyPorter to make it read and dispatch incoming stanzas.

    porter :

    a WockyPorter

    wocky_porter_unregister_handler ()

    void                wocky_porter_unregister_handler     (WockyPorter *porter,
                                                             guint id);

    Unregister a registered handler. This handler won't be called when receiving stanzas anymore.

    porter :

    a WockyPorter

    id :

    the id of the handler to unregister
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky.devhelp20000644000175000017500000034030412051456453025473 0ustar00wjtwjt00000000000000 telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-plain.html0000644000175000017500000000712112051456453030116 0ustar00wjtwjt00000000000000 wocky-sasl-plain

    wocky-sasl-plain

    wocky-sasl-plain

    Synopsis

    WockySaslPlain *    wocky_sasl_plain_new                (const gchar *username,
                                                             const gchar *password);
    

    Description

    Details

    wocky_sasl_plain_new ()

    WockySaslPlain *    wocky_sasl_plain_new                (const gchar *username,
                                                             const gchar *password);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyPing.html0000644000175000017500000001064312051456453026636 0ustar00wjtwjt00000000000000 WockyPing

    WockyPing

    WockyPing — support for pings/keepalives

    Synopsis

    struct              WockyPingClass;
    GQuark              wocky_ping_error_quark              (void);
    WockyPing *         wocky_ping_new                      (WockyC2SPorter *porter,
                                                             guint interval);
    

    Description

    Support for XEP-0199 pings.

    Details

    struct WockyPingClass

    struct WockyPingClass {
    };
    

    The class of a WockyPing.


    wocky_ping_error_quark ()

    GQuark              wocky_ping_error_quark              (void);

    wocky_ping_new ()

    WockyPing *         wocky_ping_new                      (WockyC2SPorter *porter,
                                                             guint interval);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-node-enumtypes.html0000644000175000017500000000474412051456453032335 0ustar00wjtwjt00000000000000 wocky-pubsub-node-enumtypes

    wocky-pubsub-node-enumtypes

    wocky-pubsub-node-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyC2SPorter.html0000644000175000017500000010732112051456453027524 0ustar00wjtwjt00000000000000 WockyC2SPorter

    WockyC2SPorter

    WockyC2SPorter — Wrapper around a WockyXmppConnection providing a higher level API.

    Synopsis

    struct              WockyC2SPorterClass;
    void                wocky_c2s_porter_enable_power_saving_mode
                                                            (WockyC2SPorter *porter,
                                                             gboolean enable);
    WockyPorter *       wocky_c2s_porter_new                (WockyXmppConnection *connection,
                                                             const gchar *full_jid);
    guint               wocky_c2s_porter_register_handler_from_server
                                                            (WockyC2SPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             ...);
    guint               wocky_c2s_porter_register_handler_from_server_by_stanza
                                                            (WockyC2SPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             WockyStanza *stanza);
    guint               wocky_c2s_porter_register_handler_from_server_va
                                                            (WockyC2SPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             va_list ap);
    void                wocky_c2s_porter_send_whitespace_ping_async
                                                            (WockyC2SPorter *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_c2s_porter_send_whitespace_ping_finish
                                                            (WockyC2SPorter *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    

    Description

    Sends and receives WockyStanza from an underlying WockyXmppConnection.

    Details

    struct WockyC2SPorterClass

    struct WockyC2SPorterClass {
    };
    

    The class of a WockyC2SPorter.


    wocky_c2s_porter_enable_power_saving_mode ()

    void                wocky_c2s_porter_enable_power_saving_mode
                                                            (WockyC2SPorter *porter,
                                                             gboolean enable);

    Enable or disable power saving. In power saving mode, Wocky will attempt to queue "uninteresting" stanza until it is either manually flushed, until important stanza arrives, or until the power saving mode is disabled.

    Queueable stanzas are:

    • <presence/> and <presence type="unavailable"/>;
    • PEP updates for a hardcoded list of namespaces.

    Whenever stanza is handled, all previously queued stanzas (if any) are handled as well, in the order they arrived. This preserves stanza ordering.

    Note that exiting the power saving mode will immediately handle any queued stanzas.

    porter :

    a WockyC2SPorter

    enable :

    A boolean specifying whether power saving mode should be used

    wocky_c2s_porter_new ()

    WockyPorter *       wocky_c2s_porter_new                (WockyXmppConnection *connection,
                                                             const gchar *full_jid);

    Convenience function to create a new WockyC2SPorter.

    connection :

    WockyXmppConnection which will be used to receive and send WockyStanza

    full_jid :

    the full JID of the user

    Returns :

    a new WockyPorter.

    wocky_c2s_porter_register_handler_from_server ()

    guint               wocky_c2s_porter_register_handler_from_server
                                                            (WockyC2SPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             ...);

    Registers a handler for incoming stanzas from the local user's server; that is, stanzas with no "from" attribute, or where the sender is the user's own bare or full JID.

    For example, to register a handler for roster pushes, call:

    1
    2
    3
    4
    5
    6
    id = wocky_c2s_porter_register_handler_from_server (porter,
      WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_SET,
      WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, roster_push_received_cb, NULL,
      '(',
        "query", ':', WOCKY_XMPP_NS_ROSTER,
      ')', NULL);

    self :

    A WockyC2SPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    ... :

    a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_c2s_porter_register_handler_from_server_by_stanza ()

    guint               wocky_c2s_porter_register_handler_from_server_by_stanza
                                                            (WockyC2SPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             WockyStanza *stanza);

    A WockyStanza version of wocky_c2s_porter_register_handler_from_server(); see that function for more details.

    self :

    A WockyC2SPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    stanza :

    a WockyStanza. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_c2s_porter_register_handler_from_server_va ()

    guint               wocky_c2s_porter_register_handler_from_server_va
                                                            (WockyC2SPorter *self,
                                                             WockyStanzaType type,
                                                             WockyStanzaSubType sub_type,
                                                             guint priority,
                                                             WockyPorterHandlerFunc callback,
                                                             gpointer user_data,
                                                             va_list ap);

    A va_list version of wocky_c2s_porter_register_handler_from_server(); see that function for more details.

    self :

    A WockyC2SPorter instance (passed to callback).

    type :

    The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

    sub_type :

    The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

    priority :

    a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

    callback :

    A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

    user_data :

    Passed to callback.

    ap :

    a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

    Returns :

    a non-zero ID for use with wocky_porter_unregister_handler().

    wocky_c2s_porter_send_whitespace_ping_async ()

    void                wocky_c2s_porter_send_whitespace_ping_async
                                                            (WockyC2SPorter *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Request asynchronous sending of a whitespace ping. When the operation is finished callback will be called. You can then call wocky_c2s_porter_send_whitespace_ping_finish() to get the result of the operation. No pings are sent if there are already other stanzas or pings being sent when this function is called; it would be useless.

    self :

    a WockyC2SPorter

    cancellable :

    optional GCancellable object, NULL to ignore.

    callback :

    callback to call when the request is satisfied.

    user_data :

    the data to pass to callback function.

    wocky_c2s_porter_send_whitespace_ping_finish ()

    gboolean            wocky_c2s_porter_send_whitespace_ping_finish
                                                            (WockyC2SPorter *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes sending a whitespace ping.

    self :

    a WockyC2SPorter

    result :

    a GAsyncResult.

    error :

    a GError location to store the error occuring, or NULL to ignore.

    Returns :

    TRUE if the ping was succesfully sent, FALSE on error.
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/object-tree.html0000644000175000017500000001271712051456453026001 0ustar00wjtwjt00000000000000 Object Hierarchy telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-xmpp-error-enumtypes.html0000644000175000017500000000474612051456453032227 0ustar00wjtwjt00000000000000 wocky-xmpp-error-enumtypes

    wocky-xmpp-error-enumtypes

    wocky-xmpp-error-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-scram.html0000644000175000017500000001000712051456453030115 0ustar00wjtwjt00000000000000 wocky-sasl-scram

    wocky-sasl-scram

    wocky-sasl-scram

    Synopsis

    WockySaslScram *    wocky_sasl_scram_new                (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *password);
    

    Description

    Details

    wocky_sasl_scram_new ()

    WockySaslScram *    wocky_sasl_scram_new                (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *password);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyJabberAuth.html0000644000175000017500000002671312051456453027755 0ustar00wjtwjt00000000000000 WockyJabberAuth

    WockyJabberAuth

    WockyJabberAuth

    Synopsis

    struct              WockyJabberAuthClass;
    void                wocky_jabber_auth_add_handler       (WockyJabberAuth *self,
                                                             WockyAuthHandler *handler);
    void                wocky_jabber_auth_authenticate_async
                                                            (WockyJabberAuth *self,
                                                             gboolean allow_plain,
                                                             gboolean is_secure,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_jabber_auth_authenticate_finish
                                                            (WockyJabberAuth *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    WockyJabberAuth *   wocky_jabber_auth_new               (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *resource,
                                                             const gchar *password,
                                                             WockyXmppConnection *connection,
                                                             WockyAuthRegistry *auth_registry);
    

    Description

    Details

    struct WockyJabberAuthClass

    struct WockyJabberAuthClass {
    };
    

    The class of a WockyJabberAuth.


    wocky_jabber_auth_add_handler ()

    void                wocky_jabber_auth_add_handler       (WockyJabberAuth *self,
                                                             WockyAuthHandler *handler);

    wocky_jabber_auth_authenticate_async ()

    void                wocky_jabber_auth_authenticate_async
                                                            (WockyJabberAuth *self,
                                                             gboolean allow_plain,
                                                             gboolean is_secure,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_jabber_auth_authenticate_finish ()

    gboolean            wocky_jabber_auth_authenticate_finish
                                                            (WockyJabberAuth *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_jabber_auth_new ()

    WockyJabberAuth *   wocky_jabber_auth_new               (const gchar *server,
                                                             const gchar *username,
                                                             const gchar *resource,
                                                             const gchar *password,
                                                             WockyXmppConnection *connection,
                                                             WockyAuthRegistry *auth_registry);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/index.sgml0000644000175000017500000036566112051456453024714 0ustar00wjtwjt00000000000000 telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyPubsubService.html0000644000175000017500000011157512051456453030530 0ustar00wjtwjt00000000000000 WockyPubsubService

    WockyPubsubService

    WockyPubsubService

    Synopsis

    #define             WOCKY_PUBSUB_SERVICE_ERROR
    struct              WockyPubsubServiceClass;
    enum                WockyPubsubServiceError;
                        WockyPubsubSubscription;
    enum                WockyPubsubSubscriptionState;
    void                wocky_pubsub_service_create_node_async
                                                            (WockyPubsubService *self,
                                                             const gchar *name,
                                                             WockyDataForm *config,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyPubsubNode *   wocky_pubsub_service_create_node_finish
                                                            (WockyPubsubService *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    WockyPubsubNode *   wocky_pubsub_service_ensure_node    (WockyPubsubService *self,
                                                             const gchar *name);
    GQuark              wocky_pubsub_service_error_quark    (void);
    void                wocky_pubsub_service_get_default_node_configuration_async
                                                            (WockyPubsubService *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    WockyDataForm *     wocky_pubsub_service_get_default_node_configuration_finish
                                                            (WockyPubsubService *self,
                                                             GAsyncResult *result,
                                                             GError **error);
    WockyPubsubNode *   wocky_pubsub_service_lookup_node    (WockyPubsubService *self,
                                                             const gchar *name);
    WockyPubsubService * wocky_pubsub_service_new           (WockySession *session,
                                                             const gchar *jid);
    void                wocky_pubsub_service_retrieve_subscriptions_async
                                                            (WockyPubsubService *self,
                                                             WockyPubsubNode *node,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_pubsub_service_retrieve_subscriptions_finish
                                                            (WockyPubsubService *self,
                                                             GAsyncResult *result,
                                                             GList **subscriptions,
                                                             GError **error);
    WockyPubsubSubscription * wocky_pubsub_subscription_copy
                                                            (WockyPubsubSubscription *sub);
    void                wocky_pubsub_subscription_free      (WockyPubsubSubscription *sub);
    GList *             wocky_pubsub_subscription_list_copy (GList *subs);
    void                wocky_pubsub_subscription_list_free (GList *subs);
    WockyPubsubSubscription * wocky_pubsub_subscription_new (WockyPubsubNode *node,
                                                             const gchar *jid,
                                                             WockyPubsubSubscriptionState state,
                                                             const gchar *subid);
    

    Object Hierarchy

      GEnum
       +----WockyPubsubServiceError
    
      GBoxed
       +----WockyPubsubSubscription
    
      GEnum
       +----WockyPubsubSubscriptionState
    

    Description

    Details

    WOCKY_PUBSUB_SERVICE_ERROR

    #define WOCKY_PUBSUB_SERVICE_ERROR (wocky_pubsub_service_error_quark ())
    

    struct WockyPubsubServiceClass

    struct WockyPubsubServiceClass {
      GObjectClass parent_class;
      GType node_object_type;
    };
    

    The class structure for the WockyPubsubService type.

    GObjectClass parent_class;

    parent

    GType node_object_type;

    the subtype of WOCKY_TYPE_PUBSUB_NODE to be created by wocky_pubsub_service_ensure_node()

    enum WockyPubsubServiceError

    typedef enum {
      WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY,
    } WockyPubsubServiceError;
    

    WockyPubsubService specific errors.

    WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY

    A wrong reply was received

    WockyPubsubSubscription

    typedef struct {
        WockyPubsubNode *node;
        gchar *jid;
        WockyPubsubSubscriptionState state;
        gchar *subid;
    } WockyPubsubSubscription;
    

    Represents a subscription to a node on a pubsub service, as seen when listing your own subscriptions on a service with wocky_pubsub_service_retrieve_subscriptions_async() or subscribing to a node with wocky_pubsub_node_subscribe_async().

    WockyPubsubNode *node;

    a PubSub node

    gchar *jid;

    the JID which is subscribed to node. This may be a bare JID, or a full JID with a resource, depending on which was specified when subscribing to node. See XEP-0060 §6.1 Subscribe to a Node

    WockyPubsubSubscriptionState state;

    the state of this subscription

    gchar *subid;

    a unique identifier for this subscription, if a JID is subscribed to a node multiple times, or NULL if there is no such identifier. See XEP-0060 §6.1.6 “Multiple Subscriptions”

    enum WockyPubsubSubscriptionState

    typedef enum {
        WOCKY_PUBSUB_SUBSCRIPTION_NONE,
        WOCKY_PUBSUB_SUBSCRIPTION_PENDING,
        WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED,
        WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED
    } WockyPubsubSubscriptionState;
    

    Describes the state of a subscription to a node. Definitions are taken from XEP-0060 §4.2.

    WOCKY_PUBSUB_SUBSCRIPTION_NONE

    The node MUST NOT send event notifications or payloads to the Entity.

    WOCKY_PUBSUB_SUBSCRIPTION_PENDING

    An entity has requested to subscribe to a node and the request has not yet been approved by a node owner. The node MUST NOT send event notifications or payloads to the entity while it is in this state.

    WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED

    An entity has subscribed but its subscription options have not yet been configured. The node MAY send event notifications or payloads to the entity while it is in this state. The service MAY timeout unconfigured subscriptions.

    WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED

    An entity is subscribed to a node. The node MUST send all event notifications (and, if configured, payloads) to the entity while it is in this state (subject to subscriber configuration and content filtering).

    wocky_pubsub_service_create_node_async ()

    void                wocky_pubsub_service_create_node_async
                                                            (WockyPubsubService *self,
                                                             const gchar *name,
                                                             WockyDataForm *config,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_pubsub_service_create_node_finish ()

    WockyPubsubNode *   wocky_pubsub_service_create_node_finish
                                                            (WockyPubsubService *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_pubsub_service_ensure_node ()

    WockyPubsubNode *   wocky_pubsub_service_ensure_node    (WockyPubsubService *self,
                                                             const gchar *name);

    Fetches or creates an object representing a node on the pubsub service. Note that this does not ensure that a node exists on the server; it merely ensures a local representation.

    self :

    a pubsub service

    name :

    the name of a node on self

    Returns :

    a new reference to an object representing a node named name on self

    wocky_pubsub_service_error_quark ()

    GQuark              wocky_pubsub_service_error_quark    (void);

    wocky_pubsub_service_get_default_node_configuration_async ()

    void                wocky_pubsub_service_get_default_node_configuration_async
                                                            (WockyPubsubService *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_pubsub_service_get_default_node_configuration_finish ()

    WockyDataForm *     wocky_pubsub_service_get_default_node_configuration_finish
                                                            (WockyPubsubService *self,
                                                             GAsyncResult *result,
                                                             GError **error);

    wocky_pubsub_service_lookup_node ()

    WockyPubsubNode *   wocky_pubsub_service_lookup_node    (WockyPubsubService *self,
                                                             const gchar *name);

    Fetches an object representing a node on a pubsub service, if the object already exists; if not, returns NULL. Note that this does not check whether a node exists on the server; it only checks for a local representation.

    self :

    a pubsub service

    name :

    the name of a node on self

    Returns :

    a borrowed reference to a node, or NULL

    wocky_pubsub_service_new ()

    WockyPubsubService * wocky_pubsub_service_new           (WockySession *session,
                                                             const gchar *jid);

    wocky_pubsub_service_retrieve_subscriptions_async ()

    void                wocky_pubsub_service_retrieve_subscriptions_async
                                                            (WockyPubsubService *self,
                                                             WockyPubsubNode *node,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    wocky_pubsub_service_retrieve_subscriptions_finish ()

    gboolean            wocky_pubsub_service_retrieve_subscriptions_finish
                                                            (WockyPubsubService *self,
                                                             GAsyncResult *result,
                                                             GList **subscriptions,
                                                             GError **error);

    wocky_pubsub_subscription_copy ()

    WockyPubsubSubscription * wocky_pubsub_subscription_copy
                                                            (WockyPubsubSubscription *sub);

    wocky_pubsub_subscription_free ()

    void                wocky_pubsub_subscription_free      (WockyPubsubSubscription *sub);

    wocky_pubsub_subscription_list_copy ()

    GList *             wocky_pubsub_subscription_list_copy (GList *subs);

    wocky_pubsub_subscription_list_free ()

    void                wocky_pubsub_subscription_list_free (GList *subs);

    wocky_pubsub_subscription_new ()

    WockyPubsubSubscription * wocky_pubsub_subscription_new (WockyPubsubNode *node,
                                                             const gchar *jid,
                                                             WockyPubsubSubscriptionState state,
                                                             const gchar *subid);
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-connector-enumtypes.html0000644000175000017500000000467012051456453032102 0ustar00wjtwjt00000000000000 wocky-connector-enumtypes

    wocky-connector-enumtypes

    wocky-connector-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-WockyMetaPorter.html0000644000175000017500000005767612051456453030044 0ustar00wjtwjt00000000000000 WockyMetaPorter

    WockyMetaPorter

    WockyMetaPorter

    Synopsis

    #define             WOCKY_META_PORTER_ERROR
    struct              WockyMetaPorterClass;
    enum                WockyMetaPorterError;
    GSocketConnection * wocky_meta_porter_borrow_connection (WockyMetaPorter *porter,
                                                             WockyLLContact *contact);
    GQuark              wocky_meta_porter_error_quark       (void);
    guint16             wocky_meta_porter_get_port          (WockyMetaPorter *porter);
    void                wocky_meta_porter_hold              (WockyMetaPorter *porter,
                                                             WockyContact *contact);
    WockyPorter *       wocky_meta_porter_new               (const gchar *jid,
                                                             WockyContactFactory *contact_factory);
    void                wocky_meta_porter_open_async        (WockyMetaPorter *porter,
                                                             WockyLLContact *contact,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            wocky_meta_porter_open_finish       (WockyMetaPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);
    void                wocky_meta_porter_set_jid           (WockyMetaPorter *porter,
                                                             const gchar *jid);
    void                wocky_meta_porter_unhold            (WockyMetaPorter *porter,
                                                             WockyContact *contact);
    

    Description

    Details

    WOCKY_META_PORTER_ERROR

    #define WOCKY_META_PORTER_ERROR (wocky_meta_porter_error_quark ())
    

    struct WockyMetaPorterClass

    struct WockyMetaPorterClass {
      GObjectClass parent_class;
    };
    

    enum WockyMetaPorterError

    typedef enum {
      WOCKY_META_PORTER_ERROR_NO_CONTACT_ADDRESS,
      WOCKY_META_PORTER_ERROR_FAILED_TO_CLOSE,
    } WockyMetaPorterError;
    

    wocky_meta_porter_borrow_connection ()

    GSocketConnection * wocky_meta_porter_borrow_connection (WockyMetaPorter *porter,
                                                             WockyLLContact *contact);

    Borrow the GSocketConnection of the porter to contact, if one exists, otherwise NULL will be returned.

    Note that the connection returned should be reffed using g_object_ref() if it needs to be kept. However, it will still be operated on by the underlying WockyXmppConnection object so can close spontaneously unless wocky_meta_porter_hold() is called with contact.

    porter :

    a WockyMetaPorter

    contact :

    the WockyContact

    Returns :

    the GSocketConnection or NULL if no connection is open

    wocky_meta_porter_error_quark ()

    GQuark              wocky_meta_porter_error_quark       (void);

    wocky_meta_porter_get_port ()

    guint16             wocky_meta_porter_get_port          (WockyMetaPorter *porter);

    Returns the port porter is listening in on for new incoming XMPP connections, or 0 if it has not been started yet with wocky_porter_start().

    porter :

    a WockyMetaPorter

    Returns :

    the port porter is listening in on for new incoming XMPP connections, or 0 if it has not been started.

    wocky_meta_porter_hold ()

    void                wocky_meta_porter_hold              (WockyMetaPorter *porter,
                                                             WockyContact *contact);

    Increases the hold count of the porter to contact by one. This means that if there is a connection open to contact then it will not disconnected after a timeout. Note that calling this function does not mean a connection will be opened. The hold count on a contact survives across connections.

    To decrement the hold count of the porter to contact, one must call wocky_meta_porter_unhold().

    porter :

    a WockyMetaPorter

    contact :

    a WockyContact

    wocky_meta_porter_new ()

    WockyPorter *       wocky_meta_porter_new               (const gchar *jid,
                                                             WockyContactFactory *contact_factory);

    Convenience function to create a new WockyMetaPorter object. The JID can be set later by using wocky_meta_porter_set_jid().

    jid :

    the JID of the local user, or NULL

    contact_factory :

    a WockyContactFactory object

    Returns :

    a new WockyMetaPorter

    wocky_meta_porter_open_async ()

    void                wocky_meta_porter_open_async        (WockyMetaPorter *porter,
                                                             WockyLLContact *contact,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

    Make an asynchronous request to open a connection to contact if one is not already open. The hold count of the porter to contact will be incrememented and so after completion wocky_meta_porter_unhold() should be called on contact to release the hold.

    When the request is complete, callback will be called and the user should call wocky_meta_porter_open_finish() to finish the request.

    porter :

    a WockyMetaPorter

    contact :

    the WockyLLContact

    cancellable :

    an optional GCancellable, or NULL

    callback :

    a callback to be called

    user_data :

    data for callback

    wocky_meta_porter_open_finish ()

    gboolean            wocky_meta_porter_open_finish       (WockyMetaPorter *porter,
                                                             GAsyncResult *result,
                                                             GError **error);

    Finishes an asynchronous request to open a connection if one is not already open. See wocky_meta_porter_open_async() for more details.

    porter :

    a WockyMetaPorter

    result :

    the GAsyncResult

    error :

    an optional GError location to store an error message

    Returns :

    TRUE if the operation was a success, otherwise FALSE

    wocky_meta_porter_set_jid ()

    void                wocky_meta_porter_set_jid           (WockyMetaPorter *porter,
                                                             const gchar *jid);

    Changes the local JID according to porter. Note that this function can only be called once, and only if NULL was passed to wocky_meta_porter_new() when creating porter. Calling it again will be a no-op.

    porter :

    a WockyMetaPorter

    jid :

    a new JID

    wocky_meta_porter_unhold ()

    void                wocky_meta_porter_unhold            (WockyMetaPorter *porter,
                                                             WockyContact *contact);

    Decreases the hold count of the porter to contact by one. This means that if there is a connection open to contact and the hold count is zero, a connection timeout will be started.

    porter :

    a WockyMetaPorter

    contact :

    a WockyContact
    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/left.png0000644000175000017500000000071312051456453024341 0ustar00wjtwjt00000000000000PNG  IHDRw=bKGD pHYs  ~tIME1&[(XIDATx!OPE*ID%~ꊯ"p'ŏ`sܖrKf hmiIz}ܯI.p\`x l?l[,Hk<#c%\AUx[S7n6rzEs1j@NL$ݤi0 5/}\EKIo͓$a0jdFbkIAh>WlC'?tk;|/t*INZ^`y4Nr]׮ J<ڐt`X1@p䀸dZ')hK $V?%]+LsgUK"w53OIENDB`telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/html/wocky-wocky-data-form-enumtypes.html0000644000175000017500000000466212051456453031763 0ustar00wjtwjt00000000000000 wocky-data-form-enumtypes

    wocky-data-form-enumtypes

    wocky-data-form-enumtypes

    Synopsis

    
    

    Description

    Details

    telepathy-salut-0.8.1/lib/ext/wocky/docs/reference/Makefile.in0000644000175000017500000005754712051456053024017 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gtk-doc.make subdir = docs/reference ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.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 = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = wocky # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR = $(abs_top_srcdir)/wocky $(abs_top_builddir)/wocky # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" # If we're building out of tree, we need to scan wocky/ under the builddir as # well as under the sourcedir (which is specified above with DOC_SOURCE_DIR) to # pick up the enumtypes. # # If we're building in-tree, well, we'd just better hope gtkdoc doesn't mind # scanning stuff twice. SCAN_OPTIONS = --rebuild-types --rebuild-sections \ --source-dir=$(abs_top_builddir)/wocky # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml \ --source-dir=$(abs_top_builddir)/wocky # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/wocky/*.h $(top_builddir)/wocky/*.h CFILE_GLOB = $(top_srcdir)/wocky/*.c $(top_builddir)/wocky/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS = -I$(top_srcdir) -I$(top_builddir) @GLIB_CFLAGS@ @SQLITE_CFLAGS@ GTKDOC_LIBS = @GLIB_LIBS@ @SQLITE_LIBS@ $(top_builddir)/wocky/libwocky.la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = wocky-sections.txt wocky.types all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/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_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### xml #### sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) @echo ' DOC Building XML' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) # 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: telepathy-salut-0.8.1/lib/ext/wocky/docs/Makefile.in0000644000175000017500000004541312051456053022046 0ustar00wjtwjt00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.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 = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = reference all: all-recursive .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: telepathy-salut-0.8.1/lib/ext/wocky/INSTALL0000644000175000017500000003660012051456054020101 0ustar00wjtwjt00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. telepathy-salut-0.8.1/lib/ext/wocky/ChangeLog0000644000175000017500000000000011720473445020610 0ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/install-sh0000755000175000017500000003325612051456053021057 0ustar00wjtwjt00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false 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: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -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. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; 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 if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? 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 "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # 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: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # 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 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 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. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-salut-0.8.1/lib/ext/wocky/rules/0000755000175000017500000000000012051456451020176 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/rules/lcov.mak0000644000175000017500000000221111720473445021633 0ustar00wjtwjt00000000000000COVERAGE_DIR=coverage if HAVE_LCOV # run lcov from scratch lcov: $(MAKE) lcov-run $(MAKE) lcov-report else lcov: @echo "lcov not found or lacking --compat-libtool support" @exit 1 endif # reset run coverage tests lcov-run: @-rm -rf $(COVERAGE_DIR) @-find . -name "*.gcda" -exec rm {} \; -$(MAKE) check # generate report based on current coverage data lcov-report: @mkdir -p $(COVERAGE_DIR) @lcov --quiet --compat-libtool --directory . --capture --output-file $(COVERAGE_DIR)/lcov.info @lcov --quiet --compat-libtool -l $(COVERAGE_DIR)/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > $(COVERAGE_DIR)/remove @lcov --quiet --compat-libtool -l $(COVERAGE_DIR)/lcov.info | grep "tests/" | cut -d: -f1 >> $(COVERAGE_DIR)/remove @lcov --quiet --compat-libtool -r $(COVERAGE_DIR)/lcov.info `cat $(COVERAGE_DIR)/remove` > $(COVERAGE_DIR)/lcov.cleaned.info @rm $(COVERAGE_DIR)/remove @mv $(COVERAGE_DIR)/lcov.cleaned.info $(COVERAGE_DIR)/lcov.info @genhtml -t "$(PACKAGE_STRING)" -o $(COVERAGE_DIR) $(COVERAGE_DIR)/lcov.info @(find $(COVERAGE_DIR) -name \*.html -exec \ sed -i -e 's|charset=ISO-8859-1">|charset=UTF-8">|g' {} \;) telepathy-salut-0.8.1/lib/ext/wocky/wocky/0000755000175000017500000000000012051456452020201 5ustar00wjtwjt00000000000000telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-jabber-auth.c0000644000175000017500000004340012051446215023660 0ustar00wjtwjt00000000000000/* * wocky-jabber-auth.c - Source for WockyJabberAuth * Copyright (C) 2009-2010 Collabora Ltd. * * 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 */ #include #include #include #include "wocky-jabber-auth.h" #include "wocky-signals-marshal.h" #include "wocky-namespaces.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" G_DEFINE_TYPE(WockyJabberAuth, wocky_jabber_auth, G_TYPE_OBJECT) enum { PROP_SESSION_ID = 1, PROP_USERNAME, PROP_RESOURCE, PROP_PASSWORD, PROP_CONNECTION, PROP_AUTH_REGISTRY, }; /* private structure */ struct _WockyJabberAuthPrivate { gboolean dispose_has_run; WockyXmppConnection *connection; gchar *username; gchar *resource; gchar *password; gchar *session_id; GCancellable *cancel; GSimpleAsyncResult *result; WockyAuthRegistry *auth_registry; gboolean allow_plain; gboolean is_secure; }; static void wocky_jabber_auth_init (WockyJabberAuth *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_JABBER_AUTH, WockyJabberAuthPrivate); } static void wocky_jabber_auth_dispose (GObject *object); static void wocky_jabber_auth_finalize (GObject *object); static void wocky_jabber_auth_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_free (priv->session_id); priv->session_id = g_value_dup_string (value); break; case PROP_USERNAME: g_free (priv->username); priv->username = g_value_dup_string (value); break; case PROP_RESOURCE: g_free (priv->resource); priv->resource = g_value_dup_string (value); break; case PROP_PASSWORD: g_free (priv->password); priv->password = g_value_dup_string (value); break; case PROP_CONNECTION: priv->connection = g_value_dup_object (value); break; case PROP_AUTH_REGISTRY: if (g_value_get_object (value) == NULL) priv->auth_registry = wocky_auth_registry_new (); else priv->auth_registry = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jabber_auth_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_value_set_string (value, priv->session_id); break; case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_AUTH_REGISTRY: g_value_set_object (value, priv->auth_registry); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jabber_auth_class_init (WockyJabberAuthClass *wocky_jabber_auth_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_jabber_auth_class); GParamSpec *spec; g_type_class_add_private (wocky_jabber_auth_class, sizeof (WockyJabberAuthPrivate)); object_class->set_property = wocky_jabber_auth_set_property; object_class->get_property = wocky_jabber_auth_get_property; spec = g_param_spec_string ("session-id", "session-id", "The XMPP session ID", NULL, G_PARAM_READWRITE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_SESSION_ID, spec); spec = g_param_spec_string ("username", "username", "The username to authenticate with", NULL, G_PARAM_WRITABLE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_USERNAME, spec); spec = g_param_spec_string ("resource", "resource", "The XMPP resource to bind to", NULL, G_PARAM_WRITABLE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_RESOURCE, spec); spec = g_param_spec_string ("password", "password", "The password to authenticate with", NULL, G_PARAM_WRITABLE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_PASSWORD, spec); spec = g_param_spec_object ("connection", "connection", "The Xmpp connection to user", WOCKY_TYPE_XMPP_CONNECTION, G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_CONNECTION, spec); spec = g_param_spec_object ("auth-registry", "Authentication Registry", "Authentication Registry", WOCKY_TYPE_AUTH_REGISTRY, G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_AUTH_REGISTRY, spec); object_class->dispose = wocky_jabber_auth_dispose; object_class->finalize = wocky_jabber_auth_finalize; } void wocky_jabber_auth_dispose (GObject *object) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; if (priv->connection != NULL) g_object_unref (priv->connection); if (priv->auth_registry != NULL) g_object_unref (priv->auth_registry); if (G_OBJECT_CLASS (wocky_jabber_auth_parent_class)->dispose) G_OBJECT_CLASS (wocky_jabber_auth_parent_class)->dispose (object); } void wocky_jabber_auth_finalize (GObject *object) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; /* free any data held directly by the object here */ g_free (priv->session_id); g_free (priv->username); g_free (priv->resource); g_free (priv->password); G_OBJECT_CLASS (wocky_jabber_auth_parent_class)->finalize (object); } static void auth_reset (WockyJabberAuth *self) { WockyJabberAuthPrivate *priv = self->priv; g_free (priv->session_id); priv->session_id = NULL; if (priv->connection != NULL) { g_object_unref (priv->connection); priv->connection = NULL; } if (priv->cancel != NULL) { g_object_unref (priv->cancel); priv->cancel = NULL; } } static void auth_succeeded (WockyJabberAuth *self) { WockyJabberAuthPrivate *priv = self->priv; GSimpleAsyncResult *r; DEBUG ("Authentication succeeded"); auth_reset (self); r = priv->result; priv->result = NULL; g_simple_async_result_complete (r); g_object_unref (r); } static void auth_failed (WockyJabberAuth *self, gint code, const gchar *format, ...) { gchar *message; va_list args; GSimpleAsyncResult *r; GError *error = NULL; WockyJabberAuthPrivate *priv = self->priv; auth_reset (self); va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); DEBUG ("Authentication failed!: %s", message); r = priv->result; priv->result = NULL; error = g_error_new_literal (WOCKY_AUTH_ERROR, code, message); g_simple_async_result_set_from_error (r, error); wocky_auth_registry_failure (priv->auth_registry, error); g_simple_async_result_complete (r); g_object_unref (r); g_error_free (error); g_free (message); } static gboolean stream_error (WockyJabberAuth *self, WockyStanza *stanza) { WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; if (stanza == NULL) { auth_failed (self, WOCKY_AUTH_ERROR_CONNRESET, "Disconnected"); return TRUE; } wocky_stanza_get_type_info (stanza, &type, NULL); if (type == WOCKY_STANZA_TYPE_STREAM_ERROR) { GError *error = wocky_xmpp_stream_error_from_node ( wocky_stanza_get_top_node (stanza)); auth_failed (self, WOCKY_AUTH_ERROR_STREAM, "%s: %s", wocky_enum_to_nick (WOCKY_TYPE_XMPP_STREAM_ERROR, error->code), error->message); g_error_free (error); return TRUE; } return FALSE; } WockyJabberAuth * wocky_jabber_auth_new (const gchar *session_id, const gchar *username, const gchar *resource, const gchar *password, WockyXmppConnection *connection, WockyAuthRegistry *auth_registry) { return g_object_new (WOCKY_TYPE_JABBER_AUTH, "session-id", session_id, "username", username, "resource", resource, "password", password, "connection", connection, "auth-registry", auth_registry, NULL); } gboolean wocky_jabber_auth_authenticate_finish (WockyJabberAuth *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_jabber_auth_authenticate_async); } static void wocky_jabber_auth_success_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; GError *error = NULL; if (!wocky_auth_registry_success_finish (priv->auth_registry, res, &error)) { auth_failed (self, error->code, error->message); g_error_free (error); } else { auth_succeeded (self); } } static void jabber_auth_reply (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; WockyStanza *reply = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType sub = WOCKY_STANZA_SUB_TYPE_NONE; DEBUG (""); reply = wocky_xmpp_connection_recv_stanza_finish (conn, res, &error); if (stream_error (self, reply)) return; wocky_stanza_get_type_info (reply, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { auth_failed (self, WOCKY_AUTH_ERROR_INVALID_REPLY, "Jabber Auth Reply: Response Invalid"); goto out; } switch (sub) { WockyAuthError code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (reply, NULL, &error, NULL, NULL); switch (error->code) { case WOCKY_XMPP_ERROR_NOT_AUTHORIZED: code = WOCKY_AUTH_ERROR_NOT_AUTHORIZED; break; case WOCKY_XMPP_ERROR_CONFLICT: code = WOCKY_AUTH_ERROR_RESOURCE_CONFLICT; break; case WOCKY_XMPP_ERROR_NOT_ACCEPTABLE: code = WOCKY_AUTH_ERROR_NO_CREDENTIALS; break; default: code = WOCKY_AUTH_ERROR_FAILURE; } auth_failed (self, code, "Authentication failed: %s", error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: wocky_auth_registry_success_async (priv->auth_registry, wocky_jabber_auth_success_cb, self); break; default: auth_failed (self, WOCKY_AUTH_ERROR_INVALID_REPLY, "Bizarre response to Jabber Auth request"); break; } out: g_object_unref (reply); } static void jabber_auth_query (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (conn, res, &error)) { auth_failed (self, error->code, "Jabber Auth IQ Set: %s", error->message); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (conn, priv->cancel, jabber_auth_reply, user_data); } static void wocky_jabber_auth_start_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; gchar *iqid; WockyStanza *iq; const gchar *auth_field; GError *error = NULL; WockyAuthRegistryStartData *start_data = NULL; if (!wocky_auth_registry_start_auth_finish (priv->auth_registry, res, &start_data, &error)) { auth_failed (self, error->code, error->message); g_error_free (error); return; } g_assert (start_data->mechanism != NULL); g_assert (start_data->initial_response != NULL); if (g_strcmp0 (start_data->mechanism, "X-WOCKY-JABBER-PASSWORD") == 0) auth_field = "password"; else auth_field = "digest"; iqid = wocky_xmpp_connection_new_id (conn); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '@', "id", iqid, '(', "query", ':', WOCKY_JABBER_NS_AUTH, '(', "username", '$', priv->username, ')', '(', auth_field, '$', start_data->initial_response->str, ')', '(', "resource", '$', priv->resource, ')', ')', NULL); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancel, jabber_auth_query, self); g_free (iqid); g_object_unref (iq); wocky_auth_registry_start_data_free (start_data); } static void jabber_auth_fields (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; WockyStanza *fields = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType sub = WOCKY_STANZA_SUB_TYPE_NONE; fields = wocky_xmpp_connection_recv_stanza_finish (conn, res, &error); if (stream_error (self, fields)) return; wocky_stanza_get_type_info (fields, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { auth_failed (self, WOCKY_AUTH_ERROR_FAILURE, "Jabber Auth Init: Response Invalid"); goto out; } switch (sub) { WockyNode *node = NULL; WockyAuthError code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (fields, NULL, &error, NULL, NULL); if (error->code == WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE) code = WOCKY_AUTH_ERROR_NOT_SUPPORTED; else code = WOCKY_AUTH_ERROR_FAILURE; auth_failed (self, code, "Jabber Auth: %s %s", wocky_xmpp_error_string (error->code), error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: node = wocky_stanza_get_top_node (fields); node = wocky_node_get_child_ns (node, "query", WOCKY_JABBER_NS_AUTH); if ((node != NULL) && (wocky_node_get_child (node, "resource") != NULL) && (wocky_node_get_child (node, "username") != NULL)) { GSList *mechanisms = NULL; if (wocky_node_get_child (node, "password") != NULL) mechanisms = g_slist_append (mechanisms, WOCKY_AUTH_MECH_JABBER_PASSWORD); if (wocky_node_get_child (node, "digest") != NULL) mechanisms = g_slist_append (mechanisms, WOCKY_AUTH_MECH_JABBER_DIGEST); wocky_auth_registry_start_auth_async (priv->auth_registry, mechanisms, priv->allow_plain, priv->is_secure, priv->username, priv->password, NULL, priv->session_id, wocky_jabber_auth_start_cb, self); g_slist_free (mechanisms); } break; default: auth_failed (self, WOCKY_AUTH_ERROR_FAILURE, "Bizarre response to Jabber Auth request"); break; } out: g_object_unref (fields); } static void jabber_auth_init_sent (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (conn, res, &error)) { auth_failed (self, error->code, error->message); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (conn, priv->cancel, jabber_auth_fields, user_data); } /* Initiate jabber auth. features should contain the stream features stanza as * receiver from the session_id */ void wocky_jabber_auth_authenticate_async (WockyJabberAuth *self, gboolean allow_plain, gboolean is_secure, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; gchar *id = wocky_xmpp_connection_new_id (conn); WockyStanza *iq = NULL; DEBUG (""); priv->allow_plain = allow_plain; priv->is_secure = is_secure; priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_jabber_auth_authenticate_async); if (cancellable != NULL) priv->cancel = g_object_ref (cancellable); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_JABBER_NS_AUTH, /* This is a workaround for * : while * doesn't require * us to include a username, it seems to be required by jabberd 1.4. */ '(', "username", '$', priv->username, ')', ')', NULL); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancel, jabber_auth_init_sent, self); g_free (id); g_object_unref (iq); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-loopback-stream.c0000644000175000017500000003524412051446215024566 0ustar00wjtwjt00000000000000/* * wocky-loopback-stream.c - Source for WockyLoopbackStream * Copyright (C) 2009-2011 Collabora Ltd. * * 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 */ #include #include #include #include "wocky-loopback-stream.h" enum { PROP_IO_INPUT_STREAM = 1, PROP_IO_OUTPUT_STREAM }; static GType wocky_loopback_input_stream_get_type (void); static GType wocky_loopback_output_stream_get_type (void); struct _WockyLoopbackStreamPrivate { GInputStream *input; GOutputStream *output; }; typedef struct { GOutputStream parent; GAsyncQueue *queue; GError *write_error /* no, this is not a coding style violation */; gboolean dispose_has_run; } WockyLoopbackOutputStream; typedef struct { GOutputStreamClass parent_class; } WockyLoopbackOutputStreamClass; typedef struct { GInputStream parent; GAsyncQueue *queue; guint offset; GArray *out_array; GSimpleAsyncResult *read_result; GCancellable *read_cancellable; gulong read_cancellable_sig_id; void *buffer; gsize count; GError *read_error /* no, this is not a coding style violation */; gboolean dispose_has_run; } WockyLoopbackInputStream; typedef struct { GOutputStreamClass parent_class; } WockyLoopbackInputStreamClass; G_DEFINE_TYPE (WockyLoopbackStream, wocky_loopback_stream, G_TYPE_IO_STREAM); G_DEFINE_TYPE (WockyLoopbackInputStream, wocky_loopback_input_stream, G_TYPE_INPUT_STREAM); G_DEFINE_TYPE (WockyLoopbackOutputStream, wocky_loopback_output_stream, G_TYPE_OUTPUT_STREAM); #define WOCKY_TYPE_LOOPBACK_INPUT_STREAM (wocky_loopback_input_stream_get_type ()) #define WOCKY_TYPE_LOOPBACK_OUTPUT_STREAM (wocky_loopback_output_stream_get_type ()) #define WOCKY_LOOPBACK_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_LOOPBACK_INPUT_STREAM, \ WockyLoopbackInputStream)) #define WOCKY_LOOPBACK_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_LOOPBACK_OUTPUT_STREAM, \ WockyLoopbackOutputStream)) static gboolean wocky_loopback_input_stream_try_read (WockyLoopbackInputStream *self); static void output_data_written_cb (GOutputStream *output, WockyLoopbackInputStream *input_stream) { wocky_loopback_input_stream_try_read (input_stream); } /* connection */ static void wocky_loopback_stream_init (WockyLoopbackStream *self) { WockyLoopbackStreamPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_LOOPBACK_STREAM, WockyLoopbackStreamPrivate); priv = self->priv; priv->output = g_object_new (WOCKY_TYPE_LOOPBACK_OUTPUT_STREAM, NULL); priv->input = g_object_new (WOCKY_TYPE_LOOPBACK_INPUT_STREAM, NULL); WOCKY_LOOPBACK_INPUT_STREAM (priv->input)->queue = g_async_queue_ref ( WOCKY_LOOPBACK_OUTPUT_STREAM (priv->output)->queue); g_signal_connect (priv->output, "data-written", G_CALLBACK (output_data_written_cb), priv->input); } static void wocky_loopback_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyLoopbackStream *self = WOCKY_LOOPBACK_STREAM (object); WockyLoopbackStreamPrivate *priv = self->priv; switch (property_id) { case PROP_IO_INPUT_STREAM: g_value_set_object (value, priv->input); break; case PROP_IO_OUTPUT_STREAM: g_value_set_object (value, priv->output); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_loopback_stream_dispose (GObject *object) { WockyLoopbackStream *self = WOCKY_LOOPBACK_STREAM (object); WockyLoopbackStreamPrivate *priv = self->priv; if (G_OBJECT_CLASS (wocky_loopback_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_loopback_stream_parent_class)->dispose (object); g_object_unref (priv->input); g_object_unref (priv->output); } static GInputStream * wocky_loopback_stream_get_input_stream (GIOStream *stream) { return WOCKY_LOOPBACK_STREAM (stream)->priv->input; } static GOutputStream * wocky_loopback_stream_get_output_stream (GIOStream *stream) { return WOCKY_LOOPBACK_STREAM (stream)->priv->output; } static void wocky_loopback_stream_class_init ( WockyLoopbackStreamClass *wocky_loopback_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_loopback_stream_class); GIOStreamClass *stream_class = G_IO_STREAM_CLASS ( wocky_loopback_stream_class); g_type_class_add_private (wocky_loopback_stream_class, sizeof (WockyLoopbackStreamPrivate)); obj_class->dispose = wocky_loopback_stream_dispose; obj_class->get_property = wocky_loopback_stream_get_property; stream_class->get_input_stream = wocky_loopback_stream_get_input_stream; stream_class->get_output_stream = wocky_loopback_stream_get_output_stream; g_object_class_install_property (obj_class, PROP_IO_INPUT_STREAM, g_param_spec_object ("input-stream", "Input stream", "the input stream", G_TYPE_INPUT_STREAM, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (obj_class, PROP_IO_OUTPUT_STREAM, g_param_spec_object ("output-stream", "Output stream", "the output stream", G_TYPE_OUTPUT_STREAM, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); } GIOStream * wocky_loopback_stream_new (void) { return g_object_new (WOCKY_TYPE_LOOPBACK_STREAM, NULL); } /* Input stream */ static gssize wocky_loopback_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (stream); gsize written = 0; if (self->out_array == NULL) { g_assert (self->offset == 0); self->out_array = g_async_queue_pop (self->queue); } do { gsize towrite; if (self->offset == 0) { towrite = MIN (count - written, MAX (self->out_array->len/2, 1)); } else { towrite = MIN (count - written, self->out_array->len - self->offset); } memcpy ((guchar *) buffer + written, self->out_array->data + self->offset, towrite); self->offset += towrite; written += towrite; if (self->offset == self->out_array->len) { g_array_unref (self->out_array); self->out_array = g_async_queue_try_pop (self->queue); self->offset = 0; } else { break; } } while (written < count && self->out_array != NULL); return written; } static void read_async_complete (WockyLoopbackInputStream *self) { GSimpleAsyncResult *r = self->read_result; if (self->read_cancellable != NULL) { g_signal_handler_disconnect (self->read_cancellable, self->read_cancellable_sig_id); g_object_unref (self->read_cancellable); self->read_cancellable = NULL; } self->read_result = NULL; g_simple_async_result_complete_in_idle (r); g_object_unref (r); } static void read_cancelled_cb (GCancellable *cancellable, WockyLoopbackInputStream *self) { g_simple_async_result_set_error (self->read_result, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Reading cancelled"); self->buffer = NULL; read_async_complete (self); } static void wocky_loopback_input_stream_read_async (GInputStream *stream, void *buffer, gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (stream); g_assert (self->buffer == NULL); g_assert (self->read_result == NULL); g_assert (self->read_cancellable == NULL); self->buffer = buffer; self->count = count; self->read_result = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_loopback_input_stream_read_async); if (self->read_error != NULL) { g_simple_async_result_set_from_error (self->read_result, self->read_error); g_error_free (self->read_error); self->read_error = NULL; read_async_complete (self); return; } if (cancellable != NULL) { self->read_cancellable = g_object_ref (cancellable); self->read_cancellable_sig_id = g_signal_connect (cancellable, "cancelled", G_CALLBACK (read_cancelled_cb), self); } wocky_loopback_input_stream_try_read (self); } static gssize wocky_loopback_input_stream_read_finish (GInputStream *stream, GAsyncResult *result, GError **error) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (stream); gssize len = -1; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) goto out; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_loopback_input_stream_read_async), -1); len = wocky_loopback_input_stream_read (stream, self->buffer, self->count, NULL, error); out: self->buffer = NULL; return len; } static gboolean wocky_loopback_input_stream_try_read (WockyLoopbackInputStream *self) { if (self->read_result == NULL) /* No pending read operation */ return FALSE; if (self->out_array == NULL && g_async_queue_length (self->queue) == 0) return FALSE; read_async_complete (self); return TRUE; } static void wocky_loopback_input_stream_init (WockyLoopbackInputStream *self) { } static void wocky_loopback_input_stream_dispose (GObject *object) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (object); if (self->dispose_has_run) return; self->dispose_has_run = TRUE; if (self->out_array != NULL) g_array_unref (self->out_array); self->out_array = NULL; if (self->queue != NULL) g_async_queue_unref (self->queue); self->queue = NULL; g_warn_if_fail (self->read_result == NULL); g_warn_if_fail (self->read_cancellable == NULL); /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_loopback_input_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_loopback_input_stream_parent_class)->dispose (object); } static void wocky_loopback_input_stream_class_init ( WockyLoopbackInputStreamClass *wocky_loopback_input_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_loopback_input_stream_class); GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (wocky_loopback_input_stream_class); obj_class->dispose = wocky_loopback_input_stream_dispose; stream_class->read_fn = wocky_loopback_input_stream_read; stream_class->read_async = wocky_loopback_input_stream_read_async; stream_class->read_finish = wocky_loopback_input_stream_read_finish; } /* Output stream */ enum { OUTPUT_DATA_WRITTEN, LAST_SIGNAL }; static guint output_signals[LAST_SIGNAL] = {0}; static gssize wocky_loopback_output_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyLoopbackOutputStream *self = WOCKY_LOOPBACK_OUTPUT_STREAM (stream); GArray *data; data = g_array_sized_new (FALSE, FALSE, sizeof (guint8), count); g_array_insert_vals (data, 0, buffer, count); g_async_queue_push (self->queue, data); g_signal_emit (self, output_signals[OUTPUT_DATA_WRITTEN], 0); return count; } static void wocky_loopback_output_stream_write_async (GOutputStream *stream, const void *buffer, gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; GError *error = NULL; gssize result; result = wocky_loopback_output_stream_write (stream, buffer, count, cancellable, &error); simple = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_loopback_output_stream_write_async); if (result == -1) { g_simple_async_result_set_from_error (simple, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gssize (simple, result); } g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static gssize wocky_loopback_output_stream_write_finish (GOutputStream *stream, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return -1; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (stream), wocky_loopback_output_stream_write_async), -1); return g_simple_async_result_get_op_res_gssize ( G_SIMPLE_ASYNC_RESULT (result)); } static void wocky_loopback_output_stream_dispose (GObject *object) { WockyLoopbackOutputStream *self = WOCKY_LOOPBACK_OUTPUT_STREAM (object); if (self->dispose_has_run) return; self->dispose_has_run = TRUE; g_async_queue_push (self->queue, g_array_sized_new (FALSE, FALSE, sizeof (guint8), 0)); g_async_queue_unref (self->queue); /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_loopback_output_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_loopback_output_stream_parent_class)->dispose (object); } static void queue_destroyed (gpointer data) { g_array_free ((GArray *) data, TRUE); } static void wocky_loopback_output_stream_init (WockyLoopbackOutputStream *self) { self->queue = g_async_queue_new_full (queue_destroyed); } static void wocky_loopback_output_stream_class_init ( WockyLoopbackOutputStreamClass *wocky_loopback_output_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_loopback_output_stream_class); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (wocky_loopback_output_stream_class); obj_class->dispose = wocky_loopback_output_stream_dispose; stream_class->write_fn = wocky_loopback_output_stream_write; stream_class->write_async = wocky_loopback_output_stream_write_async; stream_class->write_finish = wocky_loopback_output_stream_write_finish; output_signals[OUTPUT_DATA_WRITTEN] = g_signal_new ("data-written", G_OBJECT_CLASS_TYPE(wocky_loopback_output_stream_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-contact.c0000644000175000017500000000724712050202021023120 0ustar00wjtwjt00000000000000/* * wocky-contact.c - Source for WockyContact * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ /** * SECTION: wocky-contact * @title: WockyContact * @short_description: * @include: wocky/wocky-contact.h * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-contact.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_ROSTER #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyContact, wocky_contact, G_TYPE_OBJECT) /* signal enum */ enum { LAST_SIGNAL, }; /* static guint signals[LAST_SIGNAL] = {0}; */ /* private structure */ struct _WockyContactPrivate { gboolean dispose_has_run; }; static void wocky_contact_init (WockyContact *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_CONTACT, WockyContactPrivate); } static void wocky_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { /* WockyContactPrivate *priv = object->priv; */ switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { /* WockyContactPrivate *priv = object->priv; */ switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_contact_constructed (GObject *object) { } static void wocky_contact_dispose (GObject *object) { WockyContact *self = WOCKY_CONTACT (object); WockyContactPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (G_OBJECT_CLASS (wocky_contact_parent_class)->dispose) G_OBJECT_CLASS (wocky_contact_parent_class)->dispose (object); } static void wocky_contact_finalize (GObject *object) { /* WockyContact *self = WOCKY_CONTACT (object); WockyContactPrivate *priv = self->priv; */ G_OBJECT_CLASS (wocky_contact_parent_class)->finalize (object); } static void wocky_contact_class_init (WockyContactClass *wocky_contact_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_contact_class); g_type_class_add_private (wocky_contact_class, sizeof (WockyContactPrivate)); object_class->constructed = wocky_contact_constructed; object_class->set_property = wocky_contact_set_property; object_class->get_property = wocky_contact_get_property; object_class->dispose = wocky_contact_dispose; object_class->finalize = wocky_contact_finalize; } gchar * wocky_contact_dup_jid (WockyContact *self) { WockyContactClass *cls = WOCKY_CONTACT_GET_CLASS (self); if (cls->dup_jid != NULL) return cls->dup_jid (self); else return NULL; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-caps-cache.h0000644000175000017500000000521312050202021023450 0ustar00wjtwjt00000000000000/* * wocky-caps-cache.h - Header for WockyCapsCache * Copyright (C) 2010 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_CAPS_CACHE_H__ #define __WOCKY_CAPS_CACHE_H__ #include #include "wocky-node-tree.h" G_BEGIN_DECLS /** * WockyCapsCache: * * An object providing a permanent cache for capabilities. */ typedef struct _WockyCapsCache WockyCapsCache; /** * WockyCapsCacheClass: * * The class of a #WockyCapsCache. */ typedef struct _WockyCapsCacheClass WockyCapsCacheClass; typedef struct _WockyCapsCachePrivate WockyCapsCachePrivate; #define WOCKY_TYPE_CAPS_CACHE wocky_caps_cache_get_type() #define WOCKY_CAPS_CACHE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_CAPS_CACHE, \ WockyCapsCache)) #define WOCKY_CAPS_CACHE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_CAPS_CACHE, \ WockyCapsCacheClass)) #define WOCKY_IS_CAPS_CACHE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_CAPS_CACHE)) #define WOCKY_IS_CAPS_CACHE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_CAPS_CACHE)) #define WOCKY_CAPS_CACHE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_CAPS_CACHE, \ WockyCapsCacheClass)) struct _WockyCapsCache { /**/ GObject parent; WockyCapsCachePrivate *priv; }; struct _WockyCapsCacheClass { /**/ GObjectClass parent_class; }; GType wocky_caps_cache_get_type (void); WockyNodeTree *wocky_caps_cache_lookup (WockyCapsCache *self, const gchar *node); void wocky_caps_cache_insert (WockyCapsCache *self, const gchar *node, WockyNodeTree *query_node); WockyCapsCache * wocky_caps_cache_new (const gchar *path); WockyCapsCache * wocky_caps_cache_dup_shared (void); void wocky_caps_cache_free_shared (void); G_END_DECLS #endif /* ifndef __WOCKY_CAPS_CACHE_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-resource-contact.h0000644000175000017500000000554412050202021024750 0ustar00wjtwjt00000000000000/* * wocky-resource-contact.h - Header for WockyResourceContact * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_RESOURCE_CONTACT_H__ #define __WOCKY_RESOURCE_CONTACT_H__ #include #include "wocky-types.h" #include "wocky-contact.h" #include "wocky-bare-contact.h" #include "wocky-roster.h" G_BEGIN_DECLS /** * WockyResourceContactClass: * * The class of a #WockyResourceContact. */ typedef struct _WockyResourceContactClass WockyResourceContactClass; typedef struct _WockyResourceContactPrivate WockyResourceContactPrivate; struct _WockyResourceContactClass { /**/ WockyContactClass parent_class; }; struct _WockyResourceContact { /**/ WockyContact parent; WockyResourceContactPrivate *priv; }; GType wocky_resource_contact_get_type (void); #define WOCKY_TYPE_RESOURCE_CONTACT \ (wocky_resource_contact_get_type ()) #define WOCKY_RESOURCE_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_RESOURCE_CONTACT, \ WockyResourceContact)) #define WOCKY_RESOURCE_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_RESOURCE_CONTACT, \ WockyResourceContactClass)) #define WOCKY_IS_RESOURCE_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_RESOURCE_CONTACT)) #define WOCKY_IS_RESOURCE_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_RESOURCE_CONTACT)) #define WOCKY_RESOURCE_CONTACT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_RESOURCE_CONTACT, \ WockyResourceContactClass)) WockyResourceContact * wocky_resource_contact_new (WockyBareContact *bare, const gchar *resource); const gchar * wocky_resource_contact_get_resource ( WockyResourceContact *contact); WockyBareContact * wocky_resource_contact_get_bare_contact ( WockyResourceContact *contact); gboolean wocky_resource_contact_equal (WockyResourceContact *a, WockyResourceContact *b); G_END_DECLS #endif /* #ifndef __WOCKY_RESOURCE_CONTACT_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-ll-connection-factory.h0000644000175000017500000000634412050202021025700 0ustar00wjtwjt00000000000000/* * wocky-ll-connection-factory.h - Header for WockyLLConnectionFactory * Copyright (C) 2011 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_LL_CONNECTION_FACTORY_H__ #define __WOCKY_LL_CONNECTION_FACTORY_H__ #include #include #include "wocky-xmpp-connection.h" #include "wocky-ll-contact.h" G_BEGIN_DECLS typedef struct _WockyLLConnectionFactory WockyLLConnectionFactory; typedef struct _WockyLLConnectionFactoryClass WockyLLConnectionFactoryClass; typedef struct _WockyLLConnectionFactoryPrivate WockyLLConnectionFactoryPrivate; typedef enum { WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESSES, WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESS_CAN_BE_CONNECTED_TO, /* omg so long! */ } WockyLLConnectionFactoryError; GQuark wocky_ll_connection_factory_error_quark (void); #define WOCKY_LL_CONNECTION_FACTORY_ERROR (wocky_ll_connection_factory_error_quark ()) struct _WockyLLConnectionFactoryClass { GObjectClass parent_class; }; struct _WockyLLConnectionFactory { GObject parent; WockyLLConnectionFactoryPrivate *priv; }; GType wocky_ll_connection_factory_get_type (void); #define WOCKY_TYPE_LL_CONNECTION_FACTORY \ (wocky_ll_connection_factory_get_type ()) #define WOCKY_LL_CONNECTION_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_LL_CONNECTION_FACTORY, \ WockyLLConnectionFactory)) #define WOCKY_LL_CONNECTION_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_LL_CONNECTION_FACTORY, \ WockyLLConnectionFactoryClass)) #define WOCKY_IS_LL_CONNECTION_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_LL_CONNECTION_FACTORY)) #define WOCKY_IS_LL_CONNECTION_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_LL_CONNECTION_FACTORY)) #define WOCKY_LL_CONNECTION_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_LL_CONNECTION_FACTORY, \ WockyLLConnectionFactoryClass)) WockyLLConnectionFactory * wocky_ll_connection_factory_new (void); void wocky_ll_connection_factory_make_connection_async ( WockyLLConnectionFactory *factory, WockyLLContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyXmppConnection * wocky_ll_connection_factory_make_connection_finish ( WockyLLConnectionFactory *factory, GAsyncResult *result, GError **error); G_END_DECLS #endif /* #ifndef __WOCKY_LL_CONNECTION_FACTORY_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xep-0115-capabilities.c0000644000175000017500000000434412050202021025267 0ustar00wjtwjt00000000000000/* * wocky-xep-0115-capabilities.c - interface for holding capabilities * of contacts * * Copyright (C) 2011-2012 Collabora Ltd. * * 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 */ #include "config.h" #include "wocky-xep-0115-capabilities.h" #include "wocky-contact.h" G_DEFINE_INTERFACE (WockyXep0115Capabilities, wocky_xep_0115_capabilities, G_TYPE_OBJECT); static void wocky_xep_0115_capabilities_default_init ( WockyXep0115CapabilitiesInterface *interface) { GType iface_type = G_TYPE_FROM_INTERFACE (interface); static gsize initialization_value = 0; if (g_once_init_enter (&initialization_value)) { g_signal_new ("capabilities-changed", iface_type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_once_init_leave (&initialization_value, 1); } } const GPtrArray * wocky_xep_0115_capabilities_get_data_forms ( WockyXep0115Capabilities *contact) { WockyXep0115CapabilitiesInterface *iface = WOCKY_XEP_0115_CAPABILITIES_GET_INTERFACE (contact); WockyXep0115CapabilitiesGetDataFormsFunc method = iface->get_data_forms; if (method != NULL) return method (contact); return NULL; } gboolean wocky_xep_0115_capabilities_has_feature ( WockyXep0115Capabilities *contact, const gchar *feature) { WockyXep0115CapabilitiesInterface *iface = WOCKY_XEP_0115_CAPABILITIES_GET_INTERFACE (contact); WockyXep0115CapabilitiesHasFeatureFunc method = iface->has_feature; if (method != NULL) return method (contact, feature); return FALSE; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls-handler.h0000644000175000017500000000726112051446215023723 0ustar00wjtwjt00000000000000/* * wocky-tls-handler.h - Header for WockyTLSHandler * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_TLS_HANDLER_H__ #define __WOCKY_TLS_HANDLER_H__ #include #include "wocky-tls.h" G_BEGIN_DECLS typedef struct _WockyTLSHandler WockyTLSHandler; /** * WockyTLSHandlerClass: * @verify_async_func: a function to call to start an asychronous * verify operation; see wocky_tls_handler_verify_async() for more * details * @verify_finish_func: a function to call to finish an asychronous * verify operation; see wocky_tls_handler_verify_finish() for more * details * * The class of a #WockyTLSHandler. */ typedef struct _WockyTLSHandlerClass WockyTLSHandlerClass; typedef struct _WockyTLSHandlerPrivate WockyTLSHandlerPrivate; typedef void (*WockyTLSHandlerVerifyAsyncFunc) (WockyTLSHandler *self, WockyTLSSession *tls_session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data); typedef gboolean (*WockyTLSHandlerVerifyFinishFunc) (WockyTLSHandler *self, GAsyncResult *res, GError **error); struct _WockyTLSHandlerClass { /**/ GObjectClass parent_class; /**/ WockyTLSHandlerVerifyAsyncFunc verify_async_func; WockyTLSHandlerVerifyFinishFunc verify_finish_func; }; struct _WockyTLSHandler { /**/ GObject parent; WockyTLSHandlerPrivate *priv; }; GType wocky_tls_handler_get_type (void); #define WOCKY_TYPE_TLS_HANDLER \ (wocky_tls_handler_get_type ()) #define WOCKY_TLS_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_TLS_HANDLER, WockyTLSHandler)) #define WOCKY_TLS_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_TLS_HANDLER, \ WockyTLSHandlerClass)) #define WOCKY_IS_TLS_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_TLS_HANDLER)) #define WOCKY_IS_TLS_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_TLS_HANDLER)) #define WOCKY_TLS_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_TLS_HANDLER, \ WockyTLSHandlerClass)) WockyTLSHandler * wocky_tls_handler_new (gboolean ignore_ssl_errors); void wocky_tls_handler_verify_async (WockyTLSHandler *self, WockyTLSSession *tls_session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_tls_handler_verify_finish (WockyTLSHandler *self, GAsyncResult *result, GError **error); gboolean wocky_tls_handler_add_ca (WockyTLSHandler *self, const gchar *path); gboolean wocky_tls_handler_add_crl (WockyTLSHandler *self, const gchar *path); GSList *wocky_tls_handler_get_cas (WockyTLSHandler *self); GSList *wocky_tls_handler_get_crls (WockyTLSHandler *self); G_END_DECLS #endif /* #ifndef __WOCKY_TLS_HANDLER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-jabber-auth-password.h0000644000175000017500000000301612050202021025504 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_JABBER_AUTH_PASSWORD_H #define _WOCKY_JABBER_AUTH_PASSWORD_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_JABBER_AUTH_PASSWORD wocky_jabber_auth_password_get_type() #define WOCKY_JABBER_AUTH_PASSWORD(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_JABBER_AUTH_PASSWORD, \ WockyJabberAuthPassword)) #define WOCKY_JABBER_AUTH_PASSWORD_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_JABBER_AUTH_PASSWORD, \ WockyJabberAuthPasswordClass)) #define WOCKY_IS_JABBER_AUTH_PASSWORD(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_JABBER_AUTH_PASSWORD)) #define WOCKY_IS_JABBER_AUTH_PASSWORD_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_JABBER_AUTH_PASSWORD)) #define WOCKY_JABBER_AUTH_PASSWORD_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_JABBER_AUTH_PASSWORD, \ WockyJabberAuthPasswordClass)) typedef struct _WockyJabberAuthPasswordPrivate WockyJabberAuthPasswordPrivate; typedef struct { GObject parent; WockyJabberAuthPasswordPrivate *priv; } WockyJabberAuthPassword; typedef struct { GObjectClass parent_class; } WockyJabberAuthPasswordClass; GType wocky_jabber_auth_password_get_type (void); WockyJabberAuthPassword *wocky_jabber_auth_password_new ( const gchar *password); G_END_DECLS #endif /* defined _WOCKY_JABBER_AUTH_PASSWORD_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-service.h0000644000175000017500000001201312050202021024413 0ustar00wjtwjt00000000000000/* * wocky-pubsub-service.h - Header of WockyPubsubService * Copyright (C) 2009 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_PUBSUB_SERVICE_H__ #define __WOCKY_PUBSUB_SERVICE_H__ #include #include #include "wocky-pubsub-service-enumtypes.h" #include "wocky-stanza.h" #include "wocky-session.h" #include "wocky-types.h" #include "wocky-data-form.h" G_BEGIN_DECLS typedef struct _WockyPubsubService WockyPubsubService; typedef struct _WockyPubsubServiceClass WockyPubsubServiceClass; typedef struct _WockyPubsubServicePrivate WockyPubsubServicePrivate; /** * WockyPubsubServiceError: * @WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY: A wrong reply was received * * #WockyPubsubService specific errors. */ typedef enum { WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, } WockyPubsubServiceError; GQuark wocky_pubsub_service_error_quark (void); #define WOCKY_PUBSUB_SERVICE_ERROR (wocky_pubsub_service_error_quark ()) struct _WockyPubsubServiceClass { GObjectClass parent_class; GType node_object_type; }; struct _WockyPubsubService { GObject parent; WockyPubsubServicePrivate *priv; }; GType wocky_pubsub_service_get_type (void); #define WOCKY_TYPE_PUBSUB_SERVICE \ (wocky_pubsub_service_get_type ()) #define WOCKY_PUBSUB_SERVICE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_PUBSUB_SERVICE, \ WockyPubsubService)) #define WOCKY_PUBSUB_SERVICE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_PUBSUB_SERVICE, \ WockyPubsubServiceClass)) #define WOCKY_IS_PUBSUB_SERVICE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_PUBSUB_SERVICE)) #define WOCKY_IS_PUBSUB_SERVICE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_PUBSUB_SERVICE)) #define WOCKY_PUBSUB_SERVICE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_PUBSUB_SERVICE, \ WockyPubsubServiceClass)) WockyPubsubService * wocky_pubsub_service_new (WockySession *session, const gchar *jid); WockyPubsubNode * wocky_pubsub_service_ensure_node (WockyPubsubService *self, const gchar *name); WockyPubsubNode * wocky_pubsub_service_lookup_node (WockyPubsubService *self, const gchar *name); void wocky_pubsub_service_get_default_node_configuration_async ( WockyPubsubService *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyDataForm * wocky_pubsub_service_get_default_node_configuration_finish ( WockyPubsubService *self, GAsyncResult *result, GError **error); void wocky_pubsub_service_retrieve_subscriptions_async ( WockyPubsubService *self, WockyPubsubNode *node, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_pubsub_service_retrieve_subscriptions_finish ( WockyPubsubService *self, GAsyncResult *result, GList **subscriptions, GError **error); void wocky_pubsub_service_create_node_async (WockyPubsubService *self, const gchar *name, WockyDataForm *config, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyPubsubNode * wocky_pubsub_service_create_node_finish ( WockyPubsubService *self, GAsyncResult *result, GError **error); /*< prefix=WOCKY_PUBSUB_SUBSCRIPTION >*/ typedef enum { WOCKY_PUBSUB_SUBSCRIPTION_NONE, WOCKY_PUBSUB_SUBSCRIPTION_PENDING, WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED } WockyPubsubSubscriptionState; typedef struct { /*< public >*/ WockyPubsubNode *node; gchar *jid; WockyPubsubSubscriptionState state; gchar *subid; } WockyPubsubSubscription; #define WOCKY_TYPE_PUBSUB_SUBSCRIPTION \ (wocky_pubsub_subscription_get_type ()) GType wocky_pubsub_subscription_get_type (void); WockyPubsubSubscription *wocky_pubsub_subscription_new ( WockyPubsubNode *node, const gchar *jid, WockyPubsubSubscriptionState state, const gchar *subid); WockyPubsubSubscription *wocky_pubsub_subscription_copy ( WockyPubsubSubscription *sub); void wocky_pubsub_subscription_free (WockyPubsubSubscription *sub); GList *wocky_pubsub_subscription_list_copy (GList *subs); void wocky_pubsub_subscription_list_free (GList *subs); G_END_DECLS #endif /* __WOCKY_PUBSUB_SERVICE_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-muc.c0000644000175000017500000012504412051446215022265 0ustar00wjtwjt00000000000000/* * wocky-muc.c - Source for WockyMuc * Copyright © 2009 Collabora Ltd. * @author Vivek Dasmohapatra * * 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 */ #include #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_MUC_CONNECTION #include "wocky-debug-internal.h" #include "wocky-muc.h" #include "wocky-namespaces.h" #include "wocky-utils.h" #include "wocky-signals-marshal.h" #include "wocky-xmpp-error.h" typedef enum { SIG_NICK_CHANGE, SIG_PERM_CHANGE, SIG_PRESENCE, SIG_OWN_PRESENCE, SIG_PRESENCE_ERROR, SIG_JOINED, SIG_PARTED, SIG_LEFT, SIG_MSG, SIG_MSG_ERR, SIG_FILL_PRESENCE, SIG_NULL } WockyMucSig; static guint signals[SIG_NULL] = { 0 }; typedef struct { const gchar *ns; WockyMucFeature flag; } feature; static const feature feature_map[] = { { WOCKY_NS_MUC, WOCKY_MUC_MODERN }, { WOCKY_NS_MUC "#register", WOCKY_MUC_FORM_REGISTER }, { WOCKY_NS_MUC "#roomconfig", WOCKY_MUC_FORM_ROOMCONFIG }, { WOCKY_NS_MUC "#roominfo", WOCKY_MUC_FORM_ROOMINFO }, { "muc_hidden", WOCKY_MUC_HIDDEN }, { "muc_membersonly", WOCKY_MUC_MEMBERSONLY }, { "muc_moderated", WOCKY_MUC_MODERATED }, { "muc_nonanonymous", WOCKY_MUC_NONANONYMOUS }, { "muc_open", WOCKY_MUC_OPEN }, { "muc_passwordprotected", WOCKY_MUC_PASSWORDPROTECTED }, { "muc_persistent", WOCKY_MUC_PERSISTENT }, { "muc_public", WOCKY_MUC_PUBLIC }, { "muc_rooms", WOCKY_MUC_ROOMS }, { "muc_semianonymous", WOCKY_MUC_SEMIANONYMOUS }, { "muc_temporary", WOCKY_MUC_TEMPORARY }, { "muc_unmoderated", WOCKY_MUC_UNMODERATED }, { "muc_unsecured", WOCKY_MUC_UNSECURED }, { "gc-1.0", WOCKY_MUC_OBSOLETE }, { NULL, 0 } }; static void wocky_muc_class_init (WockyMucClass *klass); /* create MUC object */ G_DEFINE_TYPE (WockyMuc, wocky_muc, G_TYPE_OBJECT); /* private methods */ static void wocky_muc_dispose (GObject *object); static void wocky_muc_finalize (GObject *object); static void wocky_muc_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void wocky_muc_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); /* private functions */ static gboolean handle_presence (WockyPorter *porter, WockyStanza *stanza, gpointer data); static gboolean handle_message (WockyPorter *porter, WockyStanza *stanza, gpointer data); enum { PROP_JID = 1, PROP_USER, PROP_PORTER, PROP_SERVICE, PROP_ROOM, PROP_DESC, PROP_NICK, PROP_RNICK, PROP_PASS, PROP_STATUS, PROP_ROOM_TYPE, PROP_ID_CATEGORY, PROP_ID_TYPE, PROP_ID_NAME, PROP_ROLE, PROP_AFFILIATION, }; struct _WockyMucPrivate { /* properties */ WockyPorter *porter; gchar *user; /* full JID of user */ gchar *jid; /* room@service/nick */ gchar *service; /* service */ gchar *room; /* room */ gchar *rjid; /* room@service */ gchar *nick; /* nick */ gchar *rnick; /* reserved nick, if any */ gchar *id_category; /* eg "conference" */ gchar *id_type; /* eg "text" */ gchar *id_name; gchar *desc; /* long room description */ gchar *pass; /* password or NULL */ gchar *status; /* status message */ guint room_type; /* ORed WockyMucFeature flags */ /* not props */ gboolean dispose_has_run; GHashTable *members; WockyMucState state; WockyMucRole role; WockyMucAffiliation affiliation; guint pres_handler; guint mesg_handler; GSimpleAsyncResult *join_cb; }; static void free_member (gpointer data) { WockyMucMember *member = data; if (member->presence_stanza != NULL) g_object_unref (member->presence_stanza); g_free (member->from); g_free (member->jid); g_free (member->nick); g_free (member->status); g_slice_free (WockyMucMember, member); } static gpointer alloc_member (void) { return g_slice_new0 (WockyMucMember); } static void wocky_muc_init (WockyMuc *muc) { muc->priv = G_TYPE_INSTANCE_GET_PRIVATE (muc, WOCKY_TYPE_MUC, WockyMucPrivate); muc->priv->members = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_member); } static void wocky_muc_dispose (GObject *object) { WockyMuc *muc = WOCKY_MUC (object); WockyMucPrivate *priv = muc->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->pres_handler != 0) wocky_porter_unregister_handler (priv->porter, priv->pres_handler); priv->pres_handler = 0; if (priv->mesg_handler != 0) wocky_porter_unregister_handler (priv->porter, priv->mesg_handler); priv->mesg_handler = 0; if (priv->porter != NULL) g_object_unref (priv->porter); priv->porter = NULL; if (priv->members != NULL) g_hash_table_unref (priv->members); priv->members = NULL; if (G_OBJECT_CLASS (wocky_muc_parent_class )->dispose) G_OBJECT_CLASS (wocky_muc_parent_class)->dispose (object); } #define GFREE_AND_FORGET(x) g_free (x); x = NULL; static void wocky_muc_finalize (GObject *object) { WockyMuc *muc = WOCKY_MUC (object); WockyMucPrivate *priv = muc->priv; GFREE_AND_FORGET (priv->user); GFREE_AND_FORGET (priv->jid); GFREE_AND_FORGET (priv->service); GFREE_AND_FORGET (priv->room); GFREE_AND_FORGET (priv->rjid); GFREE_AND_FORGET (priv->nick); GFREE_AND_FORGET (priv->rnick); GFREE_AND_FORGET (priv->id_category); GFREE_AND_FORGET (priv->id_type); GFREE_AND_FORGET (priv->id_name); G_OBJECT_CLASS (wocky_muc_parent_class)->finalize (object); } static void wocky_muc_class_init (WockyMucClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GType ctype = G_OBJECT_CLASS_TYPE (klass); GParamSpec *spec; g_type_class_add_private (klass, sizeof (WockyMucPrivate)); oclass->get_property = wocky_muc_get_property; oclass->set_property = wocky_muc_set_property; oclass->dispose = wocky_muc_dispose; oclass->finalize = wocky_muc_finalize; spec = g_param_spec_string ("jid", "jid", "Full room@service/nick JID of the MUC room", NULL, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_JID, spec); spec = g_param_spec_string ("user", "user", "Full JID of the user (node@domain/resource) who is connecting", NULL, (G_PARAM_CONSTRUCT_ONLY|G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_USER, spec); spec = g_param_spec_object ("porter", "porter", "The WockyPorter instance doing all the actual XMPP interaction", WOCKY_TYPE_PORTER, (G_PARAM_CONSTRUCT_ONLY|G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_PORTER, spec); spec = g_param_spec_string ("service", "service", "The service (domain) part of the MUC JID", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_SERVICE, spec); spec = g_param_spec_string ("room", "room", "The node part of the MUC room JID", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ROOM, spec); spec = g_param_spec_string ("description", "desc", "The long description oof the room", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_DESC, spec); spec = g_param_spec_string ("nickname", "nick", "The user's in-room nickname", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_NICK, spec); spec = g_param_spec_string ("reserved-nick", "reserved-nick", "The user's reserved in-room nickname, if any", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_RNICK, spec); spec = g_param_spec_string ("password", "password", "User's MUC room password", NULL, (G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_PASS, spec); spec = g_param_spec_string ("status-message", "status", "User's MUC status message", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_STATUS, spec); spec = g_param_spec_ulong ("muc-flags", "muc-flags", "ORed set of WockyMucFeature MUC property flags", 0, G_MAXULONG, 0, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ROOM_TYPE, spec); spec = g_param_spec_string ("category", "category", "Category of the MUC, usually \"conference\"", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ID_CATEGORY, spec); spec = g_param_spec_string ("type", "type", "Type of the MUC, eg \"text\"", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ID_TYPE, spec); spec = g_param_spec_string ("name", "name", "The human-readable name of the room (usually a short label)", NULL, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ID_NAME, spec); spec = g_param_spec_uint ("role", "role", "The role (WockyMucRole) of the user in the MUC room", WOCKY_MUC_ROLE_NONE, WOCKY_MUC_ROLE_MODERATOR, WOCKY_MUC_ROLE_NONE, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ROLE, spec); spec = g_param_spec_enum ("affiliation", "affiliation", "The affiliation of the user with the MUC room", WOCKY_TYPE_MUC_AFFILIATION, WOCKY_MUC_AFFILIATION_NONE, (G_PARAM_READABLE|G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_AFFILIATION, spec); signals[SIG_NICK_CHANGE] = g_signal_new ("nick-change", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__POINTER_UINT, G_TYPE_NONE, 2, WOCKY_TYPE_STANZA, G_TYPE_UINT); signals[SIG_PRESENCE] = g_signal_new ("presence", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_UINT_POINTER, G_TYPE_NONE, 3, WOCKY_TYPE_STANZA, G_TYPE_UINT, G_TYPE_POINTER); signals[SIG_OWN_PRESENCE] = g_signal_new ("own-presence", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_UINT, G_TYPE_NONE, 2, WOCKY_TYPE_STANZA, G_TYPE_UINT); signals[SIG_JOINED] = g_signal_new ("joined", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__POINTER_UINT, G_TYPE_NONE, 2, WOCKY_TYPE_STANZA, G_TYPE_UINT); signals[SIG_PRESENCE_ERROR] = g_signal_new ("error", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_ENUM_STRING, G_TYPE_NONE, 3, WOCKY_TYPE_STANZA, WOCKY_TYPE_XMPP_ERROR, G_TYPE_STRING); /* These signals convey actor(jid) + reason */ signals[SIG_PERM_CHANGE] = g_signal_new ("permissions", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__POINTER_UINT_POINTER_POINTER, G_TYPE_NONE, 4, WOCKY_TYPE_STANZA, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); /* and these two pass on any message as well: */ signals[SIG_PARTED] = g_signal_new ("parted", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_UINT_STRING_STRING_STRING, G_TYPE_NONE, 5, WOCKY_TYPE_STANZA, G_TYPE_UINT, G_TYPE_STRING, /* actor jid */ G_TYPE_STRING, /* reason */ G_TYPE_STRING); /* message: usually none, but allowed by spec */ signals[SIG_LEFT] = g_signal_new ("left", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_UINT_POINTER_STRING_STRING_STRING, G_TYPE_NONE, 6, WOCKY_TYPE_STANZA, G_TYPE_UINT, G_TYPE_POINTER, /* member struct */ G_TYPE_STRING, /* actor jid */ G_TYPE_STRING, /* reason */ G_TYPE_STRING); /* message, if any */ signals[SIG_MSG] = g_signal_new ("message", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_ENUM_STRING_LONG_POINTER_STRING_STRING_ENUM, G_TYPE_NONE, 8, WOCKY_TYPE_STANZA, WOCKY_TYPE_MUC_MSG_TYPE, /* WockyMucMsgType */ G_TYPE_STRING, /* XMPP msg ID */ G_TYPE_DATE_TIME, /* timestamp */ G_TYPE_POINTER, /* WockyMucMember * */ G_TYPE_STRING, /* content */ G_TYPE_STRING, /* subject */ WOCKY_TYPE_MUC_MSG_STATE); /* WockyMucMsgState */ signals[SIG_MSG_ERR] = g_signal_new ("message-error", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_ENUM_STRING_LONG_POINTER_STRING_ENUM_ENUM, G_TYPE_NONE, 8, WOCKY_TYPE_STANZA, WOCKY_TYPE_MUC_MSG_TYPE, /* WockyMucMsgType */ G_TYPE_STRING, /* XMPP msg ID */ G_TYPE_DATE_TIME, /* timestamp */ G_TYPE_POINTER, /* WockyMucMember * */ G_TYPE_STRING, /* content */ WOCKY_TYPE_XMPP_ERROR, /* WockyXmppError */ WOCKY_TYPE_XMPP_ERROR_TYPE); /* error type */ signals[SIG_FILL_PRESENCE] = g_signal_new ("fill-presence", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT, G_TYPE_NONE, 1, WOCKY_TYPE_STANZA); } static void wocky_muc_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyMuc *muc = WOCKY_MUC (object); WockyMucPrivate *priv = muc->priv; switch (property_id) { case PROP_PORTER: priv->porter = g_value_dup_object (value); break; case PROP_JID: g_free (priv->jid); g_free (priv->service); g_free (priv->room); g_free (priv->nick); g_free (priv->rjid); priv->jid = g_value_dup_string (value); wocky_decode_jid (priv->jid, &(priv->room), &(priv->service), &(priv->nick)); priv->rjid = g_strdup_printf ("%s@%s", priv->room, priv->service); break; case PROP_NICK: g_free (priv->nick); priv->nick = g_value_dup_string (value); if (priv->jid != NULL && priv->nick != NULL) { g_free (priv->jid); priv->jid = g_strdup_printf ("%s@%s/%s", priv->room, priv->service, priv->nick); } break; case PROP_RNICK: g_free (priv->rnick); priv->rnick = g_value_dup_string (value); break; case PROP_PASS: g_free (priv->pass); priv->pass = g_value_dup_string (value); break; case PROP_USER: g_free (priv->user); priv->user = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_muc_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyMuc *muc = WOCKY_MUC (object); WockyMucPrivate *priv = muc->priv; switch (property_id) { case PROP_PORTER: g_value_set_object (value, priv->porter); break; case PROP_JID: g_value_set_string (value, priv->jid); break; case PROP_SERVICE: g_value_set_string (value, priv->service); break; case PROP_ROOM: g_value_set_string (value, priv->room); break; case PROP_DESC: g_value_set_string (value, priv->desc); break; case PROP_NICK: g_value_set_string (value, priv->nick); break; case PROP_PASS: g_value_set_string (value, priv->pass); break; case PROP_STATUS: g_value_set_string (value, priv->status); break; case PROP_RNICK: g_value_set_string (value, priv->rnick); break; case PROP_USER: g_value_set_string (value, priv->user); break; case PROP_ROOM_TYPE: g_value_set_uint (value, priv->room_type); break; case PROP_ID_CATEGORY: g_value_set_string (value, priv->id_category); break; case PROP_ID_TYPE: g_value_set_string (value, priv->id_type); break; case PROP_ID_NAME: g_value_set_string (value, priv->id_name); break; case PROP_ROLE: g_value_set_uint (value, priv->role); break; case PROP_AFFILIATION: g_value_set_enum (value, priv->affiliation); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static guint status_code_to_muc_flag (guint64 code) { switch (code) { case 100: return WOCKY_MUC_CODE_ONYMOUS; case 101: return WOCKY_MUC_CODE_AF_CHANGE_OOB; case 102: return WOCKY_MUC_CODE_CFG_SHOW_UNAVAILABLE; case 103: return WOCKY_MUC_CODE_CFG_HIDE_UNAVAILABLE; case 104: return WOCKY_MUC_CODE_CFG_NONPRIVACY; case 110: return WOCKY_MUC_CODE_OWN_PRESENCE; case 170: return WOCKY_MUC_CODE_CFG_LOGGING_ENABLED; case 171: return WOCKY_MUC_CODE_CFG_LOGGING_DISABLED; case 172: return WOCKY_MUC_CODE_CFG_ONYMOUS; case 173: return WOCKY_MUC_CODE_CFG_SEMIONYMOUS; case 174: return WOCKY_MUC_CODE_CFG_ANONYMOUS; case 201: return WOCKY_MUC_CODE_NEW_ROOM; case 210: return WOCKY_MUC_CODE_NICK_CHANGE_FORCED; case 301: return WOCKY_MUC_CODE_BANNED; case 303: return WOCKY_MUC_CODE_NICK_CHANGE_USER; case 307: return WOCKY_MUC_CODE_KICKED; case 321: return WOCKY_MUC_CODE_KICKED_AFFILIATION; case 322: return WOCKY_MUC_CODE_KICKED_ROOM_PRIVATISED; case 332: return WOCKY_MUC_CODE_KICKED_SHUTDOWN; } return WOCKY_MUC_CODE_UNKNOWN; } static gboolean store_muc_disco_info_x (WockyNode *field, gpointer data) { WockyMucPrivate *priv = data; const gchar *var = NULL; if (wocky_strdiff (field->name, "field")) return TRUE; var = wocky_node_get_attribute (field, "var"); if (wocky_strdiff (var, "muc#roominfo_description")) return TRUE; priv->desc = g_strdup ( wocky_node_get_content_from_child (field, "value")); return TRUE; } static gboolean store_muc_disco_info (WockyNode *feat, gpointer data) { WockyMucPrivate *priv = data; if (!wocky_strdiff (feat->name, "feature")) { guint i; const gchar *thing = wocky_node_get_attribute (feat, "var"); if (thing == NULL) return TRUE; for (i = 0; feature_map[i].ns != NULL; i++) if (!wocky_strdiff (thing, feature_map[i].ns)) { priv->room_type |= feature_map[i].flag; break; } return TRUE; } if (!wocky_strdiff (feat->name, "x")) wocky_node_each_child (feat, store_muc_disco_info_x, priv); return TRUE; } static void muc_disco_info (GObject *source, GAsyncResult *res, gpointer data) { WockyMuc *muc; WockyMucPrivate *priv; GError *error = NULL; WockyStanza *iq; WockyStanzaType type; WockyStanzaSubType sub; GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (data); muc = WOCKY_MUC (g_async_result_get_source_object (G_ASYNC_RESULT (result))); priv = muc->priv; iq = wocky_porter_send_iq_finish (priv->porter, res, &error); priv->room_type = 0; g_free (priv->id_name); g_free (priv->id_type); g_free (priv->id_category); priv->id_name = NULL; priv->id_type = NULL; priv->id_category = NULL; if (error != NULL) goto out; if (iq == NULL) goto out; wocky_stanza_get_type_info (iq, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { error = g_error_new (WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION, "Bizarre response: Not an IQ"); goto out; } switch (sub) { WockyNode *query; WockyNode *node; case WOCKY_STANZA_SUB_TYPE_RESULT: query = wocky_node_get_child_ns ( wocky_stanza_get_top_node (iq), "query", WOCKY_NS_DISCO_INFO); if (query == NULL) { error = g_error_new (WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION, "Malformed IQ reply"); goto out; } node = wocky_node_get_child (query, "identity"); if (node == NULL) { error = g_error_new (WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION, "Malformed IQ reply: No Identity"); goto out; } else { const gchar *attr; attr = wocky_node_get_attribute (node, "category"); g_free (priv->id_category); priv->id_category = g_strdup (attr); attr = wocky_node_get_attribute (node, "name"); g_free (priv->id_name); priv->id_name = g_strdup (attr); attr = wocky_node_get_attribute (node, "type"); g_free (priv->id_type); priv->id_type = g_strdup (attr); } wocky_node_each_child (query, store_muc_disco_info, priv); if (priv->state < WOCKY_MUC_INITIATED) priv->state = WOCKY_MUC_INITIATED; break; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (iq, NULL, &error, NULL, NULL); break; default: break; } out: if (error != NULL) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } g_simple_async_result_complete (result); g_object_unref (result); g_object_unref (muc); if (iq != NULL) g_object_unref (iq); } gboolean wocky_muc_disco_info_finish (WockyMuc *muc, GAsyncResult *res, GError **error) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (res); if (g_simple_async_result_propagate_error (result, error)) return FALSE; return TRUE; } void wocky_muc_disco_info_async (WockyMuc *muc, GAsyncReadyCallback callback, GCancellable *cancel, gpointer data) { WockyMucPrivate *priv = muc->priv; GSimpleAsyncResult *result; WockyStanza *iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, priv->user, priv->jid, '(', "query", ':', WOCKY_NS_DISCO_INFO, ')', NULL); result = g_simple_async_result_new (G_OBJECT (muc), callback, data, wocky_muc_disco_info_async); wocky_porter_send_iq_async (priv->porter, iq, cancel, muc_disco_info, result); } /* ask for MUC member list */ WockyStanza * wocky_muc_create_presence (WockyMuc *muc, WockyStanzaSubType type, const gchar *status) { WockyMucPrivate *priv = muc->priv; WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_PRESENCE, type, priv->user, priv->jid, NULL); WockyNode *presence = wocky_stanza_get_top_node (stanza); /* There should be separate API to leave a room, but atm there isn't... so * only allow the status to be set directly when making a presence to leave * the muc */ g_assert (status == NULL || type == WOCKY_STANZA_SUB_TYPE_UNAVAILABLE); if (status != NULL) { wocky_node_add_child_with_content (presence, "status", status); } else { g_signal_emit (muc, signals[SIG_FILL_PRESENCE], 0, stanza); } return stanza; } static void register_presence_handler (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; if (priv->pres_handler == 0) priv->pres_handler = wocky_porter_register_handler_from (priv->porter, WOCKY_STANZA_TYPE_PRESENCE, WOCKY_STANZA_SUB_TYPE_NONE, priv->rjid, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, handle_presence, muc, NULL); } static void register_message_handler (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; if (priv->mesg_handler == 0) priv->mesg_handler = wocky_porter_register_handler_from (priv->porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, priv->rjid, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, handle_message, muc, NULL); } static guint extract_status_codes (WockyNode *x) { guint codes = 0; WockyNodeIter iter; WockyNode *node; wocky_node_iter_init (&iter, x, "status", NULL); while (wocky_node_iter_next (&iter, &node)) { const gchar *code; WockyMucStatusCode cnum; code = wocky_node_get_attribute (node, "code"); if (code == NULL) continue; cnum = status_code_to_muc_flag (g_ascii_strtoull (code, NULL, 10)); codes |= cnum; /* OWN_PRESENCE is a SHOULD * * CHANGE_FORCED is a MUST which * * implies OWN_PRESENCE */ /* 201 (NEW_ROOM) also implies OWN_PRESENCE */ if (cnum == WOCKY_MUC_CODE_NICK_CHANGE_FORCED) codes |= WOCKY_MUC_CODE_OWN_PRESENCE; if (cnum == WOCKY_MUC_CODE_NEW_ROOM) codes |= WOCKY_MUC_CODE_OWN_PRESENCE; } return codes; } static void presence_features ( WockyMucPrivate *priv, guint codes) { if ((codes & WOCKY_MUC_CODE_CFG_ONYMOUS) != 0) { priv->room_type |= WOCKY_MUC_NONANONYMOUS; priv->room_type &= ~WOCKY_MUC_SEMIANONYMOUS; } else if ((codes & WOCKY_MUC_CODE_CFG_SEMIONYMOUS) != 0) { priv->room_type |= WOCKY_MUC_SEMIANONYMOUS; priv->room_type &= ~WOCKY_MUC_NONANONYMOUS; } else if ((codes & WOCKY_MUC_CODE_CFG_ANONYMOUS) != 0) { priv->room_type &= ~(WOCKY_MUC_NONANONYMOUS|WOCKY_MUC_SEMIANONYMOUS); } } #define REPLACE_STR(place,val) \ if (wocky_strdiff (place, val)) \ { \ g_free (place); \ place = g_strdup (val); \ } static void handle_self_presence (WockyMuc *muc, WockyStanza *stanza, const gchar *nick, WockyMucRole role, WockyMucAffiliation aff, const gchar *actor, const gchar *why, const gchar *status, guint codes) { gboolean nick_update = FALSE; gboolean permission_update = FALSE; WockyMucPrivate *priv = muc->priv; DEBUG ("Received our own presence"); if (wocky_strdiff (priv->nick, nick)) { nick_update = TRUE; g_free (priv->nick); priv->nick = g_strdup (nick); } /* we already know if we changed our own status, so no signal for that */ REPLACE_STR (priv->status, status); permission_update = ((priv->role != role) || (priv->affiliation != aff)); priv->role = role; priv->affiliation = aff; presence_features (priv, codes); if (nick_update) { gchar *new_jid = g_strdup_printf ("%s@%s/%s", priv->room, priv->service, priv->nick); g_free (priv->jid); priv->jid = new_jid; g_signal_emit (muc, signals[SIG_NICK_CHANGE], 0, stanza, codes); } if (permission_update) g_signal_emit (muc, signals[SIG_PERM_CHANGE], 0, stanza, codes, actor, why); } static gboolean handle_user_presence (WockyMuc *muc, WockyStanza *stanza, const gchar *from, const gchar *jid, const gchar *nick, WockyMucRole role, WockyMucAffiliation aff, const gchar *actor, const gchar *why, const gchar *status, guint codes) { WockyMucPrivate *priv = muc->priv; WockyMucMember *member = NULL; if (nick == NULL) return FALSE; member = g_hash_table_lookup (priv->members, from); if (member == NULL) { DEBUG ("New presence from %s, %s (state: %d)", from, nick, priv->state); member = alloc_member (); g_hash_table_insert (priv->members, g_strdup (from), member); } else { } REPLACE_STR (member->from, from); REPLACE_STR (member->jid, jid); REPLACE_STR (member->nick, nick); REPLACE_STR (member->status, status); member->role = role; member->affiliation = aff; if (member->presence_stanza != NULL) g_object_unref (member->presence_stanza); member->presence_stanza = g_object_ref (stanza); if (priv->state >= WOCKY_MUC_JOINED) g_signal_emit (muc, signals[SIG_PRESENCE], 0, stanza, codes, member); return TRUE; } static WockyMucRole string_to_role (const gchar *role) { if (!wocky_strdiff (role, "visitor")) return WOCKY_MUC_ROLE_VISITOR; if (!wocky_strdiff (role, "participant")) return WOCKY_MUC_ROLE_PARTICIPANT; if (!wocky_strdiff (role, "moderator")) return WOCKY_MUC_ROLE_MODERATOR; return WOCKY_MUC_ROLE_NONE; } static WockyMucAffiliation string_to_aff (const gchar *aff) { if (!wocky_strdiff (aff, "outcast")) return WOCKY_MUC_AFFILIATION_OUTCAST; if (!wocky_strdiff (aff, "member")) return WOCKY_MUC_AFFILIATION_MEMBER; if (!wocky_strdiff (aff, "admin")) return WOCKY_MUC_AFFILIATION_ADMIN; if (!wocky_strdiff (aff, "owner")) return WOCKY_MUC_AFFILIATION_OWNER; return WOCKY_MUC_AFFILIATION_NONE; } static gboolean handle_presence_standard (WockyMuc *muc, WockyStanza *stanza, WockyStanzaSubType type, const gchar *resource) { WockyNode *node = wocky_stanza_get_top_node (stanza); WockyNode *x = wocky_node_get_child_ns (node, "x", WOCKY_NS_MUC_USER); WockyNode *item = NULL; const gchar *from = wocky_stanza_get_from (stanza); const gchar *pjid = NULL; const gchar *pnic = NULL; const gchar *role = NULL; const gchar *aff = NULL; guint codes = 0; const gchar *ajid = NULL; const gchar *why = NULL; WockyMucPrivate *priv = muc->priv; WockyMucRole r = WOCKY_MUC_ROLE_NONE; WockyMucAffiliation a = WOCKY_MUC_AFFILIATION_NONE; gboolean self_presence = FALSE; const gchar *msg = NULL; msg = wocky_node_get_content_from_child (node, "status"); if (x == NULL) return FALSE; item = wocky_node_get_child (x, "item"); if (item != NULL) { WockyNode *actor = NULL; WockyNode *cause = NULL; pjid = wocky_node_get_attribute (item, "jid"); pnic = wocky_node_get_attribute (item, "nick"); role = wocky_node_get_attribute (item, "role"); aff = wocky_node_get_attribute (item, "affiliation"); actor = wocky_node_get_child (item, "actor"); cause = wocky_node_get_child (item, "reason"); r = string_to_role (role); a = string_to_aff (aff); if (actor != NULL) ajid = wocky_node_get_attribute (actor, "jid"); if (cause != NULL) why = cause->content; } /* if this was not in the item, set it from the envelope: */ if (pnic == NULL) pnic = resource; codes = extract_status_codes (x); /* belt and braces: it is possible OWN_PRESENCE is not set, as it is * * only a SHOULD in the RFC: check the 'from' stanza attribute and the * * jid item node attribute against the MUC jid and the users full jid * * respectively to see if this is our own presence */ if (!wocky_strdiff (priv->jid, from) || !wocky_strdiff (priv->user, pjid) ) codes |= WOCKY_MUC_CODE_OWN_PRESENCE; self_presence = (codes & WOCKY_MUC_CODE_OWN_PRESENCE) != 0; /* ok, we've extracted all the presence stanza data we should need: * * if this was a presence notification, deal with it: */ if (type == WOCKY_STANZA_SUB_TYPE_NONE) { /* if this was the first time we got our own presence it also means * * we successfully joined the channel, so update our internal state * * and emit the channel-joined signal */ if (self_presence) { handle_self_presence (muc, stanza, pnic, r, a, ajid, why, msg, codes); if (priv->state < WOCKY_MUC_JOINED) { priv->state = WOCKY_MUC_JOINED; if (priv->join_cb != NULL) { g_simple_async_result_complete (priv->join_cb); g_object_unref (priv->join_cb); priv->join_cb = NULL; } g_signal_emit (muc, signals[SIG_JOINED], 0, stanza, codes); } else g_signal_emit (muc, signals[SIG_OWN_PRESENCE], 0, stanza, codes); /* Allow other handlers to run for this stanza. */ return FALSE; } /* if this is someone else's presence, update internal member list */ else { return handle_user_presence (muc, stanza, from, /* room@service/nick */ pjid, /* jid attr from item */ pnic, /* nick attr from item or /res from envelope 'from' */ r, a, ajid, why, msg, codes); } } else if (type == WOCKY_STANZA_SUB_TYPE_UNAVAILABLE) { if (self_presence) { priv->state = WOCKY_MUC_ENDED; priv->role = WOCKY_MUC_ROLE_NONE; g_signal_emit (muc, signals[SIG_PARTED], 0, stanza, codes, ajid, why, msg); return TRUE; } else { WockyMucMember *member = g_hash_table_lookup (priv->members, from); if (member == NULL) { DEBUG ("Someone not in the muc left!?"); return FALSE; } g_signal_emit (muc, signals[SIG_LEFT], 0, stanza, codes, member, ajid, why, msg); g_hash_table_remove (priv->members, from); return TRUE; } } return FALSE; } static gboolean handle_presence_error (WockyMuc *muc, WockyStanza *stanza) { gboolean ok = FALSE; WockyMucPrivate *priv = muc->priv; GError *error = NULL; wocky_stanza_extract_errors (stanza, NULL, &error, NULL, NULL); if (priv->state >= WOCKY_MUC_JOINED) { DEBUG ("presence error after joining; not handled"); DEBUG (" %s: %s", wocky_xmpp_error_string (error->code), error->message); } g_signal_emit (muc, signals[SIG_PRESENCE_ERROR], 0, stanza, error->code, error->message); g_clear_error (&error); return ok; } static gboolean handle_presence (WockyPorter *porter, WockyStanza *stanza, gpointer data) { WockyMuc *muc = WOCKY_MUC (data); WockyStanzaSubType subtype; gboolean handled = FALSE; wocky_stanza_get_type_info (stanza, NULL, &subtype); switch (subtype) { case WOCKY_STANZA_SUB_TYPE_NONE: case WOCKY_STANZA_SUB_TYPE_UNAVAILABLE: { gchar *resource; /* If the JID is unparseable, discard the stanza. The porter shouldn't * even give us such stanzas. */ if (!wocky_decode_jid (wocky_stanza_get_from (stanza), NULL, NULL, &resource)) return TRUE; handled = handle_presence_standard (muc, stanza, subtype, resource); g_free (resource); break; } case WOCKY_STANZA_SUB_TYPE_ERROR: handled = handle_presence_error (muc, stanza); break; default: DEBUG ("unexpected stanza sub-type: %d", subtype); break; } return handled; } /* Looks up the sender of a message. If they're not currently a MUC member, * then a temporary structure is created, and @member_is_temporary is set to * %TRUE; the caller needs to free the returned value when they're done with * it. */ static WockyMucMember * get_message_sender (WockyMuc *muc, const gchar *from, gboolean *member_is_temporary) { WockyMucPrivate *priv = muc->priv; WockyMucMember *who = g_hash_table_lookup (priv->members, from); if (who != NULL) { *member_is_temporary = FALSE; return who; } /* Okay, it's from someone not currently in the MUC. We'll have to * fake up a structure. */ *member_is_temporary = TRUE; who = alloc_member (); who->from = wocky_normalise_jid (from); if (!wocky_strdiff (who->from, priv->jid)) { /* It's from us! */ who->jid = g_strdup (priv->user); who->nick = g_strdup (priv->nick); who->role = priv->role; who->affiliation = priv->affiliation; } /* else, we don't know anything more about the sender. * * FIXME: actually, if the server uses XEP-0203 Delayed Delivery * rather than XEP-0091 Legacy Delayed Delivery, the from='' * attribute of the element says who the original JID * actually was. Unfortunately, XEP-0091 said that from='' should be * the bare JID of the MUC, so it's completely useless. * * FIXME: also: we assume here that a delayed message from resource * /blah was sent by the user currently called /blah, but that ain't * necessarily so. */ return who; } /* * Parse timestamp of delayed messages. For non-delayed, it's 0. */ static GDateTime * extract_timestamp (WockyNode *msg) { WockyNode *x = wocky_node_get_child_ns (msg, "x", WOCKY_XMPP_NS_DELAY); GDateTime *stamp = NULL; if (x != NULL) { const gchar *tm = wocky_node_get_attribute (x, "stamp"); /* These timestamps do not contain a timezone, but are understood to be * in GMT. They're in the format yyyymmddThhmmss, so if we append 'Z' * we'll get (one of the many valid syntaxes for) an ISO-8601 timestamp. */ if (tm != NULL) { GTimeVal timeval = { 0, 0 }; gchar *tm_dup = g_strdup_printf ("%sZ", tm); /* FIXME: GTimeVal should go away */ if (!g_time_val_from_iso8601 (tm_dup, &timeval)) DEBUG ("Malformed date string '%s' for " WOCKY_XMPP_NS_DELAY, tm); else stamp = g_date_time_new_from_timeval_local (&timeval); g_free (tm_dup); } } return stamp; } /* Messages starting with /me are ACTION messages, and the /me should be * removed. type="chat" messages are NORMAL. Everything else is * something that doesn't necessarily expect a reply or ongoing * conversation ("normal") or has been auto-sent, so we make it NOTICE in * all other cases. */ static WockyMucMsgType determine_message_type (const gchar **body, WockyStanzaSubType sub_type) { WockyMucMsgType mtype = WOCKY_MUC_MSG_NOTICE; if (*body != NULL) { if (g_str_has_prefix (*body, "/me ")) { mtype = WOCKY_MUC_MSG_ACTION; *body += 4; } else if (g_str_equal (body, "/me")) { mtype = WOCKY_MUC_MSG_ACTION; *body = ""; } else if ((sub_type == WOCKY_STANZA_SUB_TYPE_GROUPCHAT) || (sub_type == WOCKY_STANZA_SUB_TYPE_CHAT)) { mtype = WOCKY_MUC_MSG_NORMAL; } } return mtype; } static WockyMucMsgState extract_chat_state (WockyNode *msg) { WockyNode *child = wocky_node_get_first_child_ns (msg, WOCKY_NS_CHATSTATE); WockyMucMsgState mstate; if (child == NULL || !wocky_enum_from_nick (WOCKY_TYPE_MUC_MSG_STATE, child->name, &mstate)) mstate = WOCKY_MUC_MSG_NONE; return mstate; } static gboolean handle_message (WockyPorter *porter, WockyStanza *stanza, gpointer data) { WockyMuc *muc = WOCKY_MUC (data); WockyNode *msg = wocky_stanza_get_top_node (stanza); const gchar *id = wocky_node_get_attribute (msg, "id"); const gchar *from = wocky_node_get_attribute (msg, "from"); const gchar *body = wocky_node_get_content_from_child (msg, "body"); const gchar *subj = wocky_node_get_content_from_child (msg, "subject"); GDateTime *datetime = extract_timestamp (msg); WockyStanzaSubType sub_type; WockyMucMsgType mtype; WockyMucMember *who = NULL; gboolean member_is_temporary = FALSE; wocky_stanza_get_type_info (stanza, NULL, &sub_type); /* if the message purports to be from a MUC member, treat as such: */ if (strchr (from, '/') != NULL) { who = get_message_sender (muc, from, &member_is_temporary); /* If it's a message from a member (as opposed to the MUC itself), and * it's not type='groupchat', then it's a non-MUC message relayed by the * MUC and therefore not our responsibility. */ if (sub_type != WOCKY_STANZA_SUB_TYPE_GROUPCHAT) { DEBUG ("Non groupchat message from MUC member %s: ignored.", from); return FALSE; } } mtype = determine_message_type (&body, sub_type); if (sub_type == WOCKY_STANZA_SUB_TYPE_ERROR) { WockyXmppErrorType etype; GError *error = NULL; wocky_stanza_extract_errors (stanza, &etype, &error, NULL, NULL); g_signal_emit (muc, signals[SIG_MSG_ERR], 0, stanza, mtype, id, datetime, who, body, error->code, etype); g_clear_error (&error); } else { WockyMucMsgState mstate = extract_chat_state (msg); g_signal_emit (muc, signals[SIG_MSG], 0, stanza, mtype, id, datetime, who, body, subj, mstate); } if (member_is_temporary) free_member (who); if (datetime != NULL) g_date_time_unref (datetime); return TRUE; } void wocky_muc_join (WockyMuc *muc, GCancellable *cancel) { WockyMucPrivate *priv = muc->priv; WockyStanza *presence = wocky_muc_create_presence (muc, WOCKY_STANZA_SUB_TYPE_NONE, NULL); WockyNode *x = wocky_node_add_child_ns (wocky_stanza_get_top_node (presence), "x", WOCKY_NS_MUC); if (priv->pass != NULL) wocky_node_add_child_with_content (x, "password", priv->pass); if (priv->state < WOCKY_MUC_INITIATED) { register_presence_handler (muc); register_message_handler (muc); } priv->state = WOCKY_MUC_INITIATED; wocky_porter_send (priv->porter, presence); g_object_unref (presence); } /* misc meta data */ const gchar * wocky_muc_jid (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; return priv->jid; } WockyMucRole wocky_muc_role (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; return priv->role; } WockyMucAffiliation wocky_muc_affiliation (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; return priv->affiliation; } const gchar * wocky_muc_user (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; return priv->user; } GHashTable * wocky_muc_members (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; if (priv->members != NULL) return g_hash_table_ref (priv->members); return NULL; } WockyMucState wocky_muc_get_state (WockyMuc *muc) { WockyMucPrivate *priv = muc->priv; return priv->state; } /* send message to muc */ /* send message to participant */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-porter.c0000644000175000017500000007655012051446215023023 0ustar00wjtwjt00000000000000/* * wocky-porter.c - Source for WockyPorter * Copyright (C) 2009-2011 Collabora Ltd. * * 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 */ #include "wocky-porter.h" #include "wocky-signals-marshal.h" #include "wocky-xmpp-connection.h" G_DEFINE_INTERFACE (WockyPorter, wocky_porter, G_TYPE_OBJECT) static void wocky_porter_default_init (WockyPorterInterface *iface) { GType iface_type = G_TYPE_FROM_INTERFACE (iface); static gsize initialization_value = 0; GParamSpec *spec; if (g_once_init_enter (&initialization_value)) { /** * WockyPorter:connection: * * The underlying #WockyXmppConnection wrapped by the #WockyPorter */ spec = g_param_spec_object ("connection", "XMPP connection", "the XMPP connection used by this porter", WOCKY_TYPE_XMPP_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (iface, spec); /** * WockyPorter:full-jid: * * The user's full JID (node@domain/resource). */ spec = g_param_spec_string ("full-jid", "Full JID", "The user's own full JID (node@domain/resource)", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (iface, spec); /** * WockyPorter:bare-jid: * * The user's bare JID (node@domain). */ spec = g_param_spec_string ("bare-jid", "Bare JID", "The user's own bare JID (node@domain)", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (iface, spec); /** * WockyPorter:resource: * * The resource part of the user's full JID, or %NULL if their full JID does * not contain a resource at all. */ spec = g_param_spec_string ("resource", "Resource", "The user's resource", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (iface, spec); /** * WockyPorter::remote-closed: * @porter: the object on which the signal is emitted * * The ::remote-closed signal is emitted when the other side closed the XMPP * stream. */ g_signal_new ("remote-closed", iface_type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /** * WockyPorter::remote-error: * @porter: the object on which the signal is emitted * @domain: error domain (a #GQuark) * @code: error code * @message: human-readable informative error message * * The ::remote-error signal is emitted when an error has been detected * on the XMPP stream. */ g_signal_new ("remote-error", iface_type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__UINT_INT_STRING, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); /** * WockyPorter::closing: * @porter: the object on which the signal is emitted * * The ::closing signal is emitted when the #WockyPorter starts to close its * XMPP connection. Once this signal has been emitted, the #WockyPorter * can't be used to send stanzas any more. */ g_signal_new ("closing", iface_type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /** * WockyPorter::sending: * @porter: the object on which the signal is emitted * @stanza: the #WockyStanza being sent, or %NULL if @porter is just * sending whitespace * * The ::sending signal is emitted whenever #WockyPorter sends data * on the XMPP connection. */ g_signal_new ("sending", iface_type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, WOCKY_TYPE_STANZA); g_once_init_leave (&initialization_value, 1); } } /** * wocky_porter_error_quark: * * Get the error quark used by the porter. * * Returns: the quark for porter errors. */ GQuark wocky_porter_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-porter-error"); return quark; } /** * wocky_porter_get_full_jid: (skip) * @self: a porter * * * * Returns: (transfer none): the value of #WockyPorter:full-jid */ const gchar * wocky_porter_get_full_jid (WockyPorter *self) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), NULL); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->get_full_jid != NULL); return iface->get_full_jid (self); } /** * wocky_porter_get_bare_jid: (skip) * @self: a porter * * * * Returns: (transfer none): the value of #WockyPorter:bare-jid */ const gchar * wocky_porter_get_bare_jid (WockyPorter *self) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), NULL); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->get_bare_jid != NULL); return iface->get_bare_jid (self); } /** * wocky_porter_get_resource: (skip) * @self: a porter * * * * Returns: (transfer none): the value of #WockyPorter:resource */ const gchar * wocky_porter_get_resource (WockyPorter *self) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), NULL); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->get_resource != NULL); return iface->get_resource (self); } /** * wocky_porter_start: * @porter: a #WockyPorter * * Start a #WockyPorter to make it read and dispatch incoming stanzas. */ void wocky_porter_start (WockyPorter *self) { WockyPorterInterface *iface; g_return_if_fail (WOCKY_IS_PORTER (self)); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->start != NULL); iface->start (self); } /** * wocky_porter_send_async: * @porter: a #WockyPorter * @stanza: the #WockyStanza to send * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: callback to call when the request is satisfied * @user_data: the data to pass to callback function * * Request asynchronous sending of a #WockyStanza. * When the stanza has been sent callback will be called. * You can then call wocky_porter_send_finish() to get the result * of the operation. */ void wocky_porter_send_async (WockyPorter *self, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPorterInterface *iface; g_return_if_fail (WOCKY_IS_PORTER (self)); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->send_async != NULL); iface->send_async (self, stanza, cancellable, callback, user_data); } /** * wocky_porter_send_finish: * @porter: a #WockyPorter * @result: a #GAsyncResult * @error: a #GError location to store the error occuring, or %NULL to * ignore. * * Finishes sending a #WockyStanza. * * Returns: %TRUE on success or %FALSE on error. */ gboolean wocky_porter_send_finish (WockyPorter *self, GAsyncResult *result, GError **error) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), FALSE); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->send_finish != NULL); return iface->send_finish (self, result, error); } /** * wocky_porter_send: * @porter: a #WockyPorter * @stanza: the #WockyStanza to send * * Send a #WockyStanza. This is a convenient function to not have to * call wocky_porter_send_async() with lot of %NULL arguments if you * don't care to know when the stanza has been actually sent. */ void wocky_porter_send (WockyPorter *porter, WockyStanza *stanza) { wocky_porter_send_async (porter, stanza, NULL, NULL, NULL); } /** * wocky_porter_register_handler_from_va: * @self: A #WockyPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @from: the JID whose messages this handler is intended for (may not be * %NULL) * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @ap: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * A va_list version of wocky_porter_register_handler_from(); see * that function for more details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_porter_register_handler_from_va (WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap) { guint ret; WockyStanza *stanza; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); g_return_val_if_fail (from != NULL, 0); if (type == WOCKY_STANZA_TYPE_NONE) { stanza = NULL; g_return_val_if_fail ( (va_arg (ap, WockyNodeBuildTag) == 0) && "Pattern-matching is not supported when matching stanzas " "of any type", 0); } else { stanza = wocky_stanza_build_va (type, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ap); g_assert (stanza != NULL); } ret = wocky_porter_register_handler_from_by_stanza (self, type, sub_type, from, priority, callback, user_data, stanza); if (stanza != NULL) g_object_unref (stanza); return ret; } /** * wocky_porter_register_handler_from_by_stanza: * @self: A #WockyPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @from: the JID whose messages this handler is intended for (may not be * %NULL) * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @stanza: a #WockyStanza. The handler will match a stanza only if * the stanza received is a superset of the one passed to this * function, as per wocky_node_is_superset(). * * A #WockyStanza version of wocky_porter_register_handler_from(); see * that function for more details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_porter_register_handler_from_by_stanza (WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); g_return_val_if_fail (from != NULL, 0); if (type == WOCKY_STANZA_TYPE_NONE) g_return_val_if_fail (stanza == NULL, 0); else g_return_val_if_fail (WOCKY_IS_STANZA (stanza), 0); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->register_handler_from_by_stanza != NULL); return iface->register_handler_from_by_stanza (self, type, sub_type, from, priority, callback, user_data, stanza); } /** * wocky_porter_register_handler_from: * @self: A #WockyPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @from: the JID whose messages this handler is intended for (may not be * %NULL) * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @...: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * Register a new stanza handler. * Stanza handlers are called when the Porter receives a new stanza matching * the rules of the handler. Matching handlers are sorted by priority and are * called until one claims to have handled the stanza (by returning %TRUE). * * If @from is a bare JID, then the resource of the JID in the from attribute * will be ignored: In other words, a handler registered against a bare JID * will match _all_ stanzas from a JID with the same node and domain: * "foo@bar.org" will match * "foo@bar.org", "foo@bar.org/moose" and so forth. * * To register an IQ handler from Juliet for all the Jingle stanzas related * to one Jingle session: * * |[ * id = wocky_porter_register_handler (porter, * WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, * WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, jingle_cb, * "juliet@example.com/Balcony", * '(', "jingle", * ':', "urn:xmpp:jingle:1", * '@', "sid", "my_sid", * ')', NULL); * ]| * * To match stanzas from any sender, see * wocky_porter_register_handler_from_anyone(). If the porter is a * #WockyC2SPorter, one can match stanzas sent by the server; see * wocky_c2s_porter_register_handler_from_server(). * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_porter_register_handler_from (WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) { va_list ap; guint ret; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); g_return_val_if_fail (from != NULL, 0); va_start (ap, user_data); ret = wocky_porter_register_handler_from_va (self, type, sub_type, from, priority, callback, user_data, ap); va_end (ap); return ret; } /** * wocky_porter_register_handler_from_anyone_va: * @self: A #WockyPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @ap: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * A va_list version of * wocky_porter_register_handler_from_anyone(); see that function for more * details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_porter_register_handler_from_anyone_va ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap) { guint ret; WockyStanza *stanza; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); if (type == WOCKY_STANZA_TYPE_NONE) { stanza = NULL; g_return_val_if_fail ( (va_arg (ap, WockyNodeBuildTag) == 0) && "Pattern-matching is not supported when matching stanzas " "of any type", 0); } else { stanza = wocky_stanza_build_va (type, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ap); g_assert (stanza != NULL); } ret = wocky_porter_register_handler_from_anyone_by_stanza (self, type, sub_type, priority, callback, user_data, stanza); if (stanza != NULL) g_object_unref (stanza); return ret; } /** * wocky_porter_register_handler_from_anyone_by_stanza: * @self: A #WockyPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @stanza: a #WockyStanza. The handler will match a stanza only if * the stanza received is a superset of the one passed to this * function, as per wocky_node_is_superset(). * * A #WockyStanza version of * wocky_porter_register_handler_from_anyone(); see that function for * more details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_porter_register_handler_from_anyone_by_stanza ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); if (type == WOCKY_STANZA_TYPE_NONE) g_return_val_if_fail (stanza == NULL, 0); else g_return_val_if_fail (WOCKY_IS_STANZA (stanza), 0); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->register_handler_from_anyone_by_stanza != NULL); return iface->register_handler_from_anyone_by_stanza (self, type, sub_type, priority, callback, user_data, stanza); } /** * wocky_porter_register_handler_from_anyone: * @self: A #WockyPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @...: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * Registers a handler for incoming stanzas from anyone, including those where * the from attribute is missing. * * For example, to register a handler matching all message stanzas received * from anyone, call: * * |[ * id = wocky_porter_register_handler (porter, * WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, * WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, message_received_cb, NULL, * NULL); * ]| * * As a more interesting example, the following matches incoming PEP * notifications for contacts' geolocation information: * * |[ * id = wocky_porter_register_handler_from_anyone (porter, * WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, * WOCKY_PORTER_HANDLER_PRIORITY_MAX, * msg_event_cb, self, * '(', "event", * ':', WOCKY_XMPP_NS_PUBSUB_EVENT, * '(', "items", * '@', "node", "http://jabber.org/protocol/geoloc", * ')', * ')', * NULL); * ]| * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_porter_register_handler_from_anyone ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) { va_list ap; guint ret; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); va_start (ap, user_data); ret = wocky_porter_register_handler_from_anyone_va (self, type, sub_type, priority, callback, user_data, ap); va_end (ap); return ret; } /** * wocky_porter_unregister_handler: * @porter: a #WockyPorter * @id: the id of the handler to unregister * * Unregister a registered handler. This handler won't be called when * receiving stanzas anymore. */ void wocky_porter_unregister_handler (WockyPorter *self, guint id) { WockyPorterInterface *iface; g_return_if_fail (WOCKY_IS_PORTER (self)); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->unregister_handler != NULL); iface->unregister_handler (self, id); } /** * wocky_porter_close_async: * @porter: a #WockyPorter * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: callback to call when the request is satisfied * @user_data: the data to pass to callback function * * Request asynchronous closing of a #WockyPorter. This fires the * WockyPorter::closing signal, flushes the sending queue, closes the XMPP * stream and waits that the other side closes the XMPP stream as well. * When this is done, @callback is called. * You can then call wocky_porter_close_finish() to get the result of * the operation. */ void wocky_porter_close_async (WockyPorter *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPorterInterface *iface; g_return_if_fail (WOCKY_IS_PORTER (self)); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->close_async != NULL); iface->close_async (self, cancellable, callback, user_data); } /** * wocky_porter_close_finish: * @porter: a #WockyPorter * @result: a #GAsyncResult * @error: a #GError location to store the error occuring, or %NULL to ignore. * * Finishes a close operation. * * Returns: %TRUE on success or %FALSE on error. */ gboolean wocky_porter_close_finish (WockyPorter *self, GAsyncResult *result, GError **error) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), FALSE); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->close_finish != NULL); return iface->close_finish (self, result, error); } /** * wocky_porter_send_iq_async: * @porter: a #WockyPorter * @stanza: the #WockyStanza to send * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: callback to call when the request is satisfied * @user_data: the data to pass to callback function * * Request asynchronous sending of a #WockyStanza of type * %WOCKY_STANZA_TYPE_IQ and sub-type %WOCKY_STANZA_SUB_TYPE_GET or * %WOCKY_STANZA_SUB_TYPE_SET. * When the reply to this IQ has been received callback will be called. * You can then call #wocky_porter_send_iq_finish to get the reply stanza. */ void wocky_porter_send_iq_async (WockyPorter *self, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPorterInterface *iface; g_return_if_fail (WOCKY_IS_PORTER (self)); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->send_iq_async != NULL); iface->send_iq_async (self, stanza, cancellable, callback, user_data); } /** * wocky_porter_send_iq_finish: * @porter: a #WockyPorter * @result: a #GAsyncResult * @error: a #GError location to store the error occuring, or %NULL to ignore. * * Get the reply of an IQ query. * * Returns: a reffed #WockyStanza on success, %NULL on error */ WockyStanza * wocky_porter_send_iq_finish (WockyPorter *self, GAsyncResult *result, GError **error) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), FALSE); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->send_iq_finish != NULL); return iface->send_iq_finish (self, result, error); } /** * wocky_porter_acknowledge_iq: * @porter: a #WockyPorter * @stanza: a stanza of type #WOCKY_STANZA_TYPE_IQ and sub-type either * #WOCKY_STANZA_SUB_TYPE_SET or #WOCKY_STANZA_SUB_TYPE_GET * @...: a wocky_stanza_build() specification; pass %NULL to include no * body in the reply. * * Sends an acknowledgement for @stanza back to the sender, as a shorthand for * calling wocky_stanza_build_iq_result() and wocky_porter_send(). */ void wocky_porter_acknowledge_iq ( WockyPorter *porter, WockyStanza *stanza, ...) { WockyStanzaType type; WockyStanzaSubType sub_type; WockyStanza *result; va_list ap; g_return_if_fail (WOCKY_IS_PORTER (porter)); g_return_if_fail (WOCKY_IS_STANZA (stanza)); wocky_stanza_get_type_info (stanza, &type, &sub_type); g_return_if_fail (type == WOCKY_STANZA_TYPE_IQ); g_return_if_fail (sub_type == WOCKY_STANZA_SUB_TYPE_GET || sub_type == WOCKY_STANZA_SUB_TYPE_SET); va_start (ap, stanza); result = wocky_stanza_build_iq_result_va (stanza, ap); va_end (ap); if (result != NULL) { wocky_porter_send (porter, result); g_object_unref (result); } } /** * wocky_porter_send_iq_error: * @porter: the porter whence @stanza came * @stanza: a stanza of type %WOCKY_STANZA_TYPE_IQ and sub-type either * #WOCKY_STANZA_SUB_TYPE_SET or #WOCKY_STANZA_SUB_TYPE_GET * @error_code: an XMPP Core stanza error code * @message: (allow-none): an optional error message to include with the reply. * * Sends an error reply for @stanza back to its sender, with the given * @error_code and @message, and including the child element from the original * stanza. * * To send error replies with more detailed error elements, see * wocky_porter_send_iq_gerror(), or use wocky_stanza_build_iq_error() and * wocky_porter_send() directly, possibly using wocky_stanza_error_to_node() to * construct the error element. */ void wocky_porter_send_iq_error ( WockyPorter *porter, WockyStanza *stanza, WockyXmppError error_code, const gchar *message) { WockyStanzaType type; WockyStanzaSubType sub_type; GError *error = NULL; g_return_if_fail (WOCKY_IS_PORTER (porter)); g_return_if_fail (WOCKY_IS_STANZA (stanza)); wocky_stanza_get_type_info (stanza, &type, &sub_type); g_return_if_fail (type == WOCKY_STANZA_TYPE_IQ); g_return_if_fail (sub_type == WOCKY_STANZA_SUB_TYPE_GET || sub_type == WOCKY_STANZA_SUB_TYPE_SET); g_return_if_fail (error_code < NUM_WOCKY_XMPP_ERRORS); error = g_error_new_literal (WOCKY_XMPP_ERROR, error_code, message != NULL ? message : ""); wocky_porter_send_iq_gerror (porter, stanza, error); g_clear_error (&error); } /** * wocky_porter_send_iq_gerror: * @porter: the porter whence @stanza came * @stanza: a stanza of type %WOCKY_STANZA_TYPE_IQ and sub-type either * #WOCKY_STANZA_SUB_TYPE_SET or #WOCKY_STANZA_SUB_TYPE_GET * @error: an error whose domain is either %WOCKY_XMPP_ERROR, some other stanza * error domain supplied with Wocky (such as %WOCKY_JINGLE_ERROR or * %WOCKY_SI_ERROR), or a custom domain registered with * wocky_xmpp_error_register_domain() * * Sends an error reply for @stanza back to its sender, building the * <error/> element from the given @error. To send error * replies with simple XMPP Core stanza errors in the %WOCKY_XMPP_ERROR domain, * wocky_porter_send_iq_error() may be more convenient to use. */ void wocky_porter_send_iq_gerror ( WockyPorter *porter, WockyStanza *stanza, const GError *error) { WockyStanzaType type; WockyStanzaSubType sub_type; WockyStanza *result; WockyNode *result_node; g_return_if_fail (WOCKY_IS_PORTER (porter)); g_return_if_fail (WOCKY_IS_STANZA (stanza)); g_return_if_fail (error != NULL); wocky_stanza_get_type_info (stanza, &type, &sub_type); g_return_if_fail (type == WOCKY_STANZA_TYPE_IQ); g_return_if_fail (sub_type == WOCKY_STANZA_SUB_TYPE_GET || sub_type == WOCKY_STANZA_SUB_TYPE_SET); result = wocky_stanza_build_iq_error (stanza, '*', &result_node, NULL); if (result != NULL) { /* RFC3920 §9.2.3 dictates: * An IQ stanza of type "error" … MUST include an child. */ wocky_stanza_error_to_node (error, result_node); wocky_porter_send (porter, result); g_object_unref (result); } } /** * wocky_porter_force_close_async: * @porter: a #WockyPorter * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: callback to call when the request is satisfied * @user_data: the data to pass to callback function * * Force the #WockyPorter to close the TCP connection of the underlying * #WockyXmppConnection. * If a close operation is pending, it will be completed with the * %WOCKY_PORTER_ERROR_FORCIBLY_CLOSED error. * When the connection has been closed, @callback will be called. * You can then call wocky_porter_force_close_finish() to get the result of * the operation. */ void wocky_porter_force_close_async (WockyPorter *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPorterInterface *iface; g_return_if_fail (WOCKY_IS_PORTER (self)); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->force_close_async != NULL); iface->force_close_async (self, cancellable, callback, user_data); } /** * wocky_porter_force_close_finish: * @porter: a #WockyPorter * @result: a #GAsyncResult * @error: a #GError location to store the error occuring, or %NULL to ignore. * * Finishes a force close operation. * * Returns: %TRUE on success or %FALSE on error. */ gboolean wocky_porter_force_close_finish ( WockyPorter *self, GAsyncResult *result, GError **error) { WockyPorterInterface *iface; g_return_val_if_fail (WOCKY_IS_PORTER (self), FALSE); iface = WOCKY_PORTER_GET_INTERFACE (self); g_assert (iface->force_close_finish != NULL); return iface->force_close_finish (self, result, error); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-node.h0000644000175000017500000001726612050202021022421 0ustar00wjtwjt00000000000000/* * wocky-node.h - Header for Wocky xmpp nodes * Copyright (C) 2006-2010 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY__NODE_H__ #define __WOCKY__NODE_H__ #include #include "wocky-types.h" G_BEGIN_DECLS /** * WockyNodeBuildTag: * @WOCKY_NODE_START: Start of a node * @WOCKY_NODE_TEXT: Text content of a node * @WOCKY_NODE_END: End of a node * @WOCKY_NODE_ATTRIBUTE: A node attribute * @WOCKY_NODE_XMLNS: A node XML namespace * @WOCKY_NODE_ASSIGN_TO: a #WockyNode to assign * * Tags for building a stanza using wocky_stanza_build() or * wocky_node_add_build(). */ typedef enum { WOCKY_NODE_START = '(', WOCKY_NODE_TEXT = '$', WOCKY_NODE_END = 41, /* this is actually ')', but gtk-doc is broken: bgo#644291 */ WOCKY_NODE_ATTRIBUTE = '@', WOCKY_NODE_XMLNS = ':', WOCKY_NODE_ASSIGN_TO = '*', WOCKY_NODE_LANGUAGE = '#' } WockyNodeBuildTag; typedef struct _WockyNode WockyNode; /** * WockyNode: * @name: name of the node * @content: content of the node * * A single #WockyNode structure that relates to an element in an XMPP * stanza. */ struct _WockyNode { gchar *name; gchar *content; /*< private >*/ gchar *language; GQuark ns; GSList *attributes; GSList *children; }; /** * wocky_node_each_attr_func: * @key: the attribute's key * @value: the attribute's value * @pref: the attribute's prefix * @ns: the attribute's namespace * @user_data: user data passed to wocky_node_each_attribute() * * Specifies the type of functions passed to wocky_node_each_attribute(). * * Returns: %FALSE to stop further attributes from being examined. */ typedef gboolean (*wocky_node_each_attr_func) (const gchar *key, const gchar *value, const gchar *pref, const gchar *ns, gpointer user_data); /** * wocky_node_each_child_func: * @node: a #WockyNode * @user_data: user data passed to wocky_node_each_child() * * Specifies the type of functions passed to wocky_node_each_child(). * * Returns: %FALSE to stop further children from being examined. */ typedef gboolean (*wocky_node_each_child_func) (WockyNode *node, gpointer user_data); void wocky_node_each_attribute (WockyNode *node, wocky_node_each_attr_func func, gpointer user_data); void wocky_node_each_child (WockyNode *node, wocky_node_each_child_func func, gpointer user_data); const gchar *wocky_node_get_attribute (WockyNode *node, const gchar *key); const gchar *wocky_node_get_attribute_ns (WockyNode *node, const gchar *key, const gchar *ns); void wocky_node_set_attribute (WockyNode *node, const gchar *key, const gchar *value); void wocky_node_set_attributes (WockyNode *node, const gchar *key, ...); void wocky_node_set_attribute_ns (WockyNode *node, const gchar *key, const gchar *value, const gchar *ns); /* Set attribute with the given size for the value */ void wocky_node_set_attribute_n (WockyNode *node, const gchar *key, const gchar *value, gsize value_size); void wocky_node_set_attribute_n_ns (WockyNode *node, const gchar *key, const gchar *value, gsize value_size, const gchar *ns); /* namespaced attributes: when we want to override autogenerated prefixes */ const gchar *wocky_node_attribute_ns_get_prefix_from_urn (const gchar *urn); const gchar *wocky_node_attribute_ns_get_prefix_from_quark (GQuark ns); void wocky_node_attribute_ns_set_prefix (GQuark ns, const gchar *prefix); /* Getting children */ WockyNode *wocky_node_get_child (WockyNode *node, const gchar *name); WockyNode *wocky_node_get_child_ns (WockyNode *node, const gchar *name, const gchar *ns); WockyNode *wocky_node_get_first_child (WockyNode *node); WockyNode *wocky_node_get_first_child_ns (WockyNode *node, const gchar *ns); /* Getting content from children */ const gchar *wocky_node_get_content_from_child (WockyNode *node, const gchar *name); const gchar *wocky_node_get_content_from_child_ns (WockyNode *node, const gchar *name, const gchar *ns); /* Creating child nodes */ WockyNode *wocky_node_add_child (WockyNode *node, const gchar *name); WockyNode *wocky_node_add_child_ns (WockyNode *node, const gchar *name, const gchar *ns); WockyNode *wocky_node_add_child_ns_q (WockyNode *node, const gchar *name, GQuark ns); WockyNode *wocky_node_add_child_with_content (WockyNode *node, const gchar *name, const char *content); WockyNode *wocky_node_add_child_with_content_ns ( WockyNode *node, const gchar *name, const gchar *content, const gchar *ns); WockyNode *wocky_node_add_child_with_content_ns_q ( WockyNode *node, const gchar *name, const gchar *content, GQuark ns); /* Getting namespaces */ const gchar *wocky_node_get_ns (WockyNode *node); gboolean wocky_node_has_ns (WockyNode *node, const gchar *ns); gboolean wocky_node_has_ns_q (WockyNode *node, GQuark ns); /* Matching element name and namespace */ gboolean wocky_node_matches_q ( WockyNode *node, const gchar *name, GQuark ns); gboolean wocky_node_matches ( WockyNode *node, const gchar *name, const gchar *ns); /* Setting/Getting language */ const gchar *wocky_node_get_language (WockyNode *node); void wocky_node_set_language (WockyNode *node, const gchar *lang); void wocky_node_set_language_n (WockyNode *node, const gchar *lang, gsize lang_size); /* Setting or adding content */ void wocky_node_set_content (WockyNode *node, const gchar *content); void wocky_node_append_content (WockyNode *node, const gchar *content); void wocky_node_append_content_n (WockyNode *node, const gchar *content, gsize size); /* Return a reading friendly representation of a node and its children. * Should be use for debugging purpose only. */ gchar *wocky_node_to_string (WockyNode *node); /* Create a new standalone node, usually only used by the stanza object */ WockyNode *wocky_node_new (const char *name, const gchar *ns); /* Frees the node and all it's children! */ void wocky_node_free (WockyNode *node); /* Compare two nodes and all their children */ gboolean wocky_node_equal (WockyNode *node0, WockyNode *node1); gboolean wocky_node_is_superset (WockyNode *node, WockyNode *subset); /** * WockyNodeIter: * * Iterate over a node's children. See wocky_node_iter_init() for more * details. */ typedef struct { /**/ GSList *pending; const gchar *name; GQuark ns; } WockyNodeIter; void wocky_node_iter_init (WockyNodeIter *iter, WockyNode *node, const gchar *name, const gchar *ns); gboolean wocky_node_iter_next (WockyNodeIter *iter, WockyNode **next); void wocky_node_add_build (WockyNode *node, ...) G_GNUC_NULL_TERMINATED; void wocky_node_add_build_va (WockyNode *node, va_list va); void wocky_node_add_node_tree (WockyNode *node, WockyNodeTree *tree); void wocky_node_prepend_node_tree ( WockyNode *node, WockyNodeTree *tree); void wocky_node_init (void); void wocky_node_deinit (void); G_END_DECLS #endif /* #ifndef __WOCKY__NODE_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-node-internal.h0000644000175000017500000000302412050202021025514 0ustar00wjtwjt00000000000000/* * wocky-pubsub-node-internal.h - internal methods on WockyPubsubNode * used by WockyPubsubService * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ #if !defined (WOCKY_COMPILATION) # error "This is an internal header." #endif #ifndef WOCKY_PUBSUB_NODE_INTERNAL_H #define WOCKY_PUBSUB_NODE_INTERNAL_H #include "wocky-pubsub-node.h" typedef void (*WockyPubsubNodeEventHandler) ( WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *action_node); typedef struct { const gchar *action; WockyPubsubNodeEventHandler method; } WockyPubsubNodeEventMapping; const WockyPubsubNodeEventMapping *_wocky_pubsub_node_get_event_mappings ( guint *n_mappings); #endif /* WOCKY_PUBSUB_NODE_INTERNAL_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls-common.c0000644000175000017500000000272112050202021023545 0ustar00wjtwjt00000000000000/* * Wocky TLS integration - common stuff for GNUTLS and OpenSSL backends * (This would be called wocky-tls.c, but that's the GNUTLS backend for * historical reasons.) * * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima * Copyright © 2008-2009 Codethink Limited * Copyright © 2009-2012 Collabora Limited * * This program 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 of the licence or (at * your option) any later version. * * Authors: Vivek Dasmohapatra * Ryan Lortie * Christian Kellner * Samuel Cormier-Iijima * * Based on an unmerged gnio feature. See wocky-tls.c for details. */ #include "config.h" #include "wocky-tls.h" GQuark wocky_tls_cert_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-tls-cert-error"); return quark; } GQuark wocky_tls_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-tls-error"); return quark; } /* this file is "borrowed" from an unmerged gnio feature: */ /* Local Variables: */ /* c-file-style: "gnu" */ /* End: */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-error.c0000644000175000017500000005073112051446215023614 0ustar00wjtwjt00000000000000/* * wocky-xmpp-error.c - Source for Wocky's XMPP error handling API * Copyright (C) 2006-2009 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * 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 */ #include "wocky-xmpp-error.h" #include #include #include "wocky-namespaces.h" #include "wocky-utils.h" /* Definitions of XMPP core stanza errors, as per RFC 3920 §9.3; plus the * corresponding legacy error codes as described by XEP-0086. */ #define MAX_LEGACY_ERRORS 3 typedef struct { const gchar *description; WockyXmppErrorType type; const guint16 legacy_errors[MAX_LEGACY_ERRORS]; } XmppErrorSpec; static const XmppErrorSpec xmpp_errors[NUM_WOCKY_XMPP_ERRORS] = { /* undefined-condition */ { "application-specific condition", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 500, 0, }, }, /* redirect */ { "the recipient or server is redirecting requests for this information " "to another entity", WOCKY_XMPP_ERROR_TYPE_MODIFY, { 302, 0, }, }, /* gone */ { "the recipient or server can no longer be contacted at this address", WOCKY_XMPP_ERROR_TYPE_MODIFY, { 302, 0, }, }, /* bad-request */ { "the sender has sent XML that is malformed or that cannot be processed", WOCKY_XMPP_ERROR_TYPE_MODIFY, { 400, 0, }, }, /* unexpected-request */ { "the recipient or server understood the request but was not expecting " "it at this time", WOCKY_XMPP_ERROR_TYPE_WAIT, { 400, 0, }, }, /* jid-malformed */ { "the sending entity has provided or communicated an XMPP address or " "aspect thereof (e.g., a resource identifier) that does not adhere " "to the syntax defined in Addressing Scheme (Section 3)", WOCKY_XMPP_ERROR_TYPE_MODIFY, { 400, 0, }, }, /* not-authorized */ { "the sender must provide proper credentials before being allowed to " "perform the action, or has provided improper credentials", WOCKY_XMPP_ERROR_TYPE_AUTH, { 401, 0, }, }, /* payment-required */ { "the requesting entity is not authorized to access the requested " "service because payment is required", WOCKY_XMPP_ERROR_TYPE_AUTH, { 402, 0, }, }, /* forbidden */ { "the requesting entity does not possess the required permissions to " "perform the action", WOCKY_XMPP_ERROR_TYPE_AUTH, { 403, 0, }, }, /* item-not-found */ { "the addressed JID or item requested cannot be found", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 404, 0, }, }, /* recipient-unavailable */ { "the intended recipient is temporarily unavailable", WOCKY_XMPP_ERROR_TYPE_WAIT, { 404, 0, }, }, /* remote-server-not-found */ { "a remote server or service specified as part or all of the JID of the " "intended recipient (or required to fulfill a request) could not be " "contacted within a reasonable amount of time", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 404, 0, }, }, /* not-allowed */ { "the recipient or server does not allow any entity to perform the action", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 405, 0, }, }, /* not-acceptable */ { "the recipient or server understands the request but is refusing to " "process it because it does not meet criteria defined by the recipient " "or server (e.g., a local policy regarding acceptable words in messages)", WOCKY_XMPP_ERROR_TYPE_MODIFY, { 406, 0, }, }, /* registration-required */ { "the requesting entity is not authorized to access the requested service " "because registration is required", WOCKY_XMPP_ERROR_TYPE_AUTH, { 407, 0, }, }, /* subscription-required */ { "the requesting entity is not authorized to access the requested service " "because a subscription is required", WOCKY_XMPP_ERROR_TYPE_AUTH, { 407, 0, }, }, /* remote-server-timeout */ { "a remote server or service specified as part or all of the JID of the " "intended recipient (or required to fulfill a request) could not be " "contacted within a reasonable amount of time", WOCKY_XMPP_ERROR_TYPE_WAIT, { 504, 408, 0, }, }, /* conflict */ { "access cannot be granted because an existing resource or session exists " "with the same name or address", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 409, 0, }, }, /* internal-server-error */ { "the server could not process the stanza because of a misconfiguration " "or an otherwise-undefined internal server error", WOCKY_XMPP_ERROR_TYPE_WAIT, { 500, 0, }, }, /* resource-constraint */ { "the server or recipient lacks the system resources necessary to service " "the request", WOCKY_XMPP_ERROR_TYPE_WAIT, { 500, 0, }, }, /* feature-not-implemented */ { "the feature requested is not implemented by the recipient or server and " "therefore cannot be processed", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 501, 0, }, }, /* service-unavailable */ { "the server or recipient does not currently provide the requested " "service", WOCKY_XMPP_ERROR_TYPE_CANCEL, { 503, 502, 510, }, }, }; GQuark wocky_xmpp_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string (WOCKY_XMPP_NS_STANZAS); return quark; } /** * wocky_xmpp_error_string: * @error: a core stanza error * * * * Returns: the name of the tag corresponding to @error */ const gchar * wocky_xmpp_error_string (WockyXmppError error) { return wocky_enum_to_nick (WOCKY_TYPE_XMPP_ERROR, error); } /** * wocky_xmpp_error_description: * @error: a core stanza error * * * * Returns: a description of the error, in English, as specified in XMPP Core */ const gchar * wocky_xmpp_error_description (WockyXmppError error) { if (error < NUM_WOCKY_XMPP_ERRORS) return xmpp_errors[error].description; else return NULL; } static GList *error_domains = NULL; /** * wocky_xmpp_error_register_domain * @domain: a description of the error domain * * Registers a new set of application-specific stanza errors. This allows * GErrors in that domain to be passed to wocky_stanza_error_to_node(), and to * be recognized and returned by wocky_xmpp_error_extract() (and * wocky_stanza_extract_errors(), by extension). */ void wocky_xmpp_error_register_domain (WockyXmppErrorDomain *domain) { error_domains = g_list_prepend (error_domains, domain); } static WockyXmppErrorDomain * xmpp_error_find_domain (GQuark domain) { GList *l; for (l = error_domains; l != NULL; l = l->next) { WockyXmppErrorDomain *d = l->data; if (d->domain == domain) return d; } return NULL; } /** * wocky_xmpp_stanza_error_to_string: * @error: an error in the domain %WOCKY_XMPP_ERROR, or another domain * registered with wocky_xmpp_error_register_domain() (such as * %WOCKY_JINGLE_ERROR). * * Returns the name of the XMPP stanza error element represented by @error. * This is intended for use in debugging messages, with %GErrors returned by * wocky_stanza_extract_errors(). * * Returns: the error code as a string, or %NULL if * error->domain is not known to Wocky. */ const gchar * wocky_xmpp_stanza_error_to_string (GError *error) { g_return_val_if_fail (error != NULL, NULL); if (error->domain == WOCKY_XMPP_ERROR) { return wocky_enum_to_nick (WOCKY_TYPE_XMPP_ERROR, error->code); } else { WockyXmppErrorDomain *domain = xmpp_error_find_domain (error->domain); if (domain != NULL) return wocky_enum_to_nick (domain->enum_type, error->code); else return NULL; } } /* Static, but bears documenting. * * xmpp_error_from_node_for_ns: * @node: a node believed to contain an error child * @ns: the namespace for errors corresponding to @enum_type * @enum_type: a GEnum of error codes * @code: location at which to store an error code * * Scans @node's children for nodes in @ns whose name corresponds to a nickname * of a value of @enum_type, storing the value in @code if found. * * Returns: %TRUE if an error code was retrieved. */ static gboolean xmpp_error_from_node_for_ns ( WockyNode *node, GQuark ns, GType enum_type, gint *code) { GSList *l; for (l = node->children; l != NULL; l = l->next) { WockyNode *child = l->data; if (wocky_node_has_ns_q (child, ns) && wocky_enum_from_nick (enum_type, child->name, code)) return TRUE; } return FALSE; } /* Attempts to divine a WockyXmppError from a legacy numeric code='' attribute */ static WockyXmppError xmpp_error_from_code (WockyNode *error_node, WockyXmppErrorType *type) { const gchar *code = wocky_node_get_attribute (error_node, "code"); gint error_code, i, j; if (code == NULL) goto out; error_code = atoi (code); /* skip UNDEFINED_CONDITION, we want code 500 to be translated * to INTERNAL_SERVER_ERROR */ for (i = 1; i < NUM_WOCKY_XMPP_ERRORS; i++) { const XmppErrorSpec *spec = &xmpp_errors[i]; for (j = 0; j < MAX_LEGACY_ERRORS; j++) { gint cur_code = spec->legacy_errors[j]; if (cur_code == 0) break; if (cur_code == error_code) { if (type != NULL) *type = spec->type; return i; } } } out: if (type != NULL) *type = WOCKY_XMPP_ERROR_TYPE_CANCEL; return WOCKY_XMPP_ERROR_UNDEFINED_CONDITION; } /** * wocky_xmpp_error_extract: * @error: the <error/> child of a stanza with type='error' * @type: location at which to store the error type * @core: location at which to store an error in the domain #WOCKY_XMPP_ERROR * @specialized: location at which to store an error in an application-specific * domain, if one is found * @specialized_node: location at which to store the node representing an * application-specific error, if one is found * * Given an <error/> node, breaks it down into values describing the error. * @type and @core are guaranteed to be set; @specialized and @specialized_node * will be set if a recognised application-specific error is found, and the * latter will be set to %NULL if no application-specific error is found. * * Any or all of the out parameters may be %NULL to ignore the value. The * value stored in @specialized_node is borrowed from @stanza, and is only * valid as long as the latter is alive. */ void wocky_xmpp_error_extract (WockyNode *error, WockyXmppErrorType *type, GError **core, GError **specialized, WockyNode **specialized_node) { gboolean found_core_error = FALSE; gint core_code = WOCKY_XMPP_ERROR_UNDEFINED_CONDITION; GQuark specialized_domain = 0; gint specialized_code; gboolean have_specialized = FALSE; WockyNode *specialized_node_tmp = NULL; const gchar *message = NULL; GSList *l; g_return_if_fail (!wocky_strdiff (error->name, "error")); /* The type='' attributes being present and one of the defined five is a * MUST; if the other party is getting XMPP *that* wrong, 'cancel' seems like * a sensible default. (If the other party only uses legacy error codes, the * call to xmpp_error_from_code() below will try to improve on that default.) */ if (type != NULL) { const gchar *type_attr = wocky_node_get_attribute (error, "type"); gint type_i; if (type_attr != NULL && wocky_enum_from_nick (WOCKY_TYPE_XMPP_ERROR_TYPE, type_attr, &type_i)) *type = type_i; else *type = WOCKY_XMPP_ERROR_TYPE_CANCEL; } for (l = error->children; l != NULL; l = g_slist_next (l)) { WockyNode *child = l->data; if (child->ns == WOCKY_XMPP_ERROR) { if (!wocky_strdiff (child->name, "text")) { message = child->content; } else if (!found_core_error) { /* See if the element is a XMPP Core stanza error we know about, * given that we haven't found one yet. */ found_core_error = wocky_enum_from_nick (WOCKY_TYPE_XMPP_ERROR, child->name, &core_code); } } else if (specialized_node_tmp == NULL) { WockyXmppErrorDomain *domain; specialized_node_tmp = child; /* This could be a specialized error; let's check if it's in a * namespace we know about, and if so that it's an element name we * know. */ domain = xmpp_error_find_domain (child->ns); if (domain != NULL) { specialized_domain = child->ns; if (wocky_enum_from_nick (domain->enum_type, child->name, &specialized_code)) { have_specialized = TRUE; } } } } /* If we don't have an XMPP Core stanza error yet, maybe the peer uses Þe * Olde Numeric Error Codes. */ if (!found_core_error) core_code = xmpp_error_from_code (error, type); /* okay, time to make some errors */ if (message == NULL) message = ""; g_set_error_literal (core, WOCKY_XMPP_ERROR, core_code, message); if (have_specialized) g_set_error_literal (specialized, specialized_domain, specialized_code, message); if (specialized_node != NULL) *specialized_node = specialized_node_tmp; } /** * wocky_g_error_to_node: * @error: an error in the domain #WOCKY_XMPP_ERROR, or in an * application-specific domain registered with * wocky_xmpp_error_register_domain() * @parent_node: the node to which to add an error (such as an IQ error) * * Adds an <error/> node to a stanza corresponding * to the error described by @error. If @error is in a domain other * than #WOCKY_XMPP_ERROR, both the application-specific error name * and the error from #WOCKY_XMPP_ERROR will be created. See RFC 3902 * (XMPP Core) §9.3, “Stanza Errors”. * * There is currently no way to override the type='' of an XMPP Core stanza * error without creating an application-specific error code which does so. * * Returns: the newly-created node */ WockyNode * wocky_stanza_error_to_node (const GError *error, WockyNode *parent_node) { WockyNode *error_node; WockyXmppErrorDomain *domain = NULL; WockyXmppError core_error; const XmppErrorSpec *spec; WockyXmppErrorType type; gchar str[6]; g_return_val_if_fail (parent_node != NULL, NULL); error_node = wocky_node_add_child (parent_node, "error"); g_return_val_if_fail (error != NULL, error_node); if (error->domain == WOCKY_XMPP_ERROR) { core_error = error->code; spec = &(xmpp_errors[core_error]); type = spec->type; } else { WockyXmppErrorSpecialization *s; domain = xmpp_error_find_domain (error->domain); g_return_val_if_fail (domain != NULL, error_node); /* This will crash if you mess up and pass a code that's not in the * domain. */ s = &(domain->codes[error->code]); core_error = s->specializes; spec = &(xmpp_errors[core_error]); if (s->override_type) type = s->type; else type = spec->type; } sprintf (str, "%d", spec->legacy_errors[0]); wocky_node_set_attribute (error_node, "code", str); wocky_node_set_attribute (error_node, "type", wocky_enum_to_nick (WOCKY_TYPE_XMPP_ERROR_TYPE, type)); wocky_node_add_child_ns (error_node, wocky_xmpp_error_string (core_error), WOCKY_XMPP_NS_STANZAS); if (domain != NULL) { const gchar *name = wocky_enum_to_nick (domain->enum_type, error->code); wocky_node_add_child_ns_q (error_node, name, domain->domain); } if (error->message != NULL && *error->message != '\0') wocky_node_add_child_with_content_ns (error_node, "text", error->message, WOCKY_XMPP_NS_STANZAS); return error_node; } /** * wocky_xmpp_stream_error_quark * * Get the error quark used for stream errors * * Returns: the quark for stream errors. */ GQuark wocky_xmpp_stream_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string (WOCKY_XMPP_NS_STREAMS); return quark; } /** * wocky_xmpp_stream_error_from_node: * @error: the root node of a #WOCKY_STANZA_TYPE_STREAM_ERROR stanza * * Returns: a GError in the #WOCKY_XMPP_STREAM_ERROR domain. */ GError * wocky_xmpp_stream_error_from_node (WockyNode *error) { gint code = WOCKY_XMPP_STREAM_ERROR_UNKNOWN; const gchar *message = NULL; /* Ignore the return value; we have a default. */ xmpp_error_from_node_for_ns (error, WOCKY_XMPP_STREAM_ERROR, WOCKY_TYPE_XMPP_STREAM_ERROR, &code); message = wocky_node_get_content_from_child_ns (error, "text", WOCKY_XMPP_NS_STREAMS); if (message == NULL) message = ""; return g_error_new_literal (WOCKY_XMPP_STREAM_ERROR, code, message); } /* Built-in specialized error domains */ GQuark wocky_jingle_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string (WOCKY_XMPP_NS_JINGLE_ERRORS); return quark; } static WockyXmppErrorDomain * jingle_error_get_domain (void) { static WockyXmppErrorSpecialization codes[] = { /* out-of-order */ { "The request cannot occur at this point in the state machine (e.g., " "session-initiate after session-accept).", WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST, FALSE }, /* tie-break */ { "The request is rejected because it was sent while the initiator was " "awaiting a reply on a similar request.", WOCKY_XMPP_ERROR_CONFLICT, FALSE }, /* unknown-session */ { "The 'sid' attribute specifies a session that is unknown to the " "recipient (e.g., no longer live according to the recipient's state " "machine because the recipient previously terminated the session).", WOCKY_XMPP_ERROR_ITEM_NOT_FOUND, FALSE }, /* unsupported-info */ { "The recipient does not support the informational payload of a " "session-info action.", WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED, FALSE } }; static WockyXmppErrorDomain jingle_errors = { 0, }; if (G_UNLIKELY (jingle_errors.domain == 0)) { jingle_errors.domain = WOCKY_JINGLE_ERROR; jingle_errors.enum_type = WOCKY_TYPE_JINGLE_ERROR; jingle_errors.codes = codes; } return &jingle_errors; } GQuark wocky_si_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string (WOCKY_XMPP_NS_SI); return quark; } static WockyXmppErrorDomain * si_error_get_domain (void) { static WockyXmppErrorSpecialization codes[] = { /* no-valid-streams */ { "None of the available streams are acceptable.", WOCKY_XMPP_ERROR_BAD_REQUEST, TRUE, WOCKY_XMPP_ERROR_TYPE_CANCEL }, /* bad-profile */ { "The profile is not understood or invalid. The profile MAY supply a " "profile-specific error condition.", WOCKY_XMPP_ERROR_BAD_REQUEST, TRUE, WOCKY_XMPP_ERROR_TYPE_MODIFY } }; static WockyXmppErrorDomain si_errors = { 0, }; if (G_UNLIKELY (si_errors.domain == 0)) { si_errors.domain = WOCKY_SI_ERROR; si_errors.enum_type = WOCKY_TYPE_SI_ERROR; si_errors.codes = codes; } return &si_errors; } void wocky_xmpp_error_init () { if (error_domains == NULL) { /* Register standard domains */ wocky_xmpp_error_register_domain (jingle_error_get_domain ()); wocky_xmpp_error_register_domain (si_error_get_domain ()); } } void wocky_xmpp_error_deinit () { g_list_free (error_domains); error_domains = NULL; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-sasl-digest-md5.h0000644000175000017500000000267012050202021024367 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_SASL_DIGEST_MD5_H #define _WOCKY_SASL_DIGEST_MD5_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_SASL_DIGEST_MD5 \ wocky_sasl_digest_md5_get_type () #define WOCKY_SASL_DIGEST_MD5(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_SASL_DIGEST_MD5, \ WockySaslDigestMd5)) #define WOCKY_SASL_DIGEST_MD5_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_SASL_DIGEST_MD5, \ WockySaslDigestMd5Class)) #define WOCKY_IS_SASL_DIGEST_MD5(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_SASL_DIGEST_MD5)) #define WOCKY_IS_SASL_DIGEST_MD5_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_SASL_DIGEST_MD5)) #define WOCKY_SASL_DIGEST_MD5_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_SASL_DIGEST_MD5, \ WockySaslDigestMd5Class)) typedef struct _WockySaslDigestMd5Private WockySaslDigestMd5Private; typedef struct { GObject parent; WockySaslDigestMd5Private *priv; } WockySaslDigestMd5; typedef struct { GObjectClass parent_class; } WockySaslDigestMd5Class; GType wocky_sasl_digest_md5_get_type (void); WockySaslDigestMd5 * wocky_sasl_digest_md5_new ( const gchar *server, const gchar *username, const gchar *password); G_END_DECLS #endif /* _WOCKY_SASL_DIGEST_MD5_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky.h0000644000175000017500000000521612050202021021466 0ustar00wjtwjt00000000000000/* * wocky.h - Header for general functions * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #ifndef __WOCKY_H__ #define __WOCKY_H__ #include #define WOCKY_H_INSIDE #include "wocky-auth-handler.h" #include "wocky-auth-registry.h" #include "wocky-bare-contact.h" #include "wocky-c2s-porter.h" #include "wocky-caps-cache.h" #include "wocky-caps-hash.h" #include "wocky-connector.h" #include "wocky-contact-factory.h" #include "wocky-contact.h" #include "wocky-data-form.h" #include "wocky-debug.h" #include "wocky-disco-identity.h" #include "wocky-jabber-auth-digest.h" #include "wocky-jabber-auth.h" #include "wocky-jabber-auth-password.h" #include "wocky-ll-connection-factory.h" #include "wocky-ll-connector.h" #include "wocky-ll-contact.h" #include "wocky-loopback-stream.h" #include "wocky-meta-porter.h" #include "wocky-muc.h" #include "wocky-namespaces.h" #include "wocky-node.h" #include "wocky-node-tree.h" #include "wocky-pep-service.h" #include "wocky-ping.h" #include "wocky-porter.h" #include "wocky-pubsub-helpers.h" #include "wocky-pubsub-node.h" #include "wocky-pubsub-node-protected.h" #include "wocky-pubsub-service.h" #include "wocky-pubsub-service-protected.h" #include "wocky-resource-contact.h" #include "wocky-roster.h" #include "wocky-sasl-auth.h" #include "wocky-sasl-digest-md5.h" #include "wocky-sasl-plain.h" #include "wocky-sasl-scram.h" #include "wocky-sasl-utils.h" #include "wocky-session.h" #include "wocky-stanza.h" #include "wocky-tls-connector.h" #include "wocky-tls.h" #include "wocky-tls-handler.h" #include "wocky-types.h" #include "wocky-utils.h" #include "wocky-xep-0115-capabilities.h" #include "wocky-xmpp-connection.h" #include "wocky-xmpp-error.h" #include "wocky-xmpp-reader.h" #include "wocky-xmpp-writer.h" #undef WOCKY_H_INSIDE G_BEGIN_DECLS void wocky_init (void); void wocky_deinit (void); G_END_DECLS #endif /* #ifndef __WOCKY_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-contact-factory.h0000644000175000017500000000671112050202021024565 0ustar00wjtwjt00000000000000/* * wocky-resource-contact.h - Header for WockyContactFactory * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_CONTACT_FACTORY_H__ #define __WOCKY_CONTACT_FACTORY_H__ #include #include "wocky-bare-contact.h" #include "wocky-resource-contact.h" #include "wocky-ll-contact.h" G_BEGIN_DECLS typedef struct _WockyContactFactory WockyContactFactory; /** * WockyContactFactoryClass: * * The class of a #WockyContactFactory. */ typedef struct _WockyContactFactoryClass WockyContactFactoryClass; typedef struct _WockyContactFactoryPrivate WockyContactFactoryPrivate; struct _WockyContactFactoryClass { /**/ GObjectClass parent_class; }; struct _WockyContactFactory { /**/ GObject parent; WockyContactFactoryPrivate *priv; }; GType wocky_contact_factory_get_type (void); #define WOCKY_TYPE_CONTACT_FACTORY \ (wocky_contact_factory_get_type ()) #define WOCKY_CONTACT_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_CONTACT_FACTORY, \ WockyContactFactory)) #define WOCKY_CONTACT_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_CONTACT_FACTORY, \ WockyContactFactoryClass)) #define WOCKY_IS_CONTACT_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_CONTACT_FACTORY)) #define WOCKY_IS_CONTACT_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_CONTACT_FACTORY)) #define WOCKY_CONTACT_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_CONTACT_FACTORY, \ WockyContactFactoryClass)) WockyContactFactory * wocky_contact_factory_new (void); WockyBareContact * wocky_contact_factory_ensure_bare_contact ( WockyContactFactory *factory, const gchar *bare_jid); WockyBareContact * wocky_contact_factory_lookup_bare_contact ( WockyContactFactory *factory, const gchar *bare_jid); WockyResourceContact * wocky_contact_factory_ensure_resource_contact ( WockyContactFactory *factory, const gchar *full_jid); WockyResourceContact * wocky_contact_factory_lookup_resource_contact ( WockyContactFactory *factory, const gchar *full_jid); WockyLLContact * wocky_contact_factory_ensure_ll_contact ( WockyContactFactory *factory, const gchar *jid); WockyLLContact * wocky_contact_factory_lookup_ll_contact ( WockyContactFactory *factory, const gchar *jid); void wocky_contact_factory_add_ll_contact (WockyContactFactory *factory, WockyLLContact *contact); GList * wocky_contact_factory_get_ll_contacts (WockyContactFactory *factory); G_END_DECLS #endif /* #ifndef __WOCKY_CONTACT_FACTORY_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-helpers.h0000644000175000017500000000464112050202021024425 0ustar00wjtwjt00000000000000/* * wocky-pubsub-internal.h — header for PubSub helper functions * Copyright © 2009–2012 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef WOCKY_PUBSUB_HELPERS_H #define WOCKY_PUBSUB_HELPERS_H #include #include "wocky-stanza.h" WockyStanza * wocky_pubsub_make_event_stanza ( const gchar *node, const gchar *from, WockyNode **item_out); WockyStanza *wocky_pubsub_make_stanza ( const gchar *service, WockyStanzaSubType sub_type, const gchar *pubsub_ns, const gchar *action_name, WockyNode **pubsub_node, WockyNode **action_node); WockyStanza *wocky_pubsub_make_publish_stanza ( const gchar *service, const gchar *node, WockyNode **pubsub_out, WockyNode **publish_out, WockyNode **item_out); void wocky_send_ll_pep_event (WockySession *session, WockyStanza *stanza); gboolean wocky_pubsub_distill_iq_reply (GObject *source, GAsyncResult *res, const gchar *pubsub_ns, const gchar *child_name, WockyNodeTree **child_out, GError **error); gboolean wocky_pubsub_distill_ambivalent_iq_reply (GObject *source, GAsyncResult *res, const gchar *pubsub_ns, const gchar *child_name, WockyNodeTree **child_out, GError **error); gboolean wocky_pubsub_distill_void_iq_reply (GObject *source, GAsyncResult *res, GError **error); gboolean wocky_pubsub_distill_stanza (WockyStanza *result, const gchar *pubsub_ns, const gchar *child_name, gboolean body_optional, WockyNodeTree **child_out, GError **error); #endif /* WOCKY_PUBSUB_HELPERS_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-muc.h0000644000175000017500000002404112050202021022245 0ustar00wjtwjt00000000000000/* * wocky-xmpp-connection.h - Header for WockyMuc * Copyright © 2009 Collabora Ltd. * @author Vivek Dasmohapatra * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_MUC_H__ #define __WOCKY_MUC_H__ #include #include "wocky-muc-enumtypes.h" #include "wocky-namespaces.h" #include "wocky-porter.h" G_BEGIN_DECLS typedef struct _WockyMuc WockyMuc; /** * WockyMucClass: * * The class of a #WockyMuc. */ typedef struct _WockyMucClass WockyMucClass; typedef struct _WockyMucPrivate WockyMucPrivate; /** * WockyMucStatusCode: * @WOCKY_MUC_CODE_UNKNOWN: Unknown code * @WOCKY_MUC_CODE_ONYMOUS: Room entered is not anonymous * @WOCKY_MUC_CODE_AF_CHANGE_OOB: Affiliation changed when not present * @WOCKY_MUC_CODE_CFG_SHOW_UNAVAILABLE: Unavailable members visible * @WOCKY_MUC_CODE_CFG_HIDE_UNAVAILABLE: Unavailable members invisible * @WOCKY_MUC_CODE_CFG_NONPRIVACY: Non-privacy config change * @WOCKY_MUC_CODE_OWN_PRESENCE: User's own presence * @WOCKY_MUC_CODE_CFG_LOGGING_ENABLED: Logging enabled * @WOCKY_MUC_CODE_CFG_LOGGING_DISABLED: Logging disabled * @WOCKY_MUC_CODE_CFG_ONYMOUS: Room is now non-anonymous * @WOCKY_MUC_CODE_CFG_SEMIONYMOUS: Room is now semi-anonymous * @WOCKY_MUC_CODE_CFG_ANONYMOUS: Room is now fully-anonymous * @WOCKY_MUC_CODE_NEW_ROOM: Room created (eg by joining) * @WOCKY_MUC_CODE_NICK_CHANGE_FORCED: Service enforced nick change * @WOCKY_MUC_CODE_BANNED: User has been banned * @WOCKY_MUC_CODE_NICK_CHANGE_USER: User's nick changed * @WOCKY_MUC_CODE_KICKED: Kicked from the room * @WOCKY_MUC_CODE_KICKED_AFFILIATION: Kicked (affiliation change) * @WOCKY_MUC_CODE_KICKED_ROOM_PRIVATISED: Kicked (room is now * members-only) * @WOCKY_MUC_CODE_KICKED_SHUTDOWN: Kicked (shutdown) * * MUC status codes, as defined by XEP-0045 * §15.6. */ typedef enum { WOCKY_MUC_CODE_UNKNOWN = 0, WOCKY_MUC_CODE_ONYMOUS = 1 << 0, WOCKY_MUC_CODE_AF_CHANGE_OOB = 1 << 1, WOCKY_MUC_CODE_CFG_SHOW_UNAVAILABLE = 1 << 2, WOCKY_MUC_CODE_CFG_HIDE_UNAVAILABLE = 1 << 3, WOCKY_MUC_CODE_CFG_NONPRIVACY = 1 << 4, WOCKY_MUC_CODE_OWN_PRESENCE = 1 << 5, WOCKY_MUC_CODE_CFG_LOGGING_ENABLED = 1 << 6, WOCKY_MUC_CODE_CFG_LOGGING_DISABLED = 1 << 7, WOCKY_MUC_CODE_CFG_ONYMOUS = 1 << 8, WOCKY_MUC_CODE_CFG_SEMIONYMOUS = 1 << 9, WOCKY_MUC_CODE_CFG_ANONYMOUS = 1 << 10, WOCKY_MUC_CODE_NEW_ROOM = 1 << 11, WOCKY_MUC_CODE_NICK_CHANGE_FORCED = 1 << 12, WOCKY_MUC_CODE_BANNED = 1 << 13, WOCKY_MUC_CODE_NICK_CHANGE_USER = 1 << 14, WOCKY_MUC_CODE_KICKED = 1 << 15, WOCKY_MUC_CODE_KICKED_AFFILIATION = 1 << 16, WOCKY_MUC_CODE_KICKED_ROOM_PRIVATISED = 1 << 17, WOCKY_MUC_CODE_KICKED_SHUTDOWN = 1 << 18, } WockyMucStatusCode; /** * WockyMucRole: * @WOCKY_MUC_ROLE_NONE: no role * @WOCKY_MUC_ROLE_VISITOR: visitor role * @WOCKY_MUC_ROLE_PARTICIPANT: participant role * @WOCKY_MUC_ROLE_MODERATOR: moderator role * * #WockyMuc roles as described in XEP-0045 §5.1. */ typedef enum { WOCKY_MUC_ROLE_NONE = 0, WOCKY_MUC_ROLE_VISITOR, WOCKY_MUC_ROLE_PARTICIPANT, WOCKY_MUC_ROLE_MODERATOR } WockyMucRole; /** * WockyMucAffiliation: * @WOCKY_MUC_AFFILIATION_OUTCAST: outcast affiliation * @WOCKY_MUC_AFFILIATION_NONE: no affiliation * @WOCKY_MUC_AFFILIATION_MEMBER: member affiliation * @WOCKY_MUC_AFFILIATION_ADMIN: admin affiliation * @WOCKY_MUC_AFFILIATION_OWNER: owner affiliation * * #WockyMuc affiliations as described in XEP-0045 §5.2. */ typedef enum { WOCKY_MUC_AFFILIATION_OUTCAST = -1, WOCKY_MUC_AFFILIATION_NONE = 0, WOCKY_MUC_AFFILIATION_MEMBER, WOCKY_MUC_AFFILIATION_ADMIN, WOCKY_MUC_AFFILIATION_OWNER, } WockyMucAffiliation; /** * WockyMucFeature: * @WOCKY_MUC_MODERN: the MUC is modern, as documented in XEP-0045 * @WOCKY_MUC_FORM_REGISTER: the MUC has support for the muc#register FORM_TYPE * @WOCKY_MUC_FORM_ROOMCONFIG: the MUC has support for the muc#register FORM_TYPE * @WOCKY_MUC_FORM_ROOMINFO: the MUC has support for the muc#register FORM_TYPE * @WOCKY_MUC_HIDDEN: the MUC is hidden * @WOCKY_MUC_MEMBERSONLY: only members can join this MUC * @WOCKY_MUC_MODERATED: the MUC is moderated * @WOCKY_MUC_NONANONYMOUS: the MUC is non-anonymous * @WOCKY_MUC_OPEN: the MUC is open * @WOCKY_MUC_PASSWORDPROTECTED: the MUC is password protected * @WOCKY_MUC_PERSISTENT: the MUC is persistent * @WOCKY_MUC_PUBLIC: the MUC is public * @WOCKY_MUC_ROOMS: the MUC has a list of MUC rooms * @WOCKY_MUC_SEMIANONYMOUS: the MUC is semi-anonymous * @WOCKY_MUC_TEMPORARY: the MUC is temporary * @WOCKY_MUC_UNMODERATED: the MUC is unmoderated * @WOCKY_MUC_UNSECURED: the MUC is unsecured * @WOCKY_MUC_OBSOLETE: the MUC has obsolete groupchat 1.0 features * * #WockyMuc feature flags. */ typedef enum { WOCKY_MUC_MODERN = 1, WOCKY_MUC_FORM_REGISTER = (1 << 1), WOCKY_MUC_FORM_ROOMCONFIG = (1 << 2), WOCKY_MUC_FORM_ROOMINFO = (1 << 3), WOCKY_MUC_HIDDEN = (1 << 4), WOCKY_MUC_MEMBERSONLY = (1 << 5), WOCKY_MUC_MODERATED = (1 << 6), WOCKY_MUC_NONANONYMOUS = (1 << 7), WOCKY_MUC_OPEN = (1 << 8), WOCKY_MUC_PASSWORDPROTECTED = (1 << 9), WOCKY_MUC_PERSISTENT = (1 << 10), WOCKY_MUC_PUBLIC = (1 << 11), WOCKY_MUC_ROOMS = (1 << 12), WOCKY_MUC_SEMIANONYMOUS = (1 << 13), WOCKY_MUC_TEMPORARY = (1 << 14), WOCKY_MUC_UNMODERATED = (1 << 15), WOCKY_MUC_UNSECURED = (1 << 16), WOCKY_MUC_OBSOLETE = (1 << 17), } WockyMucFeature; /** * WockyMucMsgType: * @WOCKY_MUC_MSG_NONE: no message type * @WOCKY_MUC_MSG_NORMAL: a normal message * @WOCKY_MUC_MSG_ACTION: an action message * @WOCKY_MUC_MSG_NOTICE: a notice message * * XMPP MUC message types. */ typedef enum { WOCKY_MUC_MSG_NONE, WOCKY_MUC_MSG_NORMAL, WOCKY_MUC_MSG_ACTION, WOCKY_MUC_MSG_NOTICE, } WockyMucMsgType; /** * WockyMucMsgState: * @WOCKY_MUC_MSG_STATE_NONE: no message state applies * @WOCKY_MUC_MSG_STATE_ACTIVE: the contact in the MUC is active * @WOCKY_MUC_MSG_STATE_COMPOSING: the contact in the MUC is composing * a message * @WOCKY_MUC_MSG_STATE_INACTIVE: the contact in the MUC is inactive * @WOCKY_MUC_MSG_STATE_PAUSED: the contact in the MUC has paused * composing a message * * XMPP MUC message states as documeted in XEP-0085. */ typedef enum { WOCKY_MUC_MSG_STATE_NONE = -1, WOCKY_MUC_MSG_STATE_ACTIVE, WOCKY_MUC_MSG_STATE_COMPOSING, WOCKY_MUC_MSG_STATE_INACTIVE, WOCKY_MUC_MSG_STATE_PAUSED, } WockyMucMsgState; /** * WockyMucState: * @WOCKY_MUC_CREATED: the #WockyMuc has been created * @WOCKY_MUC_INITIATED: the MUC has been initiated on the server * @WOCKY_MUC_AUTH: the user is authenticating with the MUC * @WOCKY_MUC_JOINED: the user has joined the MUC and can chat * @WOCKY_MUC_ENDED: the MUC has ended * * #WockyMuc states. */ typedef enum { WOCKY_MUC_CREATED = 0, WOCKY_MUC_INITIATED, WOCKY_MUC_AUTH, WOCKY_MUC_JOINED, WOCKY_MUC_ENDED, } WockyMucState; /** * WockyMucMember: * @from: the JID of the member (room@server/nick) * @jid: the JID of the owner (owner@domain/resource) * @nick: the nickname of the member * @role: the #WockyMucRole of the member * @affiliation: the #WockyMucAffiliation of the member * @status: the user set status string * @presence_stanza: the #WockyStanza that was received regarding the * member's presence */ typedef struct { gchar *from; /* room@service/nick */ gchar *jid; /* owner@domain/resource */ gchar *nick; /* nick */ WockyMucRole role; WockyMucAffiliation affiliation; gchar *status; /* user set status string */ WockyStanza *presence_stanza; } WockyMucMember; GType wocky_muc_get_type (void); struct _WockyMucClass { /**/ GObjectClass parent_class; }; struct _WockyMuc { /**/ GObject parent; WockyMucPrivate *priv; }; /* TYPE MACROS */ #define WOCKY_TYPE_MUC (wocky_muc_get_type ()) #define WOCKY_MUC(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_MUC, WockyMuc)) #define WOCKY_MUC_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_MUC, WockyXmppMuc)) #define WOCKY_IS_MUC(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_MUC)) #define WOCKY_IS_MUC_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_MUC)) #define WOCKY_MUC_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_MUC, WockyMucClass)) /* disco info */ void wocky_muc_disco_info_async (WockyMuc *muc, GAsyncReadyCallback callback, GCancellable *cancel, gpointer data); gboolean wocky_muc_disco_info_finish (WockyMuc *muc, GAsyncResult *res, GError **error); /* presence */ WockyStanza *wocky_muc_create_presence (WockyMuc *muc, WockyStanzaSubType type, const gchar *status); /* initiate */ void wocky_muc_initiate_async (WockyMuc *muc, GAsyncReadyCallback callback, GCancellable *cancel, gpointer data); gboolean wocky_muc_initiate_finish (GObject *source, GAsyncResult *res, GError **error); /* join */ void wocky_muc_join (WockyMuc *muc, GCancellable *cancel); /* meta data */ const gchar * wocky_muc_jid (WockyMuc *muc); const gchar * wocky_muc_user (WockyMuc *muc); WockyMucRole wocky_muc_role (WockyMuc *muc); WockyMucAffiliation wocky_muc_affiliation (WockyMuc *muc); GHashTable * wocky_muc_members (WockyMuc *muc); WockyMucState wocky_muc_get_state (WockyMuc *muc); G_END_DECLS #endif /* __WOCKY_MUC_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-contact.h0000644000175000017500000000450612050202021023120 0ustar00wjtwjt00000000000000/* * wocky-contact.h - Header for WockyContact * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_CONTACT_H__ #define __WOCKY_CONTACT_H__ #include G_BEGIN_DECLS typedef struct _WockyContact WockyContact; /** * WockyContactClass: * * The class of a #WockyContact. */ typedef struct _WockyContactClass WockyContactClass; typedef struct _WockyContactPrivate WockyContactPrivate; typedef gchar * (*WockyContactDupJidImpl) (WockyContact *self); struct _WockyContactClass { /**/ GObjectClass parent_class; WockyContactDupJidImpl dup_jid; }; struct _WockyContact { /**/ GObject parent; WockyContactPrivate *priv; }; GType wocky_contact_get_type (void); #define WOCKY_TYPE_CONTACT \ (wocky_contact_get_type ()) #define WOCKY_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_CONTACT, \ WockyContact)) #define WOCKY_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_CONTACT, \ WockyContactClass)) #define WOCKY_IS_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_CONTACT)) #define WOCKY_IS_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_CONTACT)) #define WOCKY_CONTACT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_CONTACT, \ WockyContactClass)) gchar * wocky_contact_dup_jid (WockyContact *self) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS #endif /* #ifndef __WOCKY_CONTACT_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-node.c0000644000175000017500000010743112051446215023724 0ustar00wjtwjt00000000000000/* * wocky-pubsub-node.c - WockyPubsubNode * Copyright (C) 2009 Collabora Ltd. * * 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 */ #include "wocky-pubsub-node.h" #include "wocky-pubsub-node-protected.h" #include "wocky-pubsub-node-internal.h" #include "wocky-namespaces.h" #include "wocky-porter.h" #include "wocky-pubsub-helpers.h" #include "wocky-pubsub-service-protected.h" #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PUBSUB #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyPubsubNode, wocky_pubsub_node, G_TYPE_OBJECT) enum { SIG_EVENT_RECEIVED, SIG_SUB_STATE_CHANGED, SIG_DELETED, LAST_SIGNAL, }; static guint signals[LAST_SIGNAL] = {0}; enum { PROP_SERVICE = 1, PROP_NAME, }; /* private structure */ struct _WockyPubsubNodePrivate { WockyPubsubService *service; WockyPorter *porter; gchar *service_jid; gchar *name; gboolean dispose_has_run; }; static void wocky_pubsub_node_init (WockyPubsubNode *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_PUBSUB_NODE, WockyPubsubNodePrivate); } static void wocky_pubsub_node_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; switch (property_id) { case PROP_SERVICE: priv->service = g_value_dup_object (value); break; case PROP_NAME: priv->name = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pubsub_node_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; switch (property_id) { case PROP_SERVICE: g_value_set_object (value, priv->service); break; case PROP_NAME: g_value_set_string (value, priv->name); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pubsub_node_dispose (GObject *object) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; g_object_unref (priv->service); g_object_unref (priv->porter); if (G_OBJECT_CLASS (wocky_pubsub_node_parent_class)->dispose) G_OBJECT_CLASS (wocky_pubsub_node_parent_class)->dispose (object); } static void wocky_pubsub_node_finalize (GObject *object) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; g_free (priv->name); g_free (priv->service_jid); G_OBJECT_CLASS (wocky_pubsub_node_parent_class)->finalize (object); } static void wocky_pubsub_node_constructed (GObject *object) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; WockySession *session; g_assert (priv->service != NULL); g_assert (priv->name != NULL); g_object_get (priv->service, "jid", &(priv->service_jid), "session", &session, NULL); g_assert (priv->service_jid != NULL); g_assert (session != NULL); priv->porter = wocky_session_get_porter (session); g_object_ref (priv->porter); g_object_unref (session); } static void wocky_pubsub_node_emit_event_received ( WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node, GList *items) { g_signal_emit (self, signals[SIG_EVENT_RECEIVED], 0, event_stanza, event_node, items_node, items); } static void wocky_pubsub_node_emit_subscription_state_changed ( WockyPubsubNode *self, WockyStanza *stanza, WockyNode *event_node, WockyNode *subscription_node, WockyPubsubSubscription *subscription) { g_signal_emit (self, signals[SIG_SUB_STATE_CHANGED], 0, stanza, event_node, subscription_node, subscription); } static void wocky_pubsub_node_emit_deleted ( WockyPubsubNode *self, WockyStanza *stanza, WockyNode *event_node, WockyNode *delete_node) { g_signal_emit (self, signals[SIG_DELETED], 0, stanza, event_node, delete_node); } static void wocky_pubsub_node_class_init ( WockyPubsubNodeClass *wocky_pubsub_node_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_pubsub_node_class); GType ctype = G_OBJECT_CLASS_TYPE (wocky_pubsub_node_class); GParamSpec *param_spec; g_type_class_add_private (wocky_pubsub_node_class, sizeof (WockyPubsubNodePrivate)); object_class->set_property = wocky_pubsub_node_set_property; object_class->get_property = wocky_pubsub_node_get_property; object_class->dispose = wocky_pubsub_node_dispose; object_class->finalize = wocky_pubsub_node_finalize; object_class->constructed = wocky_pubsub_node_constructed; param_spec = g_param_spec_object ("service", "service", "the Wocky Pubsub service associated with this pubsub node", WOCKY_TYPE_PUBSUB_SERVICE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SERVICE, param_spec); param_spec = g_param_spec_string ("name", "name", "The name of the pubsub node", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NAME, param_spec); /** * WockyPubsubNode::event-received: * @node: a pubsub node * @event_stanza: the message/event stanza in its entirity * @event_node: the event node from the stanza * @items_node: the items node from the stanza * @items: a list of WockyNode *s for each item child of @items_node */ signals[SIG_EVENT_RECEIVED] = g_signal_new ("event-received", ctype, 0, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_POINTER_POINTER_POINTER, G_TYPE_NONE, 4, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); /** * WockyPubsubNode::subscription-state-changed: * @node: a pubsub node * @stanza: the message/event stanza in its entirety * @event_node: the event node from @stanza * @subscription_node: the subscription node from @stanza * @subscription: subscription information parsed from @subscription_node */ signals[SIG_SUB_STATE_CHANGED] = g_signal_new ("subscription-state-changed", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_POINTER_POINTER_BOXED, G_TYPE_NONE, 4, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER, WOCKY_TYPE_PUBSUB_SUBSCRIPTION); /** * WockyPubsubNode::deleted * @node: a pubsub node * @stanza: the message/event stanza in its entirety * @event_node: the event node from @stanza * @delete_node: the delete node from @stanza * * Emitted when a notification of this node's deletion is received from the * server. */ signals[SIG_DELETED] = g_signal_new ("deleted", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_POINTER_POINTER, G_TYPE_NONE, 3, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER); } static void pubsub_node_handle_items_event (WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node) { WockyNode *item_node; GQueue items = G_QUEUE_INIT; WockyNodeIter iter; wocky_node_iter_init (&iter, items_node, "item", NULL); while (wocky_node_iter_next (&iter, &item_node)) g_queue_push_tail (&items, item_node); DEBUG_STANZA (event_stanza, "extracted %u items", items.length); wocky_pubsub_node_emit_event_received (self, event_stanza, event_node, items_node, items.head); g_queue_clear (&items); } static void pubsub_node_handle_subscription_event (WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *subscription_node) { WockyPubsubNodePrivate *priv = self->priv; WockyPubsubSubscription *sub; GError *error = NULL; sub = wocky_pubsub_service_parse_subscription (priv->service, subscription_node, NULL, &error); if (sub == NULL) { DEBUG ("received unparseable subscription state change notification: %s", error->message); g_clear_error (&error); } else { wocky_pubsub_node_emit_subscription_state_changed (self, event_stanza, event_node, subscription_node, sub); wocky_pubsub_subscription_free (sub); } } static const WockyPubsubNodeEventMapping mappings[] = { { "items", pubsub_node_handle_items_event, }, { "subscription", pubsub_node_handle_subscription_event, }, { "delete", wocky_pubsub_node_emit_deleted, }, { NULL, } }; const WockyPubsubNodeEventMapping * _wocky_pubsub_node_get_event_mappings (guint *n_mappings) { if (n_mappings != NULL) *n_mappings = G_N_ELEMENTS (mappings) - 1; return mappings; } const gchar * wocky_pubsub_node_get_name (WockyPubsubNode *self) { WockyPubsubNodePrivate *priv = self->priv; return priv->name; } WockyStanza * wocky_pubsub_node_make_publish_stanza (WockyPubsubNode *self, WockyNode **pubsub_out, WockyNode **publish_out, WockyNode **item_out) { WockyPubsubNodePrivate *priv = self->priv; return wocky_pubsub_make_publish_stanza (priv->service_jid, priv->name, pubsub_out, publish_out, item_out); } static WockyStanza * pubsub_node_make_action_stanza (WockyPubsubNode *self, WockyStanzaSubType sub_type, const gchar *pubsub_ns, const gchar *action_name, const gchar *jid, WockyNode **pubsub_node, WockyNode **action_node) { WockyPubsubNodePrivate *priv = self->priv; WockyStanza *stanza; WockyNode *action; g_assert (pubsub_ns != NULL); g_assert (action_name != NULL); stanza = wocky_pubsub_make_stanza (priv->service_jid, sub_type, pubsub_ns, action_name, pubsub_node, &action); wocky_node_set_attribute (action, "node", priv->name); if (jid != NULL) wocky_node_set_attribute (action, "jid", jid); if (action_node != NULL) *action_node = action; return stanza; } WockyStanza * wocky_pubsub_node_make_subscribe_stanza (WockyPubsubNode *self, const gchar *jid, WockyNode **pubsub_node, WockyNode **subscribe_node) { /* TODO: when the connection/porter/session/something knows our own JID, we * should provide an easy way to say “my bare JID” or “my full JID”. Could be * really evil and use 0x1 and 0x3 or something on the assumption that those * will never be strings.... */ g_return_val_if_fail (jid != NULL, NULL); return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB, "subscribe", jid, pubsub_node, subscribe_node); } static void subscribe_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubNode *self = WOCKY_PUBSUB_NODE ( g_async_result_get_source_object (user_data)); WockyPubsubNodePrivate *priv = self->priv; WockyNodeTree *sub_tree; WockyPubsubSubscription *sub = NULL; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB, "subscription", &sub_tree, &error)) { WockyNode *subscription_node = wocky_node_tree_get_top_node (sub_tree); sub = wocky_pubsub_service_parse_subscription (priv->service, subscription_node, NULL, &error); g_object_unref (sub_tree); } if (sub != NULL) { g_simple_async_result_set_op_res_gpointer (simple, sub, (GDestroyNotify) wocky_pubsub_subscription_free); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } /** * wocky_pubsub_node_subscribe_async: * @self: a pubsub node * @jid: the JID to use as the subscribed JID (usually the connection's bare or * full JID); may not be %NULL * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Attempts to subscribe to @self. */ void wocky_pubsub_node_subscribe_async (WockyPubsubNode *self, const gchar *jid, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_subscribe_async); WockyStanza *stanza; g_return_if_fail (jid != NULL); stanza = wocky_pubsub_node_make_subscribe_stanza (self, jid, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, subscribe_cb, simple); g_object_unref (stanza); } WockyPubsubSubscription * wocky_pubsub_node_subscribe_finish (WockyPubsubNode *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_pubsub_node_subscribe_async), NULL); simple = (GSimpleAsyncResult *) result; if (g_simple_async_result_propagate_error (simple, error)) return NULL; else return wocky_pubsub_subscription_copy ( g_simple_async_result_get_op_res_gpointer (simple)); } WockyStanza * wocky_pubsub_node_make_unsubscribe_stanza (WockyPubsubNode *self, const gchar *jid, const gchar *subid, WockyNode **pubsub_node, WockyNode **unsubscribe_node) { WockyStanza *stanza; WockyNode *unsubscribe; /* TODO: when the connection/porter/session/something knows our own JID, we * should provide an easy way to say “my bare JID” or “my full JID”. Could be * really evil and use 0x1 and 0x3 or something on the assumption that those * will never be strings.... */ g_return_val_if_fail (jid != NULL, NULL); stanza = pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB, "unsubscribe", jid, pubsub_node, &unsubscribe); if (subid != NULL) wocky_node_set_attribute (unsubscribe, "subid", subid); if (unsubscribe_node != NULL) *unsubscribe_node = unsubscribe; return stanza; } static void pubsub_node_void_iq_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); GError *error = NULL; if (!wocky_pubsub_distill_void_iq_reply (source, res, &error)) { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); } /** * wocky_pubsub_node_unsubscribe_async: * @self: a pubsub node * @jid: the JID subscribed to @self (usually the connection's bare or * full JID); may not be %NULL * @subid: the identifier associated with the subscription * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Attempts to unsubscribe from @self. */ void wocky_pubsub_node_unsubscribe_async (WockyPubsubNode *self, const gchar *jid, const gchar *subid, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_unsubscribe_async); WockyStanza *stanza; g_return_if_fail (jid != NULL); stanza = wocky_pubsub_node_make_unsubscribe_stanza (self, jid, subid, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, pubsub_node_void_iq_cb, simple); g_object_unref (stanza); } gboolean wocky_pubsub_node_unsubscribe_finish (WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_pubsub_node_unsubscribe_async); } WockyStanza * wocky_pubsub_node_make_delete_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **delete_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB_OWNER, "delete", NULL, pubsub_node, delete_node); } void wocky_pubsub_node_delete_async (WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; WockyStanza *stanza; GSimpleAsyncResult *result; stanza = wocky_pubsub_node_make_delete_stanza (self, NULL, NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_delete_async); wocky_porter_send_iq_async (priv->porter, stanza, NULL, pubsub_node_void_iq_cb, result); g_object_unref (stanza); } gboolean wocky_pubsub_node_delete_finish (WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_pubsub_node_delete_async); } WockyStanza * wocky_pubsub_node_make_list_subscribers_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **subscriptions_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "subscriptions", NULL, pubsub_node, subscriptions_node); } static void list_subscribers_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubNode *self = WOCKY_PUBSUB_NODE ( g_async_result_get_source_object (user_data)); WockyPubsubNodePrivate *priv = self->priv; WockyNodeTree *subs_tree; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB_OWNER, "subscriptions", &subs_tree, &error)) { GList *subs = wocky_pubsub_service_parse_subscriptions (priv->service, wocky_node_tree_get_top_node (subs_tree), NULL); g_simple_async_result_set_op_res_gpointer (simple, subs, (GDestroyNotify) wocky_pubsub_subscription_list_free); g_object_unref (subs_tree); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } /** * wocky_pubsub_node_list_subscribers_async: * @self: a pubsub node * @cancellable: optional #GCancellable object * @callback: function to call when the subscribers have been retrieved or an * error has occured * @user_data: data to pass to @callback. * * Retrieves the list of subscriptions to a node you own. @callback may * complete the call using wocky_pubsub_node_list_subscribers_finish(). * * (A note on naming: this is §8.8.1 — Retrieve Subscriptions List — in * XEP-0060, not to be confused with §5.6 — Retrieve Subscriptions. The * different terminology in Wocky is intended to help disambiguate!) */ void wocky_pubsub_node_list_subscribers_async ( WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_list_subscribers_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_list_subscribers_stanza (self, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, list_subscribers_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_list_subscribers_finish: * @self: a pubsub node * @result: the result passed to a callback * @subscribers: location at which to store a list of #WockyPubsubSubscription * pointers, or %NULL * @error: location at which to store an error, or %NULL * * Completes a call to wocky_pubsub_node_list_subscribers_async(). The list * returned in @subscribers should be freed with * wocky_pubsub_subscription_list_free() when it is no longer needed. * * Returns: %TRUE if the list of subscribers was successfully retrieved; %FALSE * and sets @error if an error occured. */ gboolean wocky_pubsub_node_list_subscribers_finish ( WockyPubsubNode *self, GAsyncResult *result, GList **subscribers, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_pubsub_node_list_subscribers_async, wocky_pubsub_subscription_list_copy, subscribers); } WockyStanza * wocky_pubsub_node_make_list_affiliates_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **affiliations_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "affiliations", NULL, pubsub_node, affiliations_node); } GList * wocky_pubsub_node_parse_affiliations ( WockyPubsubNode *self, WockyNode *affiliations_node) { GQueue affs = G_QUEUE_INIT; WockyNodeIter i; WockyNode *n; wocky_node_iter_init (&i, affiliations_node, "affiliation", NULL); while (wocky_node_iter_next (&i, &n)) { const gchar *jid = wocky_node_get_attribute (n, "jid"); const gchar *affiliation = wocky_node_get_attribute (n, "affiliation"); gint state; if (jid == NULL) { DEBUG (" missing jid=''; skipping"); continue; } if (affiliation == NULL) { DEBUG (" missing affiliation=''; skipping"); continue; } if (!wocky_enum_from_nick (WOCKY_TYPE_PUBSUB_AFFILIATION_STATE, affiliation, &state)) { DEBUG ("unknown affiliation '%s'; skipping", affiliation); continue; } g_queue_push_tail (&affs, wocky_pubsub_affiliation_new (self, jid, state)); } return affs.head; } static void list_affiliates_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubNode *self = WOCKY_PUBSUB_NODE ( g_async_result_get_source_object (user_data)); WockyNodeTree *affs_tree; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB_OWNER, "affiliations", &affs_tree, &error)) { WockyNode *affiliations_node = wocky_node_tree_get_top_node (affs_tree); g_simple_async_result_set_op_res_gpointer (simple, wocky_pubsub_node_parse_affiliations (self, affiliations_node), (GDestroyNotify) wocky_pubsub_affiliation_list_free); g_object_unref (affs_tree); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } /** * wocky_pubsub_node_list_affiliates_async: * @self: a pubsub node * @cancellable: optional #GCancellable object * @callback: function to call when the affiliates have been retrieved or an * error has occured * @user_data: data to pass to @callback. * * Retrieves the list of entities affilied to a node you own. @callback may * complete the call using wocky_pubsub_node_list_affiliates_finish(). * * (A note on naming: this is §8.9.1 — Retrieve Affiliations List — in * XEP-0060, not to be confused with §5.7 — Retrieve Affiliations. The * slightly different terminology in Wocky is intended to help disambiguate!) */ void wocky_pubsub_node_list_affiliates_async ( WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_list_affiliates_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_list_affiliates_stanza (self, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, list_affiliates_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_list_affiliates_finish: * @self: a pubsub node * @result: the result passed to a callback * @affiliates: location at which to store a list of #WockyPubsubAffiliation * pointers, or %NULL * @error: location at which to store an error, or %NULL * * Completes a call to wocky_pubsub_node_list_affiliates_async(). The list * returned in @affiliates should be freed with * wocky_pubsub_affiliation_list_free() when it is no longer needed. * * Returns: %TRUE if the list of subscribers was successfully retrieved; %FALSE * and sets @error if an error occured. */ gboolean wocky_pubsub_node_list_affiliates_finish ( WockyPubsubNode *self, GAsyncResult *result, GList **affiliates, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_pubsub_node_list_affiliates_async, wocky_pubsub_affiliation_list_copy, affiliates); } /** * wocky_pubsub_node_make_modify_affiliates_stanza: * @self: a pubsub node * @affiliates: a list of #WockyPubsubAffiliation structures, describing only * the affiliations which should be changed. * @pubsub_node: location at which to store a pointer to the <pubsub/> * node, or %NULL * @affiliations_node: location at which to store a pointer to the * <affiliations/> node, or %NULL * * Returns: an IQ stanza to modify the entities affiliated to a node that you * own. */ WockyStanza * wocky_pubsub_node_make_modify_affiliates_stanza ( WockyPubsubNode *self, const GList *affiliates, WockyNode **pubsub_node, WockyNode **affiliations_node) { WockyStanza *stanza; WockyNode *affiliations; const GList *l; stanza = pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB_OWNER, "affiliations", NULL, pubsub_node, &affiliations); for (l = affiliates; l != NULL; l = l->next) { const WockyPubsubAffiliation *aff = l->data; WockyNode *affiliation = wocky_node_add_child (affiliations, "affiliation"); const gchar *state = wocky_enum_to_nick ( WOCKY_TYPE_PUBSUB_AFFILIATION_STATE, aff->state); if (aff->jid == NULL) { g_warning ("Affiliate JID may not be NULL"); continue; } if (state == NULL) { g_warning ("Invalid WockyPubsubAffiliationState %u", aff->state); continue; } /* Let's allow the API user to leave node as NULL in each element in the * list of updates, given that we know which node they want to update. * But if they *do* specify it, it'd better be this node. */ if (aff->node != NULL && aff->node != self) { g_warning ("Tried to update affiliates for %s, passing a " "WockyPubsubAffiliation for %s", wocky_pubsub_node_get_name (self), wocky_pubsub_node_get_name (aff->node)); continue; } wocky_node_set_attribute (affiliation, "jid", aff->jid); wocky_node_set_attribute (affiliation, "affiliation", state); } if (affiliations_node != NULL) *affiliations_node = affiliations; return stanza; } /** * wocky_pubsub_node_modify_affiliates_async: * @self: a pubsub node * @affiliates: a list of #WockyPubsubAffiliation structures, describing only * the affiliations which should be changed. * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Modifies the entities affiliated to a node that you own. */ void wocky_pubsub_node_modify_affiliates_async ( WockyPubsubNode *self, const GList *affiliates, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_modify_affiliates_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_modify_affiliates_stanza ( self, affiliates, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, pubsub_node_void_iq_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_modify_affiliates_finish: * @self: a node * @result: the result * @error: location at which to store an error, if one occurred. * * Complete a call to wocky_pubsub_node_modify_affiliates_async(). * * Returns: %TRUE if the affiliates were successfully modified; %FALSE and sets * @error otherwise. */ gboolean wocky_pubsub_node_modify_affiliates_finish ( WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_pubsub_node_modify_affiliates_async); } /** * wocky_pubsub_node_make_get_configuration_stanza: * @self: a pubsub node * @pubsub_node: location at which to store a pointer to the <pubsub/> * node, or %NULL * @configure_node: location at which to store a pointer to the * <configure/> node, or %NULL * * Returns: an IQ stanza to retrieve the configuration of @self */ WockyStanza * wocky_pubsub_node_make_get_configuration_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **configure_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "configure", NULL, pubsub_node, configure_node); } static void get_configuration_iq_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GSimpleAsyncResult *simple = user_data; WockyNodeTree *conf_tree; WockyDataForm *form = NULL; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, result, WOCKY_XMPP_NS_PUBSUB_OWNER, "configure", &conf_tree, &error)) { form = wocky_data_form_new_from_form ( wocky_node_tree_get_top_node (conf_tree), &error); g_object_unref (conf_tree); } if (form != NULL) { g_simple_async_result_set_op_res_gpointer (simple, form, g_object_unref); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); } /** * wocky_pubsub_node_get_configuration_async: * @self: a node * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Retrieves the current configuration for a node owned by the user. */ void wocky_pubsub_node_get_configuration_async ( WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_get_configuration_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_get_configuration_stanza ( self, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, get_configuration_iq_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_get_configuration_finish: * @self: a node * @result: the result * @error: location at which to store an error, if one occurred. * * Complete a call to wocky_pubsub_node_get_configuration_async(). * * Returns: a form representing the node configuration on success; %NULL and * sets @error otherwise */ WockyDataForm * wocky_pubsub_node_get_configuration_finish ( WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_return_copy_pointer (self, wocky_pubsub_node_get_configuration_async, g_object_ref); } WockyPorter * wocky_pubsub_node_get_porter (WockyPubsubNode *self) { WockyPubsubNodePrivate *priv = self->priv; return priv->porter; } /* WockyPubsubAffiliation boilerplate */ /** * WockyPubsubAffiliation: * @node: the node to which this affiliation relates * @jid: the bare JID affiliated to @node * @state: the state of @jid's affiliation to @node * * Represents an affiliation to a node, as returned by * wocky_pubsub_node_list_affiliates_finish(). */ /** * WockyPubsubAffiliationState: * @WOCKY_PUBSUB_AFFILIATION_OWNER: Owner * @WOCKY_PUBSUB_AFFILIATION_PUBLISHER: Publisher * @WOCKY_PUBSUB_AFFILIATION_PUBLISH_ONLY: Publish-Only * @WOCKY_PUBSUB_AFFILIATION_MEMBER: Member * @WOCKY_PUBSUB_AFFILIATION_NONE: None * @WOCKY_PUBSUB_AFFILIATION_OUTCAST: Outcast * * Possible affiliations to a PubSub node, which determine privileges an entity * has. See XEP-0060 * §4.1 for the details. */ GType wocky_pubsub_affiliation_get_type (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = g_boxed_type_register_static ("WockyPubsubAffiliation", (GBoxedCopyFunc) wocky_pubsub_affiliation_copy, (GBoxedFreeFunc) wocky_pubsub_affiliation_free); return t; } /** * wocky_pubsub_affiliation_new: * @node: a node * @jid: the JID affiliated to @node * @state: the state of @jid's affiliation to @node * * * * Returns: a new structure representing an affiliation, which should * ultimately be freed with wocky_pubsub_affiliation_free() */ WockyPubsubAffiliation * wocky_pubsub_affiliation_new ( WockyPubsubNode *node, const gchar *jid, WockyPubsubAffiliationState state) { WockyPubsubAffiliation aff = { NULL, g_strdup (jid), state }; g_return_val_if_fail (node != NULL, NULL); aff.node = g_object_ref (node); return g_slice_dup (WockyPubsubAffiliation, &aff); } /** * wocky_pubsub_affiliation_copy: * @aff: an existing affiliation structure * * * * Returns: a duplicate of @aff; the duplicate should ultimately be freed * with wocky_pubsub_affiliation_free() */ WockyPubsubAffiliation * wocky_pubsub_affiliation_copy ( WockyPubsubAffiliation *aff) { g_return_val_if_fail (aff != NULL, NULL); return wocky_pubsub_affiliation_new (aff->node, aff->jid, aff->state); } /** * wocky_pubsub_affiliation_free: * @aff: an affiliation * * Frees an affiliation, previously allocated with * wocky_pubsub_affiliation_new() or wocky_pubsub_affiliation_copy() */ void wocky_pubsub_affiliation_free (WockyPubsubAffiliation *aff) { g_return_if_fail (aff != NULL); g_object_unref (aff->node); g_free (aff->jid); g_slice_free (WockyPubsubAffiliation, aff); } /** * wocky_pubsub_affiliation_list_copy: * @affs: a list of #WockyPubsubAffiliation * * Shorthand for manually copying @affs, duplicating each element with * wocky_pubsub_affiliation_copy(). * * Returns: a deep copy of @affs, which should ultimately be freed with * wocky_pubsub_affiliation_list_free(). */ GList * wocky_pubsub_affiliation_list_copy (GList *affs) { return wocky_list_deep_copy ( (GBoxedCopyFunc) wocky_pubsub_affiliation_copy, affs); } /** * wocky_pubsub_affiliation_list_free: * @affs: a list of #WockyPubsubAffiliation * * Frees a list of WockyPubsubAffiliation structures, as shorthand for calling * wocky_pubsub_affiliation_free() for each element, followed by g_list_free(). */ void wocky_pubsub_affiliation_list_free (GList *affs) { g_list_foreach (affs, (GFunc) wocky_pubsub_affiliation_free, NULL); g_list_free (affs); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-http-proxy.h0000644000175000017500000000353012050202021023617 0ustar00wjtwjt00000000000000 /* wocky-http-proxy.h: Header for WockyHttpProxy * * Copyright (C) 2010 Collabora, Ltd. * @author Nicolas Dufresne * * * 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 */ #if !defined (WOCKY_COMPILATION) # error "This is an internal header." #endif #ifndef _WOCKY_HTTP_PROXY_H_ #define _WOCKY_HTTP_PROXY_H_ #include G_BEGIN_DECLS #define WOCKY_TYPE_HTTP_PROXY (_wocky_http_proxy_get_type ()) #define WOCKY_HTTP_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), WOCKY_TYPE_HTTP_PROXY, WockyHttpProxy)) #define WOCKY_HTTP_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), WOCKY_TYPE_HTTP_PROXY, WockyHttpProxyClass)) #define WOCKY_IS_HTTP_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), WOCKY_TYPE_HTTP_PROXY)) #define WOCKY_IS_HTTP_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), WOCKY_TYPE_HTTP_PROXY)) #define WOCKY_HTTP_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), WOCKY_TYPE_HTTP_PROXY, WockyHttpProxyClass)) typedef struct _WockyHttpProxy WockyHttpProxy; typedef struct _WockyHttpProxyClass WockyHttpProxyClass; GType _wocky_http_proxy_get_type (void); G_END_DECLS #endif /* _WOCKY_HTTP_PROXY_H_ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-heartbeat-source.h0000644000175000017500000000262712050202021024724 0ustar00wjtwjt00000000000000/* * wocky-heartbeat-source.h: header for a GSource wrapping libiphb. * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * @author Will Thompson * * 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 */ #if !defined (WOCKY_COMPILATION) # error "This is an internal header." #endif #ifndef WOCKY_HEARTBEAT_SOURCE_H #define WOCKY_HEARTBEAT_SOURCE_H #include G_BEGIN_DECLS typedef void (*WockyHeartbeatCallback) ( gpointer user_data); GSource *wocky_heartbeat_source_new ( guint max_interval); void wocky_heartbeat_source_update_interval ( GSource *source, guint max_interval); G_END_DECLS #endif /* WOCKY_HEARTBEAT_SOURCE_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-stanza.c0000644000175000017500000005263412051446215023005 0ustar00wjtwjt00000000000000/* * wocky-stanza.c - Source for WockyStanza * Copyright (C) 2006-2010 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #include #include #include #include "wocky-stanza.h" #include "wocky-xmpp-error.h" #include "wocky-namespaces.h" #include "wocky-debug-internal.h" #include "wocky-node-private.h" G_DEFINE_TYPE(WockyStanza, wocky_stanza, WOCKY_TYPE_NODE_TREE) /* private structure */ struct _WockyStanzaPrivate { WockyContact *from_contact; WockyContact *to_contact; gboolean dispose_has_run; }; typedef struct { WockyStanzaType type; const gchar *name; const gchar *ns; } StanzaTypeName; static const StanzaTypeName type_names[NUM_WOCKY_STANZA_TYPE] = { { WOCKY_STANZA_TYPE_NONE, NULL, WOCKY_XMPP_NS_JABBER_CLIENT }, { WOCKY_STANZA_TYPE_MESSAGE, "message", WOCKY_XMPP_NS_JABBER_CLIENT }, { WOCKY_STANZA_TYPE_PRESENCE, "presence", WOCKY_XMPP_NS_JABBER_CLIENT }, { WOCKY_STANZA_TYPE_IQ, "iq", WOCKY_XMPP_NS_JABBER_CLIENT }, { WOCKY_STANZA_TYPE_STREAM, "stream", WOCKY_XMPP_NS_STREAM }, { WOCKY_STANZA_TYPE_STREAM_FEATURES, "features", WOCKY_XMPP_NS_STREAM }, { WOCKY_STANZA_TYPE_AUTH, "auth", WOCKY_XMPP_NS_SASL_AUTH }, { WOCKY_STANZA_TYPE_CHALLENGE, "challenge", WOCKY_XMPP_NS_SASL_AUTH }, { WOCKY_STANZA_TYPE_RESPONSE, "response", WOCKY_XMPP_NS_SASL_AUTH }, { WOCKY_STANZA_TYPE_SUCCESS, "success", WOCKY_XMPP_NS_SASL_AUTH }, { WOCKY_STANZA_TYPE_FAILURE, "failure", WOCKY_XMPP_NS_SASL_AUTH }, { WOCKY_STANZA_TYPE_STREAM_ERROR, "error", WOCKY_XMPP_NS_STREAM }, { WOCKY_STANZA_TYPE_UNKNOWN, NULL, NULL }, }; typedef struct { WockyStanzaSubType sub_type; const gchar *name; WockyStanzaType type; } StanzaSubTypeName; static const StanzaSubTypeName sub_type_names[NUM_WOCKY_STANZA_SUB_TYPE] = { { WOCKY_STANZA_SUB_TYPE_NONE, NULL, WOCKY_STANZA_TYPE_NONE }, { WOCKY_STANZA_SUB_TYPE_AVAILABLE, NULL, WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_NORMAL, "normal", WOCKY_STANZA_TYPE_NONE }, { WOCKY_STANZA_SUB_TYPE_CHAT, "chat", WOCKY_STANZA_TYPE_MESSAGE }, { WOCKY_STANZA_SUB_TYPE_GROUPCHAT, "groupchat", WOCKY_STANZA_TYPE_MESSAGE }, { WOCKY_STANZA_SUB_TYPE_HEADLINE, "headline", WOCKY_STANZA_TYPE_MESSAGE }, { WOCKY_STANZA_SUB_TYPE_UNAVAILABLE, "unavailable", WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_PROBE, "probe", WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_SUBSCRIBE, "subscribe", WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBE, "unsubscribe", WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_SUBSCRIBED, "subscribed", WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBED, "unsubscribed", WOCKY_STANZA_TYPE_PRESENCE }, { WOCKY_STANZA_SUB_TYPE_GET, "get", WOCKY_STANZA_TYPE_IQ }, { WOCKY_STANZA_SUB_TYPE_SET, "set", WOCKY_STANZA_TYPE_IQ }, { WOCKY_STANZA_SUB_TYPE_RESULT, "result", WOCKY_STANZA_TYPE_IQ }, { WOCKY_STANZA_SUB_TYPE_ERROR, "error", WOCKY_STANZA_TYPE_NONE }, { WOCKY_STANZA_SUB_TYPE_UNKNOWN, NULL, WOCKY_STANZA_TYPE_UNKNOWN }, }; static void wocky_stanza_init (WockyStanza *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_STANZA, WockyStanzaPrivate); self->priv->from_contact = NULL; self->priv->to_contact = NULL; } static void wocky_stanza_dispose (GObject *object); static void wocky_stanza_finalize (GObject *object); static void wocky_stanza_class_init (WockyStanzaClass *wocky_stanza_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_stanza_class); g_type_class_add_private (wocky_stanza_class, sizeof (WockyStanzaPrivate)); object_class->dispose = wocky_stanza_dispose; object_class->finalize = wocky_stanza_finalize; } static void wocky_stanza_dispose (GObject *object) { WockyStanza *self = WOCKY_STANZA (object); WockyStanzaPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_stanza_parent_class)->dispose) G_OBJECT_CLASS (wocky_stanza_parent_class)->dispose (object); } static void wocky_stanza_finalize (GObject *object) { WockyStanza *self = WOCKY_STANZA (object); if (self->priv->from_contact != NULL) { g_object_unref (self->priv->from_contact); self->priv->from_contact = NULL; } if (self->priv->to_contact != NULL) { g_object_unref (self->priv->to_contact); self->priv->to_contact = NULL; } G_OBJECT_CLASS (wocky_stanza_parent_class)->finalize (object); } WockyStanza * wocky_stanza_new (const gchar *name, const gchar *ns) { WockyStanza *result; result = WOCKY_STANZA (g_object_new (WOCKY_TYPE_STANZA, "top-node", wocky_node_new (name, ns), NULL)); return result; } WockyStanza * wocky_stanza_copy (WockyStanza *old) { WockyNode *top; top = _wocky_node_copy (wocky_stanza_get_top_node (old)); return g_object_new (WOCKY_TYPE_STANZA, "top-node", top, NULL); } static const gchar * get_type_name (WockyStanzaType type) { if (type <= WOCKY_STANZA_TYPE_NONE || type >= NUM_WOCKY_STANZA_TYPE) return NULL; g_assert (type_names[type].type == type); return type_names[type].name; } static const gchar * get_type_ns (WockyStanzaType type) { if (type <= WOCKY_STANZA_TYPE_NONE || type >= NUM_WOCKY_STANZA_TYPE) return NULL; g_assert (type_names[type].type == type); return type_names[type].ns; } static const gchar * get_sub_type_name (WockyStanzaSubType sub_type) { if (sub_type <= WOCKY_STANZA_SUB_TYPE_NONE || sub_type >= NUM_WOCKY_STANZA_SUB_TYPE) return NULL; g_assert (sub_type_names[sub_type].sub_type == sub_type); return sub_type_names[sub_type].name; } static gboolean check_sub_type (WockyStanzaType type, WockyStanzaSubType sub_type) { WockyStanzaType expected_type; g_return_val_if_fail (type > WOCKY_STANZA_TYPE_NONE && type < NUM_WOCKY_STANZA_TYPE, FALSE); g_return_val_if_fail (sub_type < NUM_WOCKY_STANZA_SUB_TYPE, FALSE); g_assert (sub_type_names[sub_type].sub_type == sub_type); expected_type = sub_type_names[sub_type].type; if (expected_type != WOCKY_STANZA_TYPE_NONE && expected_type != type) { g_critical ("Stanza sub-type '%s' may only be used with stanzas of " "type '%s', not of type '%s'", sub_type_names[sub_type].name, type_names[expected_type].name, type_names[type].name); g_return_val_if_reached (FALSE); } return TRUE; } static WockyStanza * wocky_stanza_new_with_sub_type (WockyStanzaType type, WockyStanzaSubType sub_type) { WockyStanza *stanza = NULL; const gchar *sub_type_name; if (!check_sub_type (type, sub_type)) return NULL; stanza = wocky_stanza_new (get_type_name (type), get_type_ns (type)); sub_type_name = get_sub_type_name (sub_type); if (sub_type_name != NULL) wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "type", sub_type_name); return stanza; } /** * wocky_stanza_build: * @type: The type of stanza to build * @sub_type: The stanza's subtype; valid values depend on @type. (For instance, * #WOCKY_STANZA_TYPE_IQ can use #WOCKY_STANZA_SUB_TYPE_GET, but not * #WOCKY_STANZA_SUB_TYPE_SUBSCRIBED.) * @from: The sender's JID, or %NULL to leave it unspecified. * @to: The target's JID, or %NULL to leave it unspecified. * @...: the description of the stanza to build, * terminated with %NULL * * Build a XMPP stanza from a list of arguments. * Example: * * * wocky_stanza_build ( * WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, * "alice@collabora.co.uk", "bob@collabora.co.uk", * WOCKY_NODE_START, "html", * WOCKY_NODE_XMLNS, "http://www.w3.org/1999/xhtml", * WOCKY_NODE, "body", * WOCKY_NODE_ATTRIBUTE, "textcolor", "red", * WOCKY_NODE_TEXT, "Telepathy rocks!", * WOCKY_NODE_END, * WOCKY_NODE_END, * NULL); * * /* produces * <message from='alice@collabora.co.uk' to='bob@collabora.co.uk'> * <html xmlns='http://www.w3.org/1999/xhtml'> * <body textcolor='red'> * Telepathy rocks! * </body> * </html> * </message> * */ * * * You may optionally use mnemonic ASCII characters in place of the build tags, * to better reflect the structure of the stanza in C source. For example, the * above stanza could be written as: * * * wocky_stanza_build ( * WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, * "alice@collabora.co.uk", "bob@collabora.co.uk", * '(', "html", ':', "http://www.w3.org/1999/xhtml", * '(', "body", '@', "textcolor", "red", * '$', "Telepathy rocks!", * ')', * ')' * NULL); * * * Returns: a new stanza object */ WockyStanza * wocky_stanza_build (WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, const gchar *to, ...) { WockyStanza *stanza; va_list ap; va_start (ap, to); stanza = wocky_stanza_build_va (type, sub_type, from, to, ap); va_end (ap); return stanza; } WockyStanza * wocky_stanza_build_to_contact (WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, WockyContact *to, ...) { WockyStanza *stanza; va_list ap; gchar *to_jid = NULL; if (to != NULL) to_jid = wocky_contact_dup_jid (to); va_start (ap, to); stanza = wocky_stanza_build_va (type, sub_type, from, to_jid, ap); va_end (ap); g_free (to_jid); stanza->priv->to_contact = g_object_ref (to); return stanza; } WockyStanza * wocky_stanza_build_va (WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, const gchar *to, va_list ap) { WockyStanza *stanza; g_return_val_if_fail (type < NUM_WOCKY_STANZA_TYPE, NULL); g_return_val_if_fail (sub_type < NUM_WOCKY_STANZA_SUB_TYPE, NULL); stanza = wocky_stanza_new_with_sub_type (type, sub_type); if (stanza == NULL) return NULL; if (from != NULL) wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "from", from); if (to != NULL) wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "to", to); wocky_node_add_build_va (wocky_stanza_get_top_node (stanza), ap); return stanza; } static WockyStanzaType get_type_from_name (const gchar *name) { guint i; if (name == NULL) return WOCKY_STANZA_TYPE_NONE; /* We skip the first entry as it's NONE */ for (i = 1; i < WOCKY_STANZA_TYPE_UNKNOWN; i++) { if (type_names[i].name != NULL && strcmp (name, type_names[i].name) == 0) { return type_names[i].type; } } return WOCKY_STANZA_TYPE_UNKNOWN; } static WockyStanzaSubType get_sub_type_from_name (const gchar *name) { guint i; if (name == NULL) return WOCKY_STANZA_SUB_TYPE_NONE; /* We skip the first entry as it's NONE */ for (i = 1; i < WOCKY_STANZA_SUB_TYPE_UNKNOWN; i++) { if (sub_type_names[i].name != NULL && strcmp (name, sub_type_names[i].name) == 0) { return sub_type_names[i].sub_type; } } return WOCKY_STANZA_SUB_TYPE_UNKNOWN; } void wocky_stanza_get_type_info (WockyStanza *stanza, WockyStanzaType *type, WockyStanzaSubType *sub_type) { g_return_if_fail (stanza != NULL); g_assert (wocky_stanza_get_top_node (stanza) != NULL); if (type != NULL) *type = get_type_from_name (wocky_stanza_get_top_node (stanza)->name); if (sub_type != NULL) *sub_type = get_sub_type_from_name (wocky_node_get_attribute ( wocky_stanza_get_top_node (stanza), "type")); } static WockyStanza * create_iq_reply (WockyStanza *iq, WockyStanzaSubType sub_type_reply, va_list ap) { WockyStanza *reply; WockyStanzaType type; WockyNode *node; WockyStanzaSubType sub_type; const gchar *from, *to, *id; WockyContact *contact; g_return_val_if_fail (iq != NULL, NULL); wocky_stanza_get_type_info (iq, &type, &sub_type); g_return_val_if_fail (type == WOCKY_STANZA_TYPE_IQ, NULL); g_return_val_if_fail (sub_type == WOCKY_STANZA_SUB_TYPE_GET || sub_type == WOCKY_STANZA_SUB_TYPE_SET, NULL); node = wocky_stanza_get_top_node (iq); from = wocky_node_get_attribute (node, "from"); to = wocky_node_get_attribute (node, "to"); id = wocky_node_get_attribute (node, "id"); if (id == NULL) return NULL; reply = wocky_stanza_build_va (WOCKY_STANZA_TYPE_IQ, sub_type_reply, to, from, ap); wocky_node_set_attribute (wocky_stanza_get_top_node (reply), "id", id); contact = wocky_stanza_get_from_contact (iq); if (contact != NULL) wocky_stanza_set_to_contact (reply, contact); return reply; } WockyStanza * wocky_stanza_build_iq_result (WockyStanza *iq, ...) { WockyStanza *reply; va_list ap; va_start (ap, iq); reply = create_iq_reply (iq, WOCKY_STANZA_SUB_TYPE_RESULT, ap); va_end (ap); return reply; } WockyStanza * wocky_stanza_build_iq_result_va ( WockyStanza *iq, va_list ap) { return create_iq_reply (iq, WOCKY_STANZA_SUB_TYPE_RESULT, ap); } /** * wocky_stanza_build_iq_error: * @iq: a stanza of type #WOCKY_STANZA_TYPE_IQ and sub-type either * #WOCKY_STANZA_SUB_TYPE_SET or #WOCKY_STANZA_SUB_TYPE_GET * @...: a wocky_stanza_build() specification * * Builds an error reply to @iq containing the given body. This function also * adds the child element of @iq to the reply, as recommended by RFC3920 §9.2.3 * ‘IQ Semantics’. * * No <error/> element is added to the reply. To add a * standard stanza error, plus message, consider using * wocky_stanza_error_to_node(). To add a more complicated error with an * application-specific condition, specify it when calling this function. For * example: * * |[ * WockyStanza *reply = wocky_stanza_build_iq_error (iq, * '(', "error", * '@', "type", "cancel", * '(', "feature-not-implemented", ':', WOCKY_XMPP_NS_STANZAS, ')', * '(', "unsupported", ':', WOCKY_XMPP_NS_PUBSUB_ERRORS, * '@', "feature", "subscribe", * ')', * ')', NULL); * ]| * * Returns: an error reply for @iq */ WockyStanza * wocky_stanza_build_iq_error (WockyStanza *iq, ...) { WockyStanza *reply; WockyNode *query; va_list ap; va_start (ap, iq); reply = create_iq_reply (iq, WOCKY_STANZA_SUB_TYPE_ERROR, ap); va_end (ap); /* RFC3920 §9.2.3 dictates: * 5. An IQ stanza of type "get" or "set" MUST contain one and only one * child element that specifies the semantics of the particular request * or response. * … * 7. An IQ stanza of type "error" SHOULD include the child element * contained in the associated "get" or "set" and MUST include an * child; for details, see Stanza Errors. * * So here we take the first child out of the stanza we're replying to, and * include it in the error reply. If @iq has more than one child, it * was illegal, so we're within our rights to ignore everything after the * first. If @iq has no children, it was also illegal, so there's no way we * can comply with the SHOULD. */ query = wocky_node_get_first_child (wocky_stanza_get_top_node (iq)); if (reply != NULL && query != NULL) { WockyNodeTree *query_tree = wocky_node_tree_new_from_node (query); wocky_node_prepend_node_tree (wocky_stanza_get_top_node (reply), query_tree); g_object_unref (query_tree); } return reply; } WockyStanza * wocky_stanza_build_iq_error_va ( WockyStanza *iq, va_list ap) { return create_iq_reply (iq, WOCKY_STANZA_SUB_TYPE_ERROR, ap); } /** * wocky_stanza_extract_errors: * @stanza: a message/iq/presence stanza * @type: location at which to store the error type * @core: location at which to store an error in the domain #WOCKY_XMPP_ERROR * @specialized: location at which to store an error in an application-specific * domain, if one is found * @specialized_node: location at which to store the node representing an * application-specific error, if one is found * * Given a message, iq or presence stanza with type='error', breaks it down * into values describing the error. @type and @core are guaranteed to be set; * @specialized and @specialized_node will be set if a recognised * application-specific error is found, and the latter will be set to %NULL if * no application-specific error is found. * * Any or all of the out parameters may be %NULL to ignore the value. The * value stored in @specialized_node is borrowed from @stanza, and is only * valid as long as the latter is alive. * * Returns: %TRUE if the stanza had type='error'; %FALSE otherwise */ gboolean wocky_stanza_extract_errors (WockyStanza *stanza, WockyXmppErrorType *type, GError **core, GError **specialized, WockyNode **specialized_node) { WockyStanzaSubType sub_type; WockyNode *error; wocky_stanza_get_type_info (stanza, NULL, &sub_type); if (sub_type != WOCKY_STANZA_SUB_TYPE_ERROR) return FALSE; error = wocky_node_get_child (wocky_stanza_get_top_node (stanza), "error"); if (error == NULL) { if (type != NULL) *type = WOCKY_XMPP_ERROR_TYPE_CANCEL; g_set_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION, "stanza had type='error' but no node"); if (specialized_node != NULL) *specialized_node = NULL; } else { wocky_xmpp_error_extract (error, type, core, specialized, specialized_node); } return TRUE; } /** * wocky_stanza_extract_stream_error: * @stanza: a stanza * @stream_error: location at which to store an error in domain * #WOCKY_XMPP_STREAM_ERROR, if one is found. * * Returns: %TRUE and sets @stream_error if the stanza was indeed a stream * error. */ gboolean wocky_stanza_extract_stream_error (WockyStanza *stanza, GError **stream_error) { WockyStanzaType type; wocky_stanza_get_type_info (stanza, &type, NULL); if (type != WOCKY_STANZA_TYPE_STREAM_ERROR) return FALSE; g_propagate_error (stream_error, wocky_xmpp_stream_error_from_node (wocky_stanza_get_top_node (stanza))); return TRUE; } /** * wocky_stanza_get_top_node: * @self: a stanza * * Returns: A pointer to the topmost node of the stanza */ WockyNode * wocky_stanza_get_top_node (WockyStanza *self) { return wocky_node_tree_get_top_node (WOCKY_NODE_TREE (self)); } /** * wocky_stanza_get_from: * @self: a stanza * * * * Returns: The sender of @self, or %NULL if no sender was specified. */ const gchar * wocky_stanza_get_from (WockyStanza *self) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (WOCKY_IS_STANZA (self), NULL); return wocky_node_get_attribute (wocky_stanza_get_top_node (self), "from"); } /** * wocky_stanza_get_to: * @self: a stanza * * * * Returns: The recipient of @self, or %NULL if no recipient was specified. */ const gchar * wocky_stanza_get_to (WockyStanza *self) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (WOCKY_IS_STANZA (self), NULL); return wocky_node_get_attribute (wocky_stanza_get_top_node (self), "to"); } WockyContact * wocky_stanza_get_to_contact (WockyStanza *self) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (WOCKY_IS_STANZA (self), NULL); return self->priv->to_contact; } WockyContact * wocky_stanza_get_from_contact (WockyStanza *self) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (WOCKY_IS_STANZA (self), NULL); return self->priv->from_contact; } void wocky_stanza_set_to_contact (WockyStanza *self, WockyContact *contact) { g_return_if_fail (self != NULL); g_return_if_fail (WOCKY_IS_STANZA (self)); g_return_if_fail (WOCKY_IS_CONTACT (contact)); if (self->priv->to_contact != NULL) g_object_unref (self->priv->to_contact); self->priv->to_contact = g_object_ref (contact); } void wocky_stanza_set_from_contact (WockyStanza *self, WockyContact *contact) { g_return_if_fail (self != NULL); g_return_if_fail (WOCKY_IS_STANZA (self)); g_return_if_fail (WOCKY_IS_CONTACT (contact)); if (self->priv->from_contact != NULL) g_object_unref (self->priv->from_contact); self->priv->from_contact = g_object_ref (contact); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-ll-connector.c0000644000175000017500000003536712050202021024070 0ustar00wjtwjt00000000000000/* * wocky-ll-connector.c - Source for WockyLLConnector * Copyright (C) 2011 Collabora Ltd. * * 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 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "wocky-ll-connector.h" #include "wocky-utils.h" #include "wocky-namespaces.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_CONNECTOR #include "wocky-debug-internal.h" static void initable_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (WockyLLConnector, wocky_ll_connector, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, initable_iface_init)) enum { PROP_STREAM = 1, PROP_CONNECTION, PROP_LOCAL_JID, PROP_REMOTE_JID, PROP_INCOMING, }; /* private structure */ struct _WockyLLConnectorPrivate { GIOStream *stream; WockyXmppConnection *connection; gchar *local_jid; gchar *remote_jid; gboolean incoming; gchar *from; GSimpleAsyncResult *simple; GCancellable *cancellable; }; GQuark wocky_ll_connector_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ( "wocky_ll_connector_error"); return quark; } static void wocky_ll_connector_init (WockyLLConnector *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_LL_CONNECTOR, WockyLLConnectorPrivate); } static void wocky_ll_connector_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyLLConnector *connector = WOCKY_LL_CONNECTOR (object); WockyLLConnectorPrivate *priv = connector->priv; switch (property_id) { case PROP_STREAM: priv->stream = g_value_get_object (value); break; case PROP_CONNECTION: priv->connection = g_value_get_object (value); break; case PROP_LOCAL_JID: priv->local_jid = g_value_dup_string (value); break; case PROP_REMOTE_JID: priv->remote_jid = g_value_dup_string (value); break; case PROP_INCOMING: priv->incoming = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_ll_connector_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyLLConnector *connector = WOCKY_LL_CONNECTOR (object); WockyLLConnectorPrivate *priv = connector->priv; switch (property_id) { case PROP_STREAM: g_value_set_object (value, priv->stream); break; case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_LOCAL_JID: g_value_set_string (value, priv->local_jid); break; case PROP_REMOTE_JID: g_value_set_string (value, priv->remote_jid); break; case PROP_INCOMING: g_value_set_boolean (value, priv->incoming); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_ll_connector_dispose (GObject *object) { WockyLLConnector *self = WOCKY_LL_CONNECTOR (object); WockyLLConnectorPrivate *priv = self->priv; DEBUG ("dispose called"); g_object_unref (priv->connection); priv->connection = NULL; g_free (priv->local_jid); priv->local_jid = NULL; g_free (priv->remote_jid); priv->remote_jid = NULL; g_free (priv->from); priv->from = NULL; if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } if (G_OBJECT_CLASS (wocky_ll_connector_parent_class)->dispose) G_OBJECT_CLASS (wocky_ll_connector_parent_class)->dispose (object); } static void wocky_ll_connector_constructed (GObject *object) { WockyLLConnector *self = WOCKY_LL_CONNECTOR (object); WockyLLConnectorPrivate *priv = self->priv; if (G_OBJECT_CLASS (wocky_ll_connector_parent_class)->constructed) G_OBJECT_CLASS (wocky_ll_connector_parent_class)->constructed (object); if (priv->connection == NULL) priv->connection = wocky_xmpp_connection_new (priv->stream); } static void wocky_ll_connector_class_init ( WockyLLConnectorClass *wocky_ll_connector_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_ll_connector_class); GParamSpec *spec; object_class->get_property = wocky_ll_connector_get_property; object_class->set_property = wocky_ll_connector_set_property; object_class->dispose = wocky_ll_connector_dispose; object_class->constructed = wocky_ll_connector_constructed; spec = g_param_spec_object ("stream", "XMPP stream", "The XMPP stream", G_TYPE_IO_STREAM, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STREAM, spec); spec = g_param_spec_object ("connection", "XMPP connection", "The XMPP connection", WOCKY_TYPE_XMPP_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, spec); spec = g_param_spec_string ("local-jid", "User's JID", "Local user's XMPP JID", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_JID, spec); spec = g_param_spec_string ("remote-jid", "Contact's JID", "Remote contact's XMPP JID", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_JID, spec); spec = g_param_spec_boolean ("incoming", "Incoming", "Whether the connection is incoming", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INCOMING, spec); g_type_class_add_private (wocky_ll_connector_class, sizeof (WockyLLConnectorPrivate)); } /** * wocky_ll_connector_incoming_async: * @stream: a #GIOStream * @cancellable: an optional #GCancellable, or %NULL * @callback: a function to call when the operation is complete * @user_data: data to pass to @callback * * Start an asychronous connect operation with an incoming link-local * connection by negotiating the stream open stanzas and sending * stream features. * * The ownership of @stream is taken by the connector. * * When the operation is complete, @callback will be called and it * should call wocky_ll_connector_finish(). */ void wocky_ll_connector_incoming_async ( GIOStream *stream, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (WOCKY_TYPE_LL_CONNECTOR, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "stream", stream, "incoming", TRUE, NULL); } /** * wocky_ll_connector_outgoing_async: * @connection: a #WockyXmppConnection * @local_jid: the JID of the local user * @remote_jid: the JID of the remote contact * @cancellable: an optional #GCancellable, or %NULL * @callback: a function to call when the operation is complete * @user_data: data to pass to @callback * * Start an asychronous connect operation with an outgoing link-local * connection by negotiating the stream open stanzas and sending * stream features. * * The ownership of @connection is taken by the connector. * * When the operation is complete, @callback will be called and it * should call wocky_ll_connector_finish(). */ void wocky_ll_connector_outgoing_async ( WockyXmppConnection *connection, const gchar *local_jid, const gchar *remote_jid, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (WOCKY_TYPE_LL_CONNECTOR, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "connection", connection, "local-jid", local_jid, "remote-jid", remote_jid, "incoming", FALSE, NULL); } static void features_sent_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source_object); WockyLLConnector *self = user_data; WockyLLConnectorPrivate *priv = self->priv; GError *error = NULL; if (!wocky_xmpp_connection_send_stanza_finish (connection, result, &error)) { DEBUG ("Failed to send stream features: %s", error->message); g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR, WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_SEND_STANZA, "Failed to send stream features: %s", error->message); g_clear_error (&error); } g_simple_async_result_complete (priv->simple); g_object_unref (priv->simple); priv->simple = NULL; g_object_unref (self); } static void send_open_cb (GObject *source_object, GAsyncResult *result, gpointer user_data); static void recv_open_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source_object); GError *error = NULL; WockyLLConnector *self = user_data; WockyLLConnectorPrivate *priv = self->priv; gchar *from = NULL; if (!wocky_xmpp_connection_recv_open_finish (connection, result, NULL, &from, NULL, NULL, NULL, &error)) { DEBUG ("Failed to receive stream open: %s", error->message); g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR, WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_RECEIVE_STANZA, "Failed to receive stream open: %s", error->message); g_clear_error (&error); g_simple_async_result_complete (priv->simple); g_object_unref (priv->simple); priv->simple = NULL; return; } if (!priv->incoming) { WockyStanza *features; DEBUG ("connected, sending stream features but not " "expecting anything back"); features = wocky_stanza_new ("features", WOCKY_XMPP_NS_STREAM); wocky_xmpp_connection_send_stanza_async (connection, features, NULL, features_sent_cb, self); g_object_unref (features); } else { DEBUG ("stream opened from %s, sending open back", from != NULL ? from : ""); wocky_xmpp_connection_send_open_async (connection, from, priv->local_jid, "1.0", NULL, NULL, priv->cancellable, send_open_cb, self); } priv->from = from; } static void send_open_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source_object); GError *error = NULL; WockyLLConnector *self = user_data; WockyLLConnectorPrivate *priv = self->priv; if (!wocky_xmpp_connection_send_open_finish (connection, result, &error)) { DEBUG ("Failed to send stream open: %s", error->message); g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR, WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_SEND_STANZA, "Failed to send stream open: %s", error->message); g_clear_error (&error); g_simple_async_result_complete (priv->simple); g_object_unref (priv->simple); priv->simple = NULL; return; } if (!priv->incoming) { DEBUG ("successfully sent stream open, now waiting for other side to too"); wocky_xmpp_connection_recv_open_async (connection, priv->cancellable, recv_open_cb, self); } else { WockyStanza *features; DEBUG ("connected, sending stream features but not " "expecting anything back"); features = wocky_stanza_new ("features", WOCKY_XMPP_NS_STREAM); wocky_xmpp_connection_send_stanza_async (connection, features, NULL, features_sent_cb, self); g_object_unref (features); } } /** * wocky_ll_connector_finish: * @connector: a #WockyLLConnector * @result: a #GAsyncResult * @from: a location to store the remote user's JID, or %NULL * @error: a location to save errors to, or %NULL to ignore * * Gets the result of the asynchronous connect request. * * Returns: the connected #WockyXmppConnection which should be freed * using g_object_unref(), or %NULL on error */ WockyXmppConnection * wocky_ll_connector_finish (WockyLLConnector *self, GAsyncResult *result, gchar **from, GError **error) { WockyLLConnectorPrivate *priv = self->priv; if (g_async_initable_new_finish (G_ASYNC_INITABLE (self), result, error) == NULL) return NULL; if (from != NULL) *from = g_strdup (priv->from); return g_object_ref (priv->connection); } static void wocky_ll_connector_init_async (GAsyncInitable *initable, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyLLConnector *self = WOCKY_LL_CONNECTOR (initable); WockyLLConnectorPrivate *priv = self->priv; g_return_if_fail (priv->simple == NULL); priv->simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_ll_connector_init_async); if (cancellable != NULL) priv->cancellable = g_object_ref (cancellable); if (priv->incoming) { /* we need to wait for stream open first */ wocky_xmpp_connection_recv_open_async (priv->connection, priv->cancellable, recv_open_cb, self); } else { /* we need to send stream open first */ wocky_xmpp_connection_send_open_async (priv->connection, priv->remote_jid, priv->local_jid, "1.0", NULL, NULL, priv->cancellable, send_open_cb, self); } } static gboolean wocky_ll_connector_init_finish (GAsyncInitable *initable, GAsyncResult *result, GError **error) { WockyLLConnector *self = WOCKY_LL_CONNECTOR (initable); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); WockyLLConnectorPrivate *priv = self->priv; g_return_val_if_fail (priv->simple == simple, FALSE); if (g_simple_async_result_propagate_error (simple, error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_ll_connector_init_async), FALSE); return TRUE; } static void initable_iface_init (gpointer g_iface, gpointer data) { GAsyncInitableIface *iface = g_iface; iface->init_async = wocky_ll_connector_init_async; iface->init_finish = wocky_ll_connector_init_finish; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-session.h0000644000175000017500000000532412050202021023147 0ustar00wjtwjt00000000000000/* * wocky-session.h - Header for WockySession * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_SESSION_H__ #define __WOCKY_SESSION_H__ #include #include "wocky-types.h" #include "wocky-xmpp-connection.h" #include "wocky-porter.h" #include "wocky-contact-factory.h" G_BEGIN_DECLS /** * WockySessionClass: * * The class of a #WockySession. */ typedef struct _WockySessionClass WockySessionClass; typedef struct _WockySessionPrivate WockySessionPrivate; struct _WockySessionClass { /**/ GObjectClass parent_class; }; struct _WockySession { /**/ GObject parent; WockySessionPrivate *priv; }; GType wocky_session_get_type (void); #define WOCKY_TYPE_SESSION \ (wocky_session_get_type ()) #define WOCKY_SESSION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_SESSION, \ WockySession)) #define WOCKY_SESSION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_SESSION, \ WockySessionClass)) #define WOCKY_IS_SESSION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_SESSION)) #define WOCKY_IS_SESSION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_SESSION)) #define WOCKY_SESSION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_SESSION, \ WockySessionClass)) WockySession * wocky_session_new_ll (const gchar *full_jid); WockySession * wocky_session_new_with_connection (WockyXmppConnection *conn, const gchar *full_jid); void wocky_session_start (WockySession *session); WockyPorter * wocky_session_get_porter (WockySession *session); WockyContactFactory * wocky_session_get_contact_factory (WockySession *session); void wocky_session_set_jid (WockySession *session, const gchar *jid); const gchar *wocky_session_get_jid (WockySession *session); G_END_DECLS #endif /* #ifndef __WOCKY_SESSION_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-meta-porter.h0000644000175000017500000000630612050202021023724 0ustar00wjtwjt00000000000000/* * wocky-meta-porter.h - Header for WockyMetaPorter * Copyright (C) 2011 Collabora Ltd. * * 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 tubesplied 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_META_PORTER_H__ #define __WOCKY_META_PORTER_H__ #include #include #include "wocky-contact-factory.h" #include "wocky-porter.h" G_BEGIN_DECLS typedef struct _WockyMetaPorter WockyMetaPorter; typedef struct _WockyMetaPorterClass WockyMetaPorterClass; typedef struct _WockyMetaPorterPrivate WockyMetaPorterPrivate; typedef enum { WOCKY_META_PORTER_ERROR_NO_CONTACT_ADDRESS, WOCKY_META_PORTER_ERROR_FAILED_TO_CLOSE, } WockyMetaPorterError; GQuark wocky_meta_porter_error_quark (void); #define WOCKY_META_PORTER_ERROR (wocky_meta_porter_error_quark ()) struct _WockyMetaPorterClass { GObjectClass parent_class; }; struct _WockyMetaPorter { GObject parent; WockyMetaPorterPrivate *priv; }; GType wocky_meta_porter_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_META_PORTER \ (wocky_meta_porter_get_type ()) #define WOCKY_META_PORTER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_META_PORTER, \ WockyMetaPorter)) #define WOCKY_META_PORTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_META_PORTER, \ WockyMetaPorterClass)) #define WOCKY_IS_META_PORTER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_META_PORTER)) #define WOCKY_IS_META_PORTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_META_PORTER)) #define WOCKY_META_PORTER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_META_PORTER, \ WockyMetaPorterClass)) WockyPorter * wocky_meta_porter_new (const gchar *jid, WockyContactFactory *contact_factory); guint16 wocky_meta_porter_get_port (WockyMetaPorter *porter); void wocky_meta_porter_hold (WockyMetaPorter *porter, WockyContact *contact); void wocky_meta_porter_unhold (WockyMetaPorter *porter, WockyContact *contact); void wocky_meta_porter_set_jid (WockyMetaPorter *porter, const gchar *jid); void wocky_meta_porter_open_async (WockyMetaPorter *porter, WockyLLContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_meta_porter_open_finish (WockyMetaPorter *porter, GAsyncResult *result, GError **error); GSocketConnection * wocky_meta_porter_borrow_connection (WockyMetaPorter *porter, WockyLLContact *contact); #endif /* #ifndef __WOCKY_META_PORTER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-utils.h0000644000175000017500000001225712050202021022627 0ustar00wjtwjt00000000000000/* * wocky-utils.h - Header for Wocky utility functions * Copyright © 2007–2010 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_UTILS_H__ #define __WOCKY_UTILS_H__ #include #include G_BEGIN_DECLS gboolean wocky_strdiff (const gchar *left, const gchar *right); gchar * wocky_normalise_jid (const gchar *jid); gboolean wocky_decode_jid (const gchar *jid, gchar **node, gchar **domain, gchar **resource); gchar *wocky_compose_jid (const gchar *node, const gchar *domain, const gchar *resource); GValue *wocky_g_value_slice_new (GType type); GValue *wocky_g_value_slice_new_boolean (gboolean b); GValue *wocky_g_value_slice_new_int (gint n); GValue *wocky_g_value_slice_new_int64 (gint64 n); GValue *wocky_g_value_slice_new_uint (guint n); GValue *wocky_g_value_slice_new_uint64 (guint64 n); GValue *wocky_g_value_slice_new_double (double d); GValue *wocky_g_value_slice_new_string (const gchar *string); GValue *wocky_g_value_slice_new_static_string (const gchar *string); GValue *wocky_g_value_slice_new_take_string (gchar *string); GValue *wocky_g_value_slice_new_boxed (GType type, gconstpointer p); GValue *wocky_g_value_slice_new_static_boxed (GType type, gconstpointer p); GValue *wocky_g_value_slice_new_take_boxed (GType type, gpointer p); void wocky_g_value_slice_free (GValue *value); GValue *wocky_g_value_slice_dup (const GValue *value); gboolean wocky_enum_from_nick (GType enum_type, const gchar *nick, gint *value); const gchar *wocky_enum_to_nick (GType enum_type, gint value); gchar *wocky_absolutize_path (const gchar *path); GList *wocky_list_deep_copy (GBoxedCopyFunc copy, const GList *items); GString *wocky_g_string_dup (const GString *str); void wocky_g_string_free (GString *str); /* These are macros so that the critical message raised by * g_return_val_if_fail() contains the actual function name and tag. They * magically returns from the function rather than evaluating to a boolean * because doing the latter in macros seems to be a GCC extension. I could * probably rewrite them using , and ?: but... * * They should really be in GLib, but let's experiment here first. */ #define wocky_implement_finish_void(source, tag) \ G_STMT_START { \ GSimpleAsyncResult *_simple; \ _simple = (GSimpleAsyncResult *) result; \ if (g_simple_async_result_propagate_error ( \ _simple, error)) \ return FALSE; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT (source), (tag)), \ FALSE); \ return TRUE; \ } G_STMT_END #define wocky_implement_finish_copy_pointer(source, tag, copy_func, \ out_param) \ G_STMT_START { \ GSimpleAsyncResult *_simple; \ _simple = (GSimpleAsyncResult *) result; \ if (g_simple_async_result_propagate_error (_simple, error)) \ return FALSE; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT (source), (tag)), \ FALSE); \ if ((out_param) != NULL) \ { \ gpointer _p = g_simple_async_result_get_op_res_gpointer (_simple); \ if (_p != NULL) \ *(out_param) = (copy_func) (_p); \ else \ *(out_param) = NULL; \ } \ return TRUE; \ } G_STMT_END #define wocky_implement_finish_return_copy_pointer(source, tag, \ copy_func) \ G_STMT_START { \ GSimpleAsyncResult *_simple; \ gpointer _p; \ _simple = (GSimpleAsyncResult *) result; \ if (g_simple_async_result_propagate_error (_simple, error)) \ return NULL; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT (source), (tag)), \ NULL); \ _p = g_simple_async_result_get_op_res_gpointer (_simple); \ if (_p != NULL) \ return (copy_func) (_p); \ return NULL; \ } G_STMT_END #define wocky_implement_finish_return_pointer(source, tag) \ G_STMT_START { \ GSimpleAsyncResult *_simple; \ _simple = (GSimpleAsyncResult *) result; \ if (g_simple_async_result_propagate_error (_simple, error)) \ return NULL; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT (source), tag), \ NULL); \ return g_simple_async_result_get_op_res_gpointer (_simple); \ } G_STMT_END G_END_DECLS #endif /* #ifndef __WOCKY_UTILS_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-c2s-porter.h0000644000175000017500000000727712050202021023475 0ustar00wjtwjt00000000000000/* * wocky-c2s-porter.h - Header for WockyC2SPorter * Copyright (C) 2009-2011 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_C2S_PORTER_H__ #define __WOCKY_C2S_PORTER_H__ #include #include "wocky-xmpp-connection.h" #include "wocky-stanza.h" #include "wocky-porter.h" G_BEGIN_DECLS /** * WockyC2SPorter: * * An object providing a convenient wrapper around a #WockyXmppConnection to * send and receive stanzas. */ typedef struct _WockyC2SPorter WockyC2SPorter; /** * WockyC2SPorterClass: * * The class of a #WockyC2SPorter. */ typedef struct _WockyC2SPorterClass WockyC2SPorterClass; typedef struct _WockyC2SPorterPrivate WockyC2SPorterPrivate; struct _WockyC2SPorterClass { /**/ GObjectClass parent_class; }; struct _WockyC2SPorter { /**/ GObject parent; WockyC2SPorterPrivate *priv; }; GType wocky_c2s_porter_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_C2S_PORTER \ (wocky_c2s_porter_get_type ()) #define WOCKY_C2S_PORTER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_C2S_PORTER, \ WockyC2SPorter)) #define WOCKY_C2S_PORTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_C2S_PORTER, \ WockyC2SPorterClass)) #define WOCKY_IS_C2S_PORTER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_C2S_PORTER)) #define WOCKY_IS_C2S_PORTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_C2S_PORTER)) #define WOCKY_C2S_PORTER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_C2S_PORTER, \ WockyC2SPorterClass)) WockyPorter * wocky_c2s_porter_new (WockyXmppConnection *connection, const gchar *full_jid); void wocky_c2s_porter_send_whitespace_ping_async ( WockyC2SPorter *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_c2s_porter_send_whitespace_ping_finish ( WockyC2SPorter *self, GAsyncResult *result, GError **error); guint wocky_c2s_porter_register_handler_from_server_va ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap); guint wocky_c2s_porter_register_handler_from_server_by_stanza ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza); guint wocky_c2s_porter_register_handler_from_server ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) G_GNUC_NULL_TERMINATED; void wocky_c2s_porter_enable_power_saving_mode (WockyC2SPorter *porter, gboolean enable); G_END_DECLS #endif /* #ifndef __WOCKY_C2S_PORTER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-roster.h0000644000175000017500000001411012050202021022773 0ustar00wjtwjt00000000000000/* * wocky-roster.h - Header for WockyRoster * Copyright (C) 2009 Collabora Ltd. * @author Jonny Lamb * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_ROSTER_H__ #define __WOCKY_ROSTER_H__ #include #include "wocky-types.h" #include "wocky-xmpp-connection.h" G_BEGIN_DECLS typedef struct _WockyRoster WockyRoster; /** * WockyRosterClass: * * The class of a #WockyRoster. */ typedef struct _WockyRosterClass WockyRosterClass; typedef struct _WockyRosterPrivate WockyRosterPrivate; GQuark wocky_roster_error_quark (void); struct _WockyRosterClass { /**/ GObjectClass parent_class; }; struct _WockyRoster { /**/ GObject parent; WockyRosterPrivate *priv; }; GType wocky_roster_get_type (void); #define WOCKY_TYPE_ROSTER \ (wocky_roster_get_type ()) #define WOCKY_ROSTER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_ROSTER, \ WockyRoster)) #define WOCKY_ROSTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_ROSTER, \ WockyRosterClass)) #define WOCKY_IS_ROSTER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_ROSTER)) #define WOCKY_IS_ROSTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_ROSTER)) #define WOCKY_ROSTER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_ROSTER, \ WockyRosterClass)) /** * WockyRosterSubscriptionFlags: * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE: the user does not have a * subscription to the contact's presence information, and the * contact does not have a subscription to the user's presence * information * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO: the user has a subscription to * the contact's presence information, but the contact does not have * a subscription to the user's presence information * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM: the contact has a * subscription to the user's presence information, but the user * does not have a subscription to the contact's presence * information * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH: both the user and the contact * have subscriptions to each other's presence information * * Flags to document the subscription information between contacts. */ typedef enum { WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE = 0, WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO = 1 << 0, WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM = 1 << 1, WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH = WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO | WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM, /*< private >*/ LAST_WOCKY_ROSTER_SUBSCRIPTION_TYPE = WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH } WockyRosterSubscriptionFlags; /** * WockyRosterError: * @WOCKY_ROSTER_ERROR_INVALID_STANZA : received an invalid roster stanza * from the server * @WOCKY_ROSTER_ERROR_NOT_IN_ROSTER : the contact is not in the roster * * The #WockyRosterError specific errors. */ typedef enum { WOCKY_ROSTER_ERROR_INVALID_STANZA, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER, } WockyRosterError; GQuark wocky_roster_error_quark (void); /** * WOCKY_ROSTER_ERROR: * * Get access to the error quark of the roster. */ #define WOCKY_ROSTER_ERROR (wocky_roster_error_quark ()) WockyRoster * wocky_roster_new (WockySession *session); void wocky_roster_fetch_roster_async (WockyRoster *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_fetch_roster_finish (WockyRoster *self, GAsyncResult *result, GError **error); WockyBareContact * wocky_roster_get_contact (WockyRoster *self, const gchar *jid); GSList * wocky_roster_get_all_contacts (WockyRoster *self); void wocky_roster_add_contact_async (WockyRoster *self, const gchar *jid, const gchar *name, const gchar * const * groups, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_add_contact_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_remove_contact_async (WockyRoster *self, WockyBareContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_remove_contact_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_change_contact_name_async (WockyRoster *self, WockyBareContact *contact, const gchar *name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_change_contact_name_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_contact_add_group_async (WockyRoster *self, WockyBareContact *contact, const gchar *group, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_contact_add_group_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_contact_remove_group_async (WockyRoster *self, WockyBareContact *contact, const gchar *group, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_contact_remove_group_finish (WockyRoster *self, GAsyncResult *result, GError **error); /* For debugging only */ const gchar * wocky_roster_subscription_to_string ( WockyRosterSubscriptionFlags subscription); G_END_DECLS #endif /* #ifndef __WOCKY_ROSTER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-connection.c0000644000175000017500000010142712050202021024601 0ustar00wjtwjt00000000000000/* * wocky-xmpp-connection.c - Source for WockyXmppConnection * Copyright (C) 2006-2009 Collabora Ltd. * @author Sjoerd Simons * * 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 */ /** * SECTION: wocky-xmpp-connection * @title: WockyXmppConnection * @short_description: Low-level XMPP connection. * * Sends and receives #WockyStanzas from an underlying GIOStream. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-xmpp-connection.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-signals-marshal.h" #include "wocky-xmpp-reader.h" #include "wocky-xmpp-writer.h" #include "wocky-stanza.h" #include "wocky-utils.h" #define BUFFER_SIZE 1024 static void _xmpp_connection_received_data (GObject *source, GAsyncResult *result, gpointer user_data); static void wocky_xmpp_connection_do_write (WockyXmppConnection *self); G_DEFINE_TYPE(WockyXmppConnection, wocky_xmpp_connection, G_TYPE_OBJECT) /* properties */ enum { PROP_BASE_STREAM = 1, }; /* private structure */ struct _WockyXmppConnectionPrivate { gboolean dispose_has_run; WockyXmppReader *reader; WockyXmppWriter *writer; GIOStream *stream; /* received open from the input stream */ gboolean input_open; GSimpleAsyncResult *input_result; GCancellable *input_cancellable; /* sent open to the output stream */ gboolean output_open; /* sent close to the output stream */ gboolean output_closed; GSimpleAsyncResult *output_result; GCancellable *output_cancellable; guint8 input_buffer[BUFFER_SIZE]; const guint8 *output_buffer; gsize offset; gsize length; GSimpleAsyncResult *force_close_result; guint last_id; }; /** * wocky_xmpp_connection_error_quark * * Get the error quark used by the connection. * * Returns: the quark for connection errors. */ GQuark wocky_xmpp_connection_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-xmpp-connection-error"); return quark; } static void wocky_xmpp_connection_init (WockyXmppConnection *self) { WockyXmppConnectionPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_XMPP_CONNECTION, WockyXmppConnectionPrivate); priv = self->priv; priv->writer = wocky_xmpp_writer_new (); priv->reader = wocky_xmpp_reader_new (); } static void wocky_xmpp_connection_dispose (GObject *object); static void wocky_xmpp_connection_finalize (GObject *object); static void wocky_xmpp_connection_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (object); WockyXmppConnectionPrivate *priv = connection->priv; switch (property_id) { case PROP_BASE_STREAM: g_assert (priv->stream == NULL); priv->stream = g_value_dup_object (value); g_assert (priv->stream != NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_xmpp_connection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (object); WockyXmppConnectionPrivate *priv = connection->priv; switch (property_id) { case PROP_BASE_STREAM: g_value_set_object (value, priv->stream); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_xmpp_connection_class_init ( WockyXmppConnectionClass *wocky_xmpp_connection_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_xmpp_connection_class); GParamSpec *spec; g_type_class_add_private (wocky_xmpp_connection_class, sizeof (WockyXmppConnectionPrivate)); object_class->set_property = wocky_xmpp_connection_set_property; object_class->get_property = wocky_xmpp_connection_get_property; object_class->dispose = wocky_xmpp_connection_dispose; object_class->finalize = wocky_xmpp_connection_finalize; spec = g_param_spec_object ("base-stream", "base stream", "the stream that the XMPP connection communicates over", G_TYPE_IO_STREAM, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BASE_STREAM, spec); } void wocky_xmpp_connection_dispose (GObject *object) { WockyXmppConnection *self = WOCKY_XMPP_CONNECTION (object); WockyXmppConnectionPrivate *priv = self->priv; if (priv->dispose_has_run) return; g_warn_if_fail (priv->input_result == NULL); g_warn_if_fail (priv->output_result == NULL); priv->dispose_has_run = TRUE; if (priv->stream != NULL) { g_object_unref (priv->stream); priv->stream = NULL; } if (priv->reader != NULL) { g_object_unref (priv->reader); priv->reader = NULL; } if (priv->writer != NULL) { g_object_unref (priv->writer); priv->writer = NULL; } if (priv->output_result != NULL) { g_object_unref (priv->output_result); priv->output_result = NULL; } if (priv->output_cancellable != NULL) { g_object_unref (priv->output_cancellable); priv->output_cancellable = NULL; } if (priv->input_result != NULL) { g_object_unref (priv->input_result); priv->input_result = NULL; } if (priv->input_cancellable != NULL) { g_object_unref (priv->input_cancellable); priv->input_cancellable = NULL; } /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_xmpp_connection_parent_class)->dispose) G_OBJECT_CLASS (wocky_xmpp_connection_parent_class)->dispose (object); } void wocky_xmpp_connection_finalize (GObject *object) { G_OBJECT_CLASS (wocky_xmpp_connection_parent_class)->finalize (object); } /** * wocky_xmpp_connection_new: * @stream: GIOStream over wich all the data will be sent/received. * * Convenience function to create a new #WockyXmppConnection. * * Returns: a new #WockyXmppConnection. */ WockyXmppConnection * wocky_xmpp_connection_new (GIOStream *stream) { WockyXmppConnection * result; result = g_object_new (WOCKY_TYPE_XMPP_CONNECTION, "base-stream", stream, NULL); return result; } static void wocky_xmpp_connection_write_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *self = WOCKY_XMPP_CONNECTION (user_data); WockyXmppConnectionPrivate *priv = self->priv; gssize written; GError *error = NULL; written = g_output_stream_write_finish (G_OUTPUT_STREAM (source), res, &error); if (G_UNLIKELY (written < 0)) { g_simple_async_result_set_from_error (priv->output_result, error); g_error_free (error); goto finished; } if (G_UNLIKELY (written == 0)) { g_simple_async_result_set_error (priv->output_result, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_EOS, "Connection got disconnected" ); goto finished; } priv->offset += written; if (priv->offset == priv->length) { /* Done ! */ goto finished; } wocky_xmpp_connection_do_write (self); return; finished: { GSimpleAsyncResult *r = priv->output_result; if (priv->output_cancellable != NULL) g_object_unref (priv->output_cancellable); priv->output_cancellable = NULL; priv->output_result = NULL; g_simple_async_result_complete (r); g_object_unref (r); } } static void wocky_xmpp_connection_do_write (WockyXmppConnection *self) { WockyXmppConnectionPrivate *priv = self->priv; GOutputStream *output = g_io_stream_get_output_stream (priv->stream); g_assert (priv->length != priv->offset); g_output_stream_write_async (output, priv->output_buffer + priv->offset, priv->length - priv->offset, G_PRIORITY_DEFAULT, priv->output_cancellable, wocky_xmpp_connection_write_cb, self); } /** * wocky_xmpp_connection_send_open_async: * @connection: a #WockyXmppConnection. * @to: destination in the XMPP opening (can be NULL). * @from: sender in the XMPP opening (can be NULL). * @version: XMPP version sent (can be NULL). * @lang: language sent (can be NULL). * @id: XMPP Stream ID, if any, or NULL * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous sending of an XMPP stream opening over the stream. When * the operation is finished @callback will be called. You can then call * wocky_xmpp_connection_send_open_finish() to get the result of the operation. * */ void wocky_xmpp_connection_send_open_async (WockyXmppConnection *connection, const gchar *to, const gchar *from, const gchar *version, const gchar *lang, const gchar *id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->output_result != NULL)) goto pending; if (G_UNLIKELY (priv->output_closed)) goto is_closed; if (G_UNLIKELY (priv->output_open)) goto is_open; g_assert (priv->output_result == NULL); g_assert (priv->output_cancellable == NULL); priv->output_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_send_open_async); if (cancellable != NULL) priv->output_cancellable = g_object_ref (cancellable); priv->offset = 0; priv->length = 0; wocky_xmpp_writer_stream_open (priv->writer, to, from, version, lang, id, &priv->output_buffer, &priv->length); wocky_xmpp_connection_do_write (connection); return; pending: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another send operation is pending"); return; is_open: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN, "Connection is already open"); return; is_closed: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, "Connection is closed for sending"); return; } /** * wocky_xmpp_connection_send_open_finish: * @connection: a #WockyXmppConnection. * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes sending a stream opening. * * Returns: TRUE if the opening was succesfully sent, FALSE on error. */ gboolean wocky_xmpp_connection_send_open_finish (WockyXmppConnection *connection, GAsyncResult *result, GError **error) { WockyXmppConnectionPrivate *priv = connection->priv; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), wocky_xmpp_connection_send_open_async), FALSE); priv->output_open = TRUE; return TRUE; } static void wocky_xmpp_connection_do_read (WockyXmppConnection *self) { WockyXmppConnectionPrivate *priv = self->priv; GInputStream *input = g_io_stream_get_input_stream (priv->stream); g_input_stream_read_async (input, priv->input_buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, priv->input_cancellable, _xmpp_connection_received_data, self); } static gboolean input_is_closed (WockyXmppConnection *self) { WockyXmppConnectionPrivate *priv = self->priv; return wocky_xmpp_reader_get_state (priv->reader) > WOCKY_XMPP_READER_STATE_OPENED; } static void _xmpp_connection_received_data (GObject *source, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *self = WOCKY_XMPP_CONNECTION (user_data); WockyXmppConnectionPrivate *priv = self->priv; gssize size; GError *error = NULL; size = g_input_stream_read_finish (G_INPUT_STREAM (source), result, &error); if (G_UNLIKELY (size < 0)) { g_simple_async_result_set_from_error (priv->input_result, error); g_error_free (error); goto finished; } if (G_UNLIKELY (size == 0)) { g_simple_async_result_set_error (priv->input_result, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_EOS, "Connection got disconnected" ); goto finished; } wocky_xmpp_reader_push (priv->reader, priv->input_buffer, size); if (!priv->input_open && (wocky_xmpp_reader_get_state (priv->reader) == WOCKY_XMPP_READER_STATE_OPENED)) { /* stream was opened, can only be as a result of calling recv_open */ priv->input_open = TRUE; goto finished; } if (wocky_xmpp_reader_peek_stanza (priv->reader) != NULL) goto finished; switch (wocky_xmpp_reader_get_state (priv->reader)) { case WOCKY_XMPP_READER_STATE_CLOSED: case WOCKY_XMPP_READER_STATE_ERROR: goto finished; default: /* Need more data */ break; } wocky_xmpp_connection_do_read (self); return; finished: { GSimpleAsyncResult *r = priv->input_result; if (priv->input_cancellable != NULL) g_object_unref (priv->input_cancellable); priv->input_cancellable = NULL; priv->input_result = NULL; g_simple_async_result_complete (r); g_object_unref (r); } } /** * wocky_xmpp_connection_recv_open_async: * @connection: a #WockyXmppConnection. * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous receiving of an XMPP stream opening over the stream. * When the operation is finished @callback will be called. You can then call * wocky_xmpp_connection_recv_open_finish() to get the result of the operation. * */ void wocky_xmpp_connection_recv_open_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->input_result != NULL)) goto pending; if (G_UNLIKELY (input_is_closed (connection))) goto is_closed; if (G_UNLIKELY (priv->input_open)) goto is_open; g_assert (priv->input_result == NULL); g_assert (priv->input_cancellable == NULL); priv->input_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_recv_open_async); if (cancellable != NULL) priv->input_cancellable = g_object_ref (cancellable); wocky_xmpp_connection_do_read (connection); return; pending: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another receive operation is pending"); return; is_closed: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, "Connection is closed for receiving"); return; is_open: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN, "Connection has already received open"); return; } /** * wocky_xmpp_connection_recv_open_finish: * @connection: a #WockyXmppConnection. * @result: a GAsyncResult. * @to: Optional location to store the to attribute in the XMPP open stanza * will be stored (free after usage). * @from: Optional location to store the from attribute in the XMPP open stanza * will be stored (free after usage). * @version: Optional location to store the version attribute in the XMPP open * stanza will be stored (free after usage). * @lang: Optional location to store the lang attribute in the XMPP open * stanza will be stored (free after usage). * @id: Optional location to store the Session ID of the XMPP stream * (free after usage) * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes receiving a stream opening. * * Returns: TRUE if the opening was succesfully received, FALSE on error. */ gboolean wocky_xmpp_connection_recv_open_finish (WockyXmppConnection *connection, GAsyncResult *result, gchar **to, gchar **from, gchar **version, gchar **lang, gchar **id, GError **error) { WockyXmppConnectionPrivate *priv; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), wocky_xmpp_connection_recv_open_async), FALSE); priv = connection->priv; priv->input_open = TRUE; if (to != NULL) g_object_get (priv->reader, "to", to, NULL); if (from != NULL) g_object_get (priv->reader, "from", from, NULL); if (version != NULL) g_object_get (priv->reader, "version", version, NULL); if (lang != NULL) g_object_get (priv->reader, "lang", lang, NULL); if (id != NULL) g_object_get (priv->reader, "id", id, NULL); return TRUE; } /** * wocky_xmpp_connection_send_stanza_async: * @connection: a #WockyXmppConnection * @stanza: #WockyStanza to send. * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous sending of a #WockyStanza. When the operation is * finished @callback will be called. You can then call * wocky_xmpp_connection_send_stanza_finish() to get the result of * the operation. * * Can only be called after wocky_xmpp_connection_send_open_async has finished * its operation. * */ void wocky_xmpp_connection_send_stanza_async (WockyXmppConnection *connection, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->output_result != NULL)) goto pending; if (G_UNLIKELY (!priv->output_open)) goto not_open; if (G_UNLIKELY (priv->output_closed)) goto is_closed; g_assert (!priv->output_closed); g_assert (priv->output_result == NULL); g_assert (priv->output_cancellable == NULL); priv->output_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_send_stanza_async); if (cancellable != NULL) priv->output_cancellable = g_object_ref (cancellable); priv->offset = 0; priv->length = 0; wocky_xmpp_writer_write_stanza (priv->writer, stanza, &priv->output_buffer, &priv->length); wocky_xmpp_connection_do_write (connection); return; pending: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another send operation is pending"); return; not_open: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN, "Connections hasn't been opened for sending"); return; is_closed: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, "Connections has been closed for sending"); return; } /** * wocky_xmpp_connection_send_stanza_finish: * @connection: a #WockyXmppConnection. * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes sending a stanza. * * Returns: TRUE if the stanza was succesfully sent, FALSE on error. */ gboolean wocky_xmpp_connection_send_stanza_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), wocky_xmpp_connection_send_stanza_async), FALSE); return TRUE; } /** * wocky_xmpp_connection_recv_stanza_async: * @connection: a #WockyXmppConnection * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Asynchronous receive a #WockyStanza. When the operation is * finished @callback will be called. You can then call * wocky_xmpp_connection_recv_stanza_finish() to get the result of * the operation. * * Can only be called after wocky_xmpp_connection_recv_open_async has finished * its operation. */ void wocky_xmpp_connection_recv_stanza_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->input_result != NULL)) goto pending; if (G_UNLIKELY (!priv->input_open)) goto not_open; if (G_UNLIKELY (input_is_closed (connection))) goto is_closed; g_assert (priv->input_result == NULL); g_assert (priv->input_cancellable == NULL); priv->input_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_recv_stanza_async); /* There is already a stanza waiting, no need to read */ if (wocky_xmpp_reader_peek_stanza (priv->reader) != NULL) { GSimpleAsyncResult *r = priv->input_result; priv->input_result = NULL; g_simple_async_result_complete_in_idle (r); g_object_unref (r); return; } if (cancellable != NULL) priv->input_cancellable = g_object_ref (cancellable); wocky_xmpp_connection_do_read (connection); return; pending: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another receive operation is pending"); return; not_open: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN, "Connection hasn't been opened for reading stanzas"); return; is_closed: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, "Connection has been closed for reading stanzas"); return; } /** * wocky_xmpp_connection_recv_stanza_finish: * @connection: a #WockyXmppConnection. * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes receiving a stanza * * Returns: A #WockyStanza or NULL on error (unref after usage) */ WockyStanza * wocky_xmpp_connection_recv_stanza_finish (WockyXmppConnection *connection, GAsyncResult *result, GError **error) { WockyXmppConnectionPrivate *priv; WockyStanza *stanza = NULL; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), wocky_xmpp_connection_recv_stanza_async), NULL); priv = connection->priv; switch (wocky_xmpp_reader_get_state (priv->reader)) { case WOCKY_XMPP_READER_STATE_INITIAL: g_assert_not_reached (); break; case WOCKY_XMPP_READER_STATE_OPENED: stanza = wocky_xmpp_reader_pop_stanza (priv->reader); break; case WOCKY_XMPP_READER_STATE_CLOSED: g_set_error_literal (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED, "Stream closed"); break; case WOCKY_XMPP_READER_STATE_ERROR: { GError *e /* default coding style checker */; e = wocky_xmpp_reader_get_error (priv->reader); g_assert (e != NULL); g_propagate_error (error, e); break; } } return stanza; } /** * wocky_xmpp_connection_send_close_async: * @connection: a #WockyXmppConnection. * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous sending of an XMPP stream close. When * the operation is finished @callback will be called. You can then call * wocky_xmpp_connection_send_close_finish() to get the result of the * operation. * * Can only be called after wocky_xmpp_connection_send_open_async has finished * its operation. * */ void wocky_xmpp_connection_send_close_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->output_result != NULL)) goto pending; if (G_UNLIKELY (priv->output_closed)) goto is_closed; if (G_UNLIKELY (!priv->output_open)) goto not_open; g_assert (priv->output_result == NULL); g_assert (priv->output_cancellable == NULL); priv->output_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_send_close_async); if (cancellable != NULL) priv->output_cancellable = g_object_ref (cancellable); priv->offset = 0; priv->length = 0; wocky_xmpp_writer_stream_close (priv->writer, &priv->output_buffer, &priv->length); wocky_xmpp_connection_do_write (connection); return; pending: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another send operation is pending"); return; not_open: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN, "Connections hasn't been opened for sending"); return; is_closed: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, "Connections has been closed sending"); return; } /** * wocky_xmpp_connection_send_close_finish: * @connection: a #WockyXmppConnection. * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes send the xmpp stream close. * * Returns: TRUE on success or FALSE on error. */ gboolean wocky_xmpp_connection_send_close_finish (WockyXmppConnection *connection, GAsyncResult *result, GError **error) { WockyXmppConnectionPrivate *priv = connection->priv; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), wocky_xmpp_connection_send_close_async), FALSE); priv->output_closed = TRUE; return TRUE; } /** * wocky_xmpp_connection_send_whitespace_ping_async: * @connection: a #WockyXmppConnection * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous sending of a whitespace ping. When the operation is * finished @callback will be called. You can then call * wocky_xmpp_connection_send_whitespace_ping_finish() to get the result of * the operation. * * Can only be called after wocky_xmpp_connection_send_open_async has finished * its operation. */ void wocky_xmpp_connection_send_whitespace_ping_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->output_result != NULL)) goto pending; if (G_UNLIKELY (!priv->output_open)) goto not_open; if (G_UNLIKELY (priv->output_closed)) goto is_closed; g_assert (!priv->output_closed); g_assert (priv->output_result == NULL); g_assert (priv->output_cancellable == NULL); priv->output_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_send_whitespace_ping_async); if (cancellable != NULL) priv->output_cancellable = g_object_ref (cancellable); priv->output_buffer = (guint8 *) " "; priv->length = 1; priv->offset = 0; wocky_xmpp_connection_do_write (connection); return; pending: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another send operation is pending"); return; not_open: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN, "Connections hasn't been opened for sending"); return; is_closed: g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, "Connections has been closed for sending"); return; } /** * wocky_xmpp_connection_send_whitespace_ping_finish: * @connection: a #WockyXmppConnection. * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes sending a whitespace ping. * * Returns: TRUE if the ping was succesfully sent, FALSE on error. */ gboolean wocky_xmpp_connection_send_whitespace_ping_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error) { wocky_implement_finish_void (connection, wocky_xmpp_connection_send_whitespace_ping_async); } /** * wocky_xmpp_connection_reset: * @connection: a #WockyXmppConnection. * * Reset the XMPP Connection. After the reset the connection is back in its * initial state (as if wocky_xmpp_connection_send_open_async() and * wocky_xmpp_connection_recv_open_async() were never called). */ void wocky_xmpp_connection_reset (WockyXmppConnection *connection) { WockyXmppConnectionPrivate *priv = connection->priv; /* There can't be any pending operations */ g_assert (priv->input_result == NULL); g_assert (priv->output_result == NULL); priv->input_open = FALSE; priv->output_open = FALSE; priv->output_closed = FALSE; wocky_xmpp_reader_reset (priv->reader); } /** * wocky_xmpp_connection_new_id: * @self: a #WockyXmppConnection. * * Returns: A short unique string for usage as the id attribute on a stanza * (free after usage). */ gchar * wocky_xmpp_connection_new_id (WockyXmppConnection *self) { WockyXmppConnectionPrivate *priv = self->priv; GTimeVal tv; glong val; g_get_current_time (&tv); val = (tv.tv_sec & tv.tv_usec) + priv->last_id++; return g_strdup_printf ("%ld%ld", val, tv.tv_usec); } static void stream_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (user_data); WockyXmppConnectionPrivate *priv = connection->priv; GError *error = NULL; GSimpleAsyncResult *r = priv->force_close_result; if (!g_io_stream_close_finish (G_IO_STREAM (source), res, &error)) { g_simple_async_result_set_from_error (priv->force_close_result, error); g_error_free (error); } priv->force_close_result = NULL; g_simple_async_result_complete (r); g_object_unref (r); } void wocky_xmpp_connection_force_close_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyXmppConnectionPrivate *priv = connection->priv; if (G_UNLIKELY (priv->force_close_result != NULL)) { g_simple_async_report_error_in_idle (G_OBJECT (connection), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another close operation is pending"); return; } priv->force_close_result = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, wocky_xmpp_connection_force_close_async); g_io_stream_close_async (priv->stream, G_PRIORITY_HIGH, cancellable, stream_close_cb, connection); } gboolean wocky_xmpp_connection_force_close_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), wocky_xmpp_connection_force_close_async), FALSE); return TRUE; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-utils.c0000644000175000017500000004426312051446215022644 0ustar00wjtwjt00000000000000/* * wocky-utils.c - Code for Wocky utility functions * Copyright © 2007–2010 Collabora Ltd. * * 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 * * wocky_g_value_slice_* functions have been copied from telepathy-glib's * util.c file: * Copyright (C) 2006-2007 Collabora Ltd. * Copyright (C) 2006-2007 Nokia Corporation */ #include "wocky-utils.h" #include #include /** * wocky_strdiff: * @left: The first string to compare (may be NULL) * @right: The second string to compare (may be NULL) * * Return %TRUE if the given strings are different. Unlike #strcmp this * function will handle null pointers, treating them as distinct from any * string. * * Returns: %FALSE if @left and @right are both %NULL, or if * neither is %NULL and both have the same contents; %TRUE otherwise */ gboolean wocky_strdiff (const gchar *left, const gchar *right) { return g_strcmp0 (left, right) != 0; } static gboolean validate_jid_node (const gchar *node) { /* See RFC 3920 §3.3. */ const gchar *c; for (c = node; *c; c++) if (strchr ("\"&'/:<>@", *c)) /* RFC 3920 §A.5 */ return FALSE; return TRUE; } static gboolean validate_jid_domain (const gchar *domain) { /* XXX: This doesn't do proper validation: it checks the character * range for ASCII characters, but lets through any non-ASCII characters. See * the ifdef-d out tests in wocky-jid-validation-test.c for examples of * erroneously accepted JIDs. In theory, we check that the domain is a * well-formed IDN or an IPv4/IPv6 address literal. * * See RFC 3920 §3.2. */ const gchar *c; for (c = domain; *c; c++) { if ((unsigned char) *c >= 0x7F) continue; if (!g_ascii_isalnum (*c) && !strchr (":-.", *c)) return FALSE; } return TRUE; } /** * wocky_decode_jid: * @jid: a JID * @node: address to which return the username/room part of the JID * @domain: address to which return the server/service part of the JID * @resource: address to which return the resource/nick part of the JID * * If the JID is valid, returns TRUE and sets the caller's * node/domain/resource pointers if they are not NULL. The node and resource * pointers will be set to NULL if the respective part is not present in the * JID. The node and domain are lower-cased because the Jabber protocol treats * them case-insensitively. * * XXX: Do nodeprep/resourceprep and length checking. * * See RFC 3920 §3. * * Returns: %TRUE if the JID is valid */ gboolean wocky_decode_jid (const gchar *jid, gchar **node, gchar **domain, gchar **resource) { char *tmp_jid, *tmp_node, *tmp_domain, *tmp_resource; g_assert (jid != NULL); if (node != NULL) *node = NULL; if (domain != NULL) *domain = NULL; if (resource != NULL) *resource = NULL; /* Take a local copy so we don't modify the caller's string. */ tmp_jid = g_strdup (jid); /* If there's a slash in tmp_jid, split it in two and take the second part as * the resource. */ tmp_resource = strchr (tmp_jid, '/'); if (tmp_resource != NULL) { *tmp_resource = '\0'; tmp_resource++; } else { tmp_resource = NULL; } /* If there's an at sign in tmp_jid, split it in two and set tmp_node and * tmp_domain appropriately. Otherwise, tmp_node is NULL and the domain is * the whole string. */ tmp_domain = strchr (tmp_jid, '@'); if (tmp_domain != NULL) { *tmp_domain = '\0'; tmp_domain++; tmp_node = tmp_jid; } else { tmp_domain = tmp_jid; tmp_node = NULL; } /* Domain must be non-empty and not contain invalid characters. If the node * or the resource exist, they must be non-empty and the node must not * contain invalid characters. */ if (*tmp_domain == '\0' || !validate_jid_domain (tmp_domain) || (tmp_node != NULL && (*tmp_node == '\0' || !validate_jid_node (tmp_node))) || (tmp_resource != NULL && *tmp_resource == '\0')) { g_free (tmp_jid); return FALSE; } /* the server must be stored after we find the resource, in case we * truncated a resource from it */ if (domain != NULL) *domain = g_utf8_strdown (tmp_domain, -1); /* store the username if the user provided a pointer */ if (tmp_node != NULL && node != NULL) *node = g_utf8_strdown (tmp_node, -1); /* store the resource if the user provided a pointer */ if (tmp_resource != NULL && resource != NULL) *resource = g_strdup (tmp_resource); /* free our working copy */ g_free (tmp_jid); return TRUE; } /** * wocky_normalise_jid: * @jid: a JID * * Returns: a normalised JID, using the same rules as wocky_decode_jid(), * or %NULL if the JID could not be sensibly decoded. * This value should be freed when you are done with it. */ gchar * wocky_normalise_jid (const gchar *jid) { gchar *node = NULL; gchar *domain = NULL; gchar *resource = NULL; gchar *rval = NULL; if (jid == NULL) return NULL; if (!wocky_decode_jid (jid, &node, &domain, &resource)) return NULL; rval = wocky_compose_jid (node, domain, resource); g_free (node); g_free (domain); g_free (resource); return rval; } static inline gsize strlen0 (const gchar *s) { return (s == NULL ? 0 : strlen (s)); } /** * wocky_compose_jid: * @node: the node part of a JID, possibly empty or %NULL * @domain: the non-%NULL domain part of a JID * @resource: the resource part of a JID, possibly empty or %NULL * * Composes a JID from its parts. If @node is empty or %NULL, the '@' * separator is also omitted; if @resource is empty or %NULL, the '/' separator * is also omitted. * * Returns: a JID constructed from @node, @domain and @resource */ gchar * wocky_compose_jid (const gchar *node, const gchar *domain, const gchar *resource) { GString *normal = NULL; normal = g_string_sized_new (strlen0 (node) + strlen0 (domain) + strlen0 (resource) + 2); if (node != NULL && *node != '\0') g_string_printf (normal, "%s@%s", node, domain); else g_string_printf (normal, "%s", domain); if (resource != NULL && *resource != '\0' && normal->len > 0) g_string_append_printf (normal, "/%s", resource); return g_string_free (normal, FALSE); } /** * wocky_g_value_slice_new: * @type: The type desired for the new GValue * * Slice-allocate an empty #GValue. wocky_g_value_slice_new_boolean() and similar * functions are likely to be more convenient to use for the types supported. * * Returns: a newly allocated, newly initialized #GValue, to be freed with * wocky_g_value_slice_free() or g_slice_free(). * Since: 0.5.14 */ GValue * wocky_g_value_slice_new (GType type) { GValue *ret = g_slice_new0 (GValue); g_value_init (ret, type); return ret; } /** * wocky_g_value_slice_new_boolean: * @b: a boolean value * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_BOOLEAN with value @b, to be freed with * wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_boolean (gboolean b) { GValue *v = wocky_g_value_slice_new (G_TYPE_BOOLEAN); g_value_set_boolean (v, b); return v; } /** * wocky_g_value_slice_new_int: * @n: an integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_INT with value @n, to be freed with * wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_int (gint n) { GValue *v = wocky_g_value_slice_new (G_TYPE_INT); g_value_set_int (v, n); return v; } /** * wocky_g_value_slice_new_int64: * @n: a 64-bit integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_INT64 with value @n, to be freed with * wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_int64 (gint64 n) { GValue *v = wocky_g_value_slice_new (G_TYPE_INT64); g_value_set_int64 (v, n); return v; } /** * wocky_g_value_slice_new_uint: * @n: an unsigned integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_UINT with value @n, to be freed with * wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_uint (guint n) { GValue *v = wocky_g_value_slice_new (G_TYPE_UINT); g_value_set_uint (v, n); return v; } /** * wocky_g_value_slice_new_uint64: * @n: a 64-bit unsigned integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_UINT64 with value @n, to be freed with * wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_uint64 (guint64 n) { GValue *v = wocky_g_value_slice_new (G_TYPE_UINT64); g_value_set_uint64 (v, n); return v; } /** * wocky_g_value_slice_new_double: * @d: a number * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_DOUBLE with value @n, to be freed with * wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_double (double n) { GValue *v = wocky_g_value_slice_new (G_TYPE_DOUBLE); g_value_set_double (v, n); return v; } /** * wocky_g_value_slice_new_string: * @string: a string to be copied into the value * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_STRING whose value is a copy of @string, * to be freed with wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_string (const gchar *string) { GValue *v = wocky_g_value_slice_new (G_TYPE_STRING); g_value_set_string (v, string); return v; } /** * wocky_g_value_slice_new_static_string: * @string: a static string which must remain valid forever, to be pointed to * by the value * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_STRING whose value is @string, * to be freed with wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_static_string (const gchar *string) { GValue *v = wocky_g_value_slice_new (G_TYPE_STRING); g_value_set_static_string (v, string); return v; } /** * wocky_g_value_slice_new_take_string: * @string: a string which will be freed with g_free() by the returned #GValue * (the caller must own it before calling this function, but no longer owns * it after this function returns) * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_STRING whose value is @string, * to be freed with wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_take_string (gchar *string) { GValue *v = wocky_g_value_slice_new (G_TYPE_STRING); g_value_take_string (v, string); return v; } /** * wocky_g_value_slice_new_boxed: * @type: a boxed type * @p: a pointer of type @type, which will be copied * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type @type whose value is a copy of @p, * to be freed with wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_boxed (GType type, gconstpointer p) { GValue *v; g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); v = wocky_g_value_slice_new (type); g_value_set_boxed (v, p); return v; } /** * wocky_g_value_slice_new_static_boxed: * @type: a boxed type * @p: a pointer of type @type, which must remain valid forever * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type @type whose value is @p, * to be freed with wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_static_boxed (GType type, gconstpointer p) { GValue *v; g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); v = wocky_g_value_slice_new (type); g_value_set_static_boxed (v, p); return v; } /** * wocky_g_value_slice_new_take_boxed: * @type: a boxed type * @p: a pointer of type @type which will be freed with g_boxed_free() by the * returned #GValue (the caller must own it before calling this function, but * no longer owns it after this function returns) * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type @type whose value is @p, * to be freed with wocky_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * wocky_g_value_slice_new_take_boxed (GType type, gpointer p) { GValue *v; g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); v = wocky_g_value_slice_new (type); g_value_take_boxed (v, p); return v; } /** * wocky_g_value_slice_free: * @value: A GValue which was allocated with the g_slice API * * Unset and free a slice-allocated GValue. * * (GDestroyNotify) wocky_g_value_slice_free can be used * as a destructor for values in a #GHashTable, for example. */ void wocky_g_value_slice_free (GValue *value) { g_value_unset (value); g_slice_free (GValue, value); } /** * wocky_g_value_slice_dup: * @value: A GValue * * * * Returns: a newly allocated copy of @value, to be freed with * wocky_g_value_slice_free() or g_slice_free(). * Since: 0.5.14 */ GValue * wocky_g_value_slice_dup (const GValue *value) { GValue *ret = wocky_g_value_slice_new (G_VALUE_TYPE (value)); g_value_copy (value, ret); return ret; } /** * wocky_enum_from_nick: * @enum_type: the GType of a subtype of GEnum * @nick: a non-%NULL string purporting to be the nickname of a value of * @enum_type * @value: the address at which to store the value of @enum_type corresponding * to @nick if this functions returns %TRUE; if this function returns * %FALSE, this variable will be left untouched. * * * * Returns: %TRUE if @nick is a member of @enum_type, or %FALSE otherwise */ gboolean wocky_enum_from_nick ( GType enum_type, const gchar *nick, gint *value) { GEnumClass *klass = g_type_class_ref (enum_type); GEnumValue *enum_value; g_return_val_if_fail (klass != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); enum_value = g_enum_get_value_by_nick (klass, nick); g_type_class_unref (klass); if (enum_value != NULL) { *value = enum_value->value; return TRUE; } else { return FALSE; } } /** * wocky_enum_to_nick: * @enum_type: the GType of a subtype of GEnum * @value: a value of @enum_type * * * * Returns: the nickname of @value, or %NULL if it is not, in fact, a value of * @enum_type */ const gchar * wocky_enum_to_nick ( GType enum_type, gint value) { GEnumClass *klass = g_type_class_ref (enum_type); GEnumValue *enum_value; g_return_val_if_fail (klass != NULL, NULL); enum_value = g_enum_get_value (klass, value); g_type_class_unref (klass); if (enum_value != NULL) return enum_value->value_nick; else return NULL; } /** * wocky_absolutize_path: * @path: an absolute or relative path * * Return an absolute form of @path. This cleans up duplicate slashes, "." or * ".." path segments, etc., and prepends g_get_current_dir() if necessary, but * does not necessarily resolve symlinks. * * Returns: an absolute path which must be freed with g_free(), or possibly * %NULL for invalid filenames */ gchar * wocky_absolutize_path (const gchar *path) { GFile *cwd, *absolute; gchar *cwd_str, *ret; cwd_str = g_get_current_dir (); cwd = g_file_new_for_path (cwd_str); g_free (cwd_str); if (cwd == NULL) return NULL; absolute = g_file_resolve_relative_path (cwd, path); if (absolute == NULL) { g_object_unref (cwd); return NULL; } ret = g_file_get_path (absolute); /* possibly NULL */ g_object_unref (cwd); g_object_unref (absolute); return ret; } GList * wocky_list_deep_copy (GBoxedCopyFunc copy, const GList *items) { GList *ret = NULL; const GList *l; g_return_val_if_fail (copy != NULL, NULL); for (l = items; l != NULL; l = l->next) ret = g_list_prepend (ret, copy (l->data)); return g_list_reverse (ret); } GString * wocky_g_string_dup (const GString *str) { if (str == NULL) return NULL; return g_string_new_len (str->str, str->len); } void wocky_g_string_free (GString *str) { if (str != NULL) g_string_free (str, TRUE); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls.h0000644000175000017500000001121012051446215022275 0ustar00wjtwjt00000000000000/* * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima * Copyright © 2008-2009 Codethink Limited * Copyright © 2009 Collabora Limited * * This program 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 of the licence or (at * your option) any later version. * * Authors: Ryan Lortie * Christian Kellner * Samuel Cormier-Iijima * Vivek Dasmohapatra * * Upstream: git://git.gnome.org/gnio * Branched at: 42b00d143fcf644880456d06d3a20b6e990a7fa3 * "toss out everything that moved to glib" * * This file follows the orignal coding style from upstream, not house * collabora style: It is a copy of unmerged gnio TLS support with the * 'g' prefixes changes to 'wocky' and server-side TLS support added. * */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _wocky_tls_h_ #define _wocky_tls_h_ #include #include "wocky-tls-enumtypes.h" #define WOCKY_TYPE_TLS_CONNECTION (wocky_tls_connection_get_type ()) #define WOCKY_TYPE_TLS_SESSION (wocky_tls_session_get_type ()) #define WOCKY_TLS_SESSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TLS_SESSION, WockyTLSSession)) #define WOCKY_TLS_CONNECTION(inst)(G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TLS_CONNECTION, \ WockyTLSConnection)) typedef struct _WockyTLSConnection WockyTLSConnection; typedef struct _WockyTLSSession WockyTLSSession; typedef enum { WOCKY_TLS_VERIFY_STRICT = 0, WOCKY_TLS_VERIFY_NORMAL, WOCKY_TLS_VERIFY_LENIENT, } WockyTLSVerificationLevel; GQuark wocky_tls_cert_error_quark (void); #define WOCKY_TLS_CERT_ERROR (wocky_tls_cert_error_quark ()) GQuark wocky_tls_error_quark (void); #define WOCKY_TLS_ERROR (wocky_tls_error_quark ()) typedef enum { WOCKY_TLS_CERT_OK = 0, WOCKY_TLS_CERT_INVALID, WOCKY_TLS_CERT_NAME_MISMATCH, WOCKY_TLS_CERT_REVOKED, WOCKY_TLS_CERT_SIGNER_UNKNOWN, WOCKY_TLS_CERT_SIGNER_UNAUTHORISED, WOCKY_TLS_CERT_INSECURE, WOCKY_TLS_CERT_NOT_ACTIVE, WOCKY_TLS_CERT_EXPIRED, WOCKY_TLS_CERT_NO_CERTIFICATE, WOCKY_TLS_CERT_MAYBE_DOS, WOCKY_TLS_CERT_INTERNAL_ERROR, WOCKY_TLS_CERT_UNKNOWN_ERROR, } WockyTLSCertStatus; typedef enum { WOCKY_TLS_CERT_TYPE_NONE = 0, WOCKY_TLS_CERT_TYPE_X509, WOCKY_TLS_CERT_TYPE_OPENPGP, } WockyTLSCertType; GType wocky_tls_connection_get_type (void); GType wocky_tls_session_get_type (void); int wocky_tls_session_verify_peer (WockyTLSSession *session, const gchar *peername, GStrv extra_identities, WockyTLSVerificationLevel level, WockyTLSCertStatus *status); GPtrArray *wocky_tls_session_get_peers_certificate (WockyTLSSession *session, WockyTLSCertType *type); WockyTLSConnection *wocky_tls_session_handshake (WockyTLSSession *session, GCancellable *cancellable, GError **error); void wocky_tls_session_handshake_async (WockyTLSSession *session, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyTLSConnection * wocky_tls_session_handshake_finish (WockyTLSSession *session, GAsyncResult *result, GError **error); void wocky_tls_session_add_ca (WockyTLSSession *session, const gchar *path); void wocky_tls_session_add_crl (WockyTLSSession *session, const gchar *path); WockyTLSSession *wocky_tls_session_new (GIOStream *stream); WockyTLSSession *wocky_tls_session_server_new (GIOStream *stream, guint dhbits, const gchar* key, const gchar* cert); #endif /* _wocky_tls_h_ */ /* this file is "borrowed" from an unmerged gnio feature: */ /* Local Variables: */ /* c-file-style: "gnu" */ /* End: */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls-handler.c0000644000175000017500000002415112051446215023713 0ustar00wjtwjt00000000000000/* * wocky-tls-handler.c - Source for WockyTLSHandler * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * @author Vivek Dasmohapatra * * 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 */ #include #include "wocky-tls-handler.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_TLS #include "wocky-debug-internal.h" static void real_verify_async (WockyTLSHandler *self, WockyTLSSession *tls_session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data); static gboolean real_verify_finish (WockyTLSHandler *self, GAsyncResult *result, GError **error); G_DEFINE_TYPE (WockyTLSHandler, wocky_tls_handler, G_TYPE_OBJECT) enum { PROP_TLS_INSECURE_OK = 1, }; struct _WockyTLSHandlerPrivate { gboolean ignore_ssl_errors; GSList *cas; GSList *crls; }; static void wocky_tls_handler_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyTLSHandler *self = WOCKY_TLS_HANDLER (object); switch (property_id) { case PROP_TLS_INSECURE_OK: g_value_set_boolean (value, self->priv->ignore_ssl_errors); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_tls_handler_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyTLSHandler *self = WOCKY_TLS_HANDLER (object); switch (property_id) { case PROP_TLS_INSECURE_OK: self->priv->ignore_ssl_errors = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_tls_handler_finalize (GObject *object) { WockyTLSHandler *self = WOCKY_TLS_HANDLER (object); if (self->priv->cas != NULL) { g_slist_foreach (self->priv->cas, (GFunc) g_free, NULL); g_slist_free (self->priv->cas); } if (self->priv->crls != NULL) { g_slist_foreach (self->priv->crls, (GFunc) g_free, NULL); g_slist_free (self->priv->crls); } G_OBJECT_CLASS (wocky_tls_handler_parent_class)->finalize (object); } static void wocky_tls_handler_class_init (WockyTLSHandlerClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *pspec; g_type_class_add_private (klass, sizeof (WockyTLSHandlerPrivate)); klass->verify_async_func = real_verify_async; klass->verify_finish_func = real_verify_finish; oclass->get_property = wocky_tls_handler_get_property; oclass->set_property = wocky_tls_handler_set_property; oclass->finalize = wocky_tls_handler_finalize; /** * WockyTLSHandler:ignore-ssl-errors: * * Whether to ignore recoverable SSL errors (certificate * insecurity/expiry etc). */ pspec = g_param_spec_boolean ("ignore-ssl-errors", "ignore-ssl-errors", "Whether recoverable TLS errors should be ignored", TRUE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_TLS_INSECURE_OK, pspec); } static void wocky_tls_handler_init (WockyTLSHandler *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_TLS_HANDLER, WockyTLSHandlerPrivate); } static void real_verify_async (WockyTLSHandler *self, WockyTLSSession *tls_session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; glong flags = WOCKY_TLS_VERIFY_NORMAL; WockyTLSCertStatus status = WOCKY_TLS_CERT_UNKNOWN_ERROR; const gchar *verify_peername = NULL; GStrv verify_extra_identities = NULL; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_tls_handler_verify_async); /* When ignore_ssl_errors is true, don't check the peername. Otherwise: * - Under legacy SSL, the connect hostname is the preferred peername; * - Under STARTTLS, we check the domain regardless of the connect server. */ if (self->priv->ignore_ssl_errors) { flags = WOCKY_TLS_VERIFY_LENIENT; } else { verify_peername = peername; verify_extra_identities = extra_identities; } DEBUG ("Verifying certificate (peername: %s)", (verify_peername == NULL) ? "-" : verify_peername); wocky_tls_session_verify_peer (tls_session, verify_peername, verify_extra_identities, flags, &status); if (status != WOCKY_TLS_CERT_OK) { gboolean ok_when_lenient = FALSE; const gchar *msg = NULL; switch (status) { case WOCKY_TLS_CERT_NAME_MISMATCH: msg = "SSL Certificate does not match name '%s'"; break; case WOCKY_TLS_CERT_REVOKED: msg = "SSL Certificate for %s has been revoked"; break; case WOCKY_TLS_CERT_SIGNER_UNKNOWN: ok_when_lenient = TRUE; msg = "SSL Certificate for %s is insecure (unknown signer)"; break; case WOCKY_TLS_CERT_SIGNER_UNAUTHORISED: msg = "SSL Certificate for %s is insecure (unauthorised signer)"; break; case WOCKY_TLS_CERT_INSECURE: msg = "SSL Certificate for %s is insecure (weak crypto)"; break; case WOCKY_TLS_CERT_NOT_ACTIVE: msg = "SSL Certificate for %s not active yet"; break; case WOCKY_TLS_CERT_EXPIRED: msg = "SSL Certificate for %s expired"; break; case WOCKY_TLS_CERT_INVALID: msg = "SSL Certificate for %s invalid"; ok_when_lenient = TRUE; break; /* Handle UNKNOWN_ERROR and any other unexpected values equivalently */ case WOCKY_TLS_CERT_UNKNOWN_ERROR: default: msg = "SSL Certificate Verification Error for %s"; } if (!(self->priv->ignore_ssl_errors && ok_when_lenient)) { GError *cert_error = NULL; cert_error = g_error_new (WOCKY_TLS_CERT_ERROR, status, msg, peername); g_simple_async_result_set_from_error (result, cert_error); g_error_free (cert_error); g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } else { gchar *err; err = g_strdup_printf (msg, peername); DEBUG ("Cert error: '%s', but ignore-ssl-errors is set", err); g_free (err); } } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static gboolean real_verify_finish (WockyTLSHandler *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_tls_handler_verify_async); } void wocky_tls_handler_verify_async (WockyTLSHandler *self, WockyTLSSession *session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data) { WockyTLSHandlerClass *klass = WOCKY_TLS_HANDLER_GET_CLASS (self); klass->verify_async_func (self, session, peername, extra_identities, callback, user_data); } gboolean wocky_tls_handler_verify_finish (WockyTLSHandler *self, GAsyncResult *res, GError **error) { WockyTLSHandlerClass *klass = WOCKY_TLS_HANDLER_GET_CLASS (self); return klass->verify_finish_func (self, res, error); } WockyTLSHandler * wocky_tls_handler_new (gboolean ignore_ssl_errors) { return g_object_new (WOCKY_TYPE_TLS_HANDLER, "ignore-ssl-errors", ignore_ssl_errors, NULL); } /** * wocky_tls_handler_add_ca: * @self: a #WockyTLSHandler instance * @path: a path to a directory or file containing PEM encoded CA certificates * * Sensible default paths (under Debian derived distributions) are: * * * for gnutls: /etc/ssl/certs/ca-certificates.crt * * for openssl: /etc/ssl/certs * * Certificates my also be found under /usr/share/ca-certificates/... * if the user wishes to pick and choose which CAs to use. * * Returns: a #gboolean indicating whether the path was resolved. * Does not indicate that there was actually a file or directory there * or that any CAs were actually found. The CAs won't actually be loaded * until just before the TLS session setup is attempted. */ gboolean wocky_tls_handler_add_ca (WockyTLSHandler *self, const gchar *path) { gchar *abspath = wocky_absolutize_path (path); if (abspath != NULL) self->priv->cas = g_slist_prepend (self->priv->cas, abspath); return abspath != NULL; } /** * wocky_tls_handler_add_crl: * @self: a #WockyTLSHandler instance * @path: a path to a directory or file containing PEM encoded CRLs * * This function does not descend subdirectories automatically. * * Returns: a #gboolean indicating whether the path was resolved. * Does not indicate that there was actually a file or directory there * or that any CRLs were actually found. The CRLs won't actually be loaded * until just before the TLS session setup is attempted. */ gboolean wocky_tls_handler_add_crl (WockyTLSHandler *self, const gchar *path) { gchar *abspath = wocky_absolutize_path (path); if (abspath != NULL) self->priv->crls = g_slist_prepend (self->priv->crls, abspath); return abspath != NULL; } GSList * wocky_tls_handler_get_cas (WockyTLSHandler *self) { g_assert (WOCKY_IS_TLS_HANDLER (self)); return self->priv->cas; } GSList * wocky_tls_handler_get_crls (WockyTLSHandler *self) { g_assert (WOCKY_IS_TLS_HANDLER (self)); return self->priv->crls; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-data-form.h0000644000175000017500000001634512051444011023353 0ustar00wjtwjt00000000000000/* * wocky-data-form.h - Header of WockyDataForm * Copyright © 2009–2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef WOCKY_DATA_FORM_H #define WOCKY_DATA_FORM_H #include #include "wocky-data-form-enumtypes.h" #include "wocky-node.h" G_BEGIN_DECLS /** * WockyDataFormFieldType: * @WOCKY_DATA_FORM_FIELD_TYPE_UNSPECIFIED: Unspecified field type * @WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN: Boolean field type * @WOCKY_DATA_FORM_FIELD_TYPE_FIXED: Fixed description field type * @WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN: Hidden field type * @WOCKY_DATA_FORM_FIELD_TYPE_JID_MULTI: A list of multiple JIDs * @WOCKY_DATA_FORM_FIELD_TYPE_JID_SINGLE: A single JID * @WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI: Many options to choose one * or more from * @WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE: Many options to choose one * from * @WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI: Multiple lines of text * @WOCKY_DATA_FORM_FIELD_TYPE_TEXT_PRIVATE: A single line of text * that should be obscured (by, say, asterisks) * @WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE: A single line of text * * Data form field types, as documented in XEP-0004 §3.3. */ /*< prefix=WOCKY_DATA_FORM_FIELD_TYPE >*/ typedef enum { WOCKY_DATA_FORM_FIELD_TYPE_UNSPECIFIED, /*< skip >*/ WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN, WOCKY_DATA_FORM_FIELD_TYPE_FIXED, WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN, WOCKY_DATA_FORM_FIELD_TYPE_JID_MULTI, WOCKY_DATA_FORM_FIELD_TYPE_JID_SINGLE, WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI, WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE, WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI, WOCKY_DATA_FORM_FIELD_TYPE_TEXT_PRIVATE, WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE } WockyDataFormFieldType; /** * WockyDataFormFieldOption: * @label: the option label * @value: the option value * * A single data form field option. */ typedef struct _WockyDataFormFieldOption WockyDataFormFieldOption; struct _WockyDataFormFieldOption { gchar *label; gchar *value; }; /** * WockyDataFormField: * @type: the type of the field * @var: the field name * @label: the label of the field * @desc: the description of the field * @required: %TRUE if the field is required, otherwise %FALSE * @default_value: the default of the field * @value: the field value * @options: a #GSList of #WockyDataFormFieldOptions if @type * if %WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI or * %WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE * * Details about a single data form field in a #WockyDataForm. */ typedef struct _WockyDataFormField WockyDataFormField; struct _WockyDataFormField { WockyDataFormFieldType type; gchar *var; gchar *label; gchar *desc; gboolean required; GValue *default_value; /* a GStrv of actual values so can be {"1", NULL} or {"false", NULL} * for BOOLEAN or {"hi", "there", NULL} TEXT_MULTI, for example. */ gchar **raw_value_contents; GValue *value; /* for LIST_MULTI and LIST_SINGLE only. * List of (WockyDataFormFieldOption *)*/ GSList *options; }; /** * WockyDataForm: * @fields: a #GHashTable of strings to #WockyDataFormFields * @fields_list: a list of #WockyDataFormFields in the order * they have been presented in the form * @results: a list of #GSLists of #WockyDataFormFields * representing one or more sets of result. * * An object that represents an XMPP data form as described in * XEP-0004. */ typedef struct _WockyDataForm WockyDataForm; /** * WockyDataFormClass: * * The class of a #WockyDataForm. */ typedef struct _WockyDataFormClass WockyDataFormClass; typedef struct _WockyDataFormPrivate WockyDataFormPrivate; /** * WockyDataFormError: * @WOCKY_DATA_FORM_ERROR_NOT_FORM: Node is not a data form * @WOCKY_DATA_FORM_ERROR_WRONG_TYPE: Data form is of the wrong type * * #WockyDataForm specific errors. */ typedef enum { WOCKY_DATA_FORM_ERROR_NOT_FORM, WOCKY_DATA_FORM_ERROR_WRONG_TYPE, } WockyDataFormError; GQuark wocky_data_form_error_quark (void); #define WOCKY_DATA_FORM_ERROR (wocky_data_form_error_quark ()) struct _WockyDataFormClass { /**/ GObjectClass parent_class; }; struct _WockyDataForm { /**/ GObject parent; /**/ /* (gchar *) owned by the WockyDataFormField => * borrowed (WockyDataFormField *) */ GHashTable *fields; /* list containing owned (WockyDataFormField *) in the order they * have been presented in the form */ GSList *fields_list; /* list of GSList * of (WockyDataFormField *), representing one or more sets * of results */ GSList *results; /**/ WockyDataFormPrivate *priv; }; GType wocky_data_form_get_type (void); #define WOCKY_TYPE_DATA_FORM \ (wocky_data_form_get_type ()) #define WOCKY_DATA_FORM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_DATA_FORM, \ WockyDataForm)) #define WOCKY_DATA_FORM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_DATA_FORM, \ WockyDataFormClass)) #define WOCKY_IS_DATA_FORM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_DATA_FORM)) #define WOCKY_IS_DATA_FORM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_DATA_FORM)) #define WOCKY_DATA_FORM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_DATA_FORM, \ WockyDataFormClass)) WockyDataForm * wocky_data_form_new_from_form (WockyNode *node, GError **error); WockyDataForm * wocky_data_form_new_from_node (WockyNode *x, GError **error); gboolean wocky_data_form_set_type (WockyDataForm *self, const gchar *form_type); gboolean wocky_data_form_set_boolean (WockyDataForm *self, const gchar *field_name, gboolean field_value, gboolean create_if_missing); gboolean wocky_data_form_set_string (WockyDataForm *self, const gchar *field_name, const gchar *field_value, gboolean create_if_missing); gboolean wocky_data_form_set_strv (WockyDataForm *self, const gchar *field_name, const gchar * const *field_values, gboolean create_if_missing); void wocky_data_form_submit (WockyDataForm *self, WockyNode *node); gboolean wocky_data_form_parse_result (WockyDataForm *self, WockyNode *node, GError **error); const gchar *wocky_data_form_get_title (WockyDataForm *self); const gchar *wocky_data_form_get_instructions (WockyDataForm *self); gint wocky_data_form_field_cmp (const WockyDataFormField *left, const WockyDataFormField *right); void wocky_data_form_add_to_node (WockyDataForm *self, WockyNode *node); G_END_DECLS #endif /* WOCKY_DATA_FORM_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-auth-handler.c0000644000175000017500000001065312051446215024054 0ustar00wjtwjt00000000000000 #include "wocky-auth-handler.h" #include "wocky-auth-registry.h" GType wocky_auth_handler_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; if (g_once_init_enter (&g_define_type_id__volatile)) { const GTypeInfo info = { /* class_size */ sizeof (WockyAuthHandlerIface), /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ NULL, /* instance_size */ 0, /* n_preallocs */ 0, /* instance_init */ NULL, /* value_table */ NULL }; GType g_define_type_id = g_type_register_static ( G_TYPE_INTERFACE, "WockyAuthHandler", &info, 0); g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT); g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); } return g_define_type_id__volatile; } /** * wocky_auth_handler_get_mechanism: * @handler: a handler for a SASL mechanism. * * Returns the name of the SASL mechanism @handler implements. * * Returns: the name of the SASL mechanism @handler implements. */ const gchar * wocky_auth_handler_get_mechanism (WockyAuthHandler *handler) { return WOCKY_AUTH_HANDLER_GET_IFACE (handler)->mechanism; } /** * wocky_auth_handler_is_plain: * @handler: a handler for a SASL mechanism. * * Checks whether @handler sends secrets in plaintext. This may be used to * decide whether to use @handler on an insecure XMPP connection. * * Returns: %TRUE if @handler sends secrets in plaintext. */ gboolean wocky_auth_handler_is_plain (WockyAuthHandler *handler) { return WOCKY_AUTH_HANDLER_GET_IFACE (handler)->plain; } /** * wocky_auth_handler_get_initial_response: * @handler: a handler for a SASL mechanism * @initial_data: (out) (transfer full): initial data to send to the server, if * any * @error: an optional location for a #GError to fill, or %NULL * * Called when authentication begins to fetch the initial data to send to the * server in the <auth/> stanza. * * If this function returns %TRUE, @initial_data will be non-%NULL if @handler * provides an initial response, and %NULL otherwise. * * Returns: %TRUE on success; %FALSE otherwise. */ gboolean wocky_auth_handler_get_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error) { WockyAuthInitialResponseFunc func = WOCKY_AUTH_HANDLER_GET_IFACE (handler)->initial_response_func; g_assert (initial_data != NULL); *initial_data = NULL; if (func == NULL) return TRUE; return func (handler, initial_data, error); } /** * wocky_auth_handler_handle_auth_data: * @handler: a #WockyAuthHandler object * @data: the challenge string * @response: (out) (transfer full): a location to fill with a challenge * response in a #GString * @error: an optional location for a #GError to fill, or %NULL * * Asks @handler to respond to a <challenge/> stanza or a * <success/> with data. On success, @handler will put * response data into @response, Base64-encoding it if appropriate. * * Returns: %TRUE on success, otherwise %FALSE */ gboolean wocky_auth_handler_handle_auth_data ( WockyAuthHandler *handler, const GString *data, GString **response, GError **error) { WockyAuthAuthDataFunc func = WOCKY_AUTH_HANDLER_GET_IFACE (handler)->auth_data_func; g_assert (response != NULL); *response = NULL; if (func == NULL) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server send a challenge, but the mechanism didn't expect any"); return FALSE; } return func (handler, data, response, error); } /** * wocky_auth_handler_handle_success: * @handler: a #WockyAuthHandler object * @error: an optional location for a #GError to fill, or %NULL * * Called when a <success/> stanza is received * during authentication. If no error is returned, then authentication * is considered finished. (Typically, an error is only raised if the * <success/> stanza was received earlier than * expected) * * Returns: %TRUE on success, otherwise %FALSE */ gboolean wocky_auth_handler_handle_success ( WockyAuthHandler *handler, GError **error) { WockyAuthSuccessFunc func = WOCKY_AUTH_HANDLER_GET_IFACE (handler)->success_func; if (func == NULL) return TRUE; else return func (handler, error); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-contact-factory.c0000644000175000017500000003324412050202021024561 0ustar00wjtwjt00000000000000/* * wocky-contact-factory.c - Source for WockyContactFactory * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ /** * SECTION: wocky-contact-factory * @title: WockyContactFactory * @short_description: creates and looks up #WockyContact objects * @include: wocky/wocky-contact-factory.h * * Provides a way to create #WockyContact objects. The objects created * this way are cached by the factory and you can eventually look them up * without creating them again. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-contact-factory.h" #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_ROSTER #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyContactFactory, wocky_contact_factory, G_TYPE_OBJECT) #if 0 /* properties */ enum { }; #endif /* signal enum */ enum { BARE_CONTACT_ADDED, RESOURCE_CONTACT_ADDED, LL_CONTACT_ADDED, LAST_SIGNAL, }; static guint signals[LAST_SIGNAL] = {0}; /* private structure */ struct _WockyContactFactoryPrivate { /* bare JID (gchar *) => weak reffed (WockyBareContact *) */ GHashTable *bare_contacts; /* full JID (gchar *) => weak reffed (WockyResourceContact *) */ GHashTable *resource_contacts; /* JID (gchar *) => weak reffed (WockyLLContact *) */ GHashTable *ll_contacts; gboolean dispose_has_run; }; static void wocky_contact_factory_init (WockyContactFactory *self) { WockyContactFactoryPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_CONTACT_FACTORY, WockyContactFactoryPrivate); priv = self->priv; priv->bare_contacts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); priv->resource_contacts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); priv->ll_contacts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } static void wocky_contact_factory_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_contact_factory_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_contact_factory_constructed (GObject *object) { } static gboolean remove_contact (gpointer key, gpointer value, gpointer contact) { return value == contact; } /* Called when a WockyBareContact, WockyResourceContact or * WockyLLContact has been disposed so we can remove it from his hash * table. */ static void contact_disposed_cb (gpointer user_data, GObject *contact) { GHashTable *table = (GHashTable *) user_data; g_hash_table_foreach_remove (table, remove_contact, contact); } static void wocky_contact_factory_dispose (GObject *object) { WockyContactFactory *self = WOCKY_CONTACT_FACTORY (object); WockyContactFactoryPrivate *priv = self->priv; GHashTableIter iter; gpointer contact; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; g_hash_table_iter_init (&iter, priv->bare_contacts); while (g_hash_table_iter_next (&iter, NULL, &contact)) { g_object_weak_unref (G_OBJECT (contact), contact_disposed_cb, priv->bare_contacts); } g_hash_table_iter_init (&iter, priv->resource_contacts); while (g_hash_table_iter_next (&iter, NULL, &contact)) { g_object_weak_unref (G_OBJECT (contact), contact_disposed_cb, priv->resource_contacts); } g_hash_table_iter_init (&iter, priv->ll_contacts); while (g_hash_table_iter_next (&iter, NULL, &contact)) { g_object_weak_unref (G_OBJECT (contact), contact_disposed_cb, priv->ll_contacts); } if (G_OBJECT_CLASS (wocky_contact_factory_parent_class)->dispose) G_OBJECT_CLASS (wocky_contact_factory_parent_class)->dispose (object); } static void wocky_contact_factory_finalize (GObject *object) { WockyContactFactory *self = WOCKY_CONTACT_FACTORY (object); WockyContactFactoryPrivate *priv = self->priv; g_hash_table_unref (priv->bare_contacts); g_hash_table_unref (priv->resource_contacts); g_hash_table_unref (priv->ll_contacts); G_OBJECT_CLASS (wocky_contact_factory_parent_class)->finalize (object); } static void wocky_contact_factory_class_init ( WockyContactFactoryClass *wocky_contact_factory_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_contact_factory_class); g_type_class_add_private (wocky_contact_factory_class, sizeof (WockyContactFactoryPrivate)); object_class->constructed = wocky_contact_factory_constructed; object_class->set_property = wocky_contact_factory_set_property; object_class->get_property = wocky_contact_factory_get_property; object_class->dispose = wocky_contact_factory_dispose; object_class->finalize = wocky_contact_factory_finalize; signals[BARE_CONTACT_ADDED] = g_signal_new ("bare-contact-added", G_OBJECT_CLASS_TYPE (wocky_contact_factory_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[RESOURCE_CONTACT_ADDED] = g_signal_new ("resource-contact-added", G_OBJECT_CLASS_TYPE (wocky_contact_factory_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[LL_CONTACT_ADDED] = g_signal_new ("ll-contact-added", G_OBJECT_CLASS_TYPE (wocky_contact_factory_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); } /** * wocky_contact_factory_new: * * Convenience function to create a new #WockyContactFactory object. * * Returns: a newly created instance of #WockyContactFactory */ WockyContactFactory * wocky_contact_factory_new (void) { return g_object_new (WOCKY_TYPE_CONTACT_FACTORY, NULL); } /** * wocky_contact_factory_ensure_bare_contact: * @factory: a #WockyContactFactory instance * @bare_jid: the JID of a bare contact * * Returns an instance of #WockyBareContact for @bare_jid. The factory cache * is used, but if the contact is not found in the cache, a new * #WockyBareContact is created and cached for future use. * * Returns: a new reference to a #WockyBareContact instance, which the caller * is expected to release with g_object_unref() after use. */ WockyBareContact * wocky_contact_factory_ensure_bare_contact (WockyContactFactory *self, const gchar *bare_jid) { WockyContactFactoryPrivate *priv = self->priv; WockyBareContact *contact; contact = g_hash_table_lookup (priv->bare_contacts, bare_jid); if (contact != NULL) return g_object_ref (contact); contact = wocky_bare_contact_new (bare_jid); g_object_weak_ref (G_OBJECT (contact), contact_disposed_cb, priv->bare_contacts); g_hash_table_insert (priv->bare_contacts, g_strdup (bare_jid), contact); g_signal_emit (self, signals[BARE_CONTACT_ADDED], 0, contact); return contact; } /** * wocky_contact_factory_lookup_bare_contact: * @factory: a #WockyContactFactory instance * @bare_jid: the JID of a bare contact * * Looks up if there's a #WockyBareContact for @bare_jid in the cache, and * returns it if it's found. * * Returns: a borrowed #WockyBareContact instance (which the caller should * reference with g_object_ref() if it will be kept), or %NULL if the * contact is not found. */ WockyBareContact * wocky_contact_factory_lookup_bare_contact (WockyContactFactory *self, const gchar *bare_jid) { WockyContactFactoryPrivate *priv = self->priv; return g_hash_table_lookup (priv->bare_contacts, bare_jid); } /** * wocky_contact_factory_ensure_resource_contact: * @factory: a #WockyContactFactory instance * @full_jid: the full JID of a resource * * Returns an instance of #WockyResourceContact for @full_jid. * The factory cache is used, but if the resource is not found in the cache, * a new #WockyResourceContact is created and cached for future use. * * Returns: a new reference to a #WockyResourceContact instance, which the * caller is expected to release with g_object_unref() after use. */ WockyResourceContact * wocky_contact_factory_ensure_resource_contact (WockyContactFactory *self, const gchar *full_jid) { WockyContactFactoryPrivate *priv = self->priv; WockyBareContact *bare; WockyResourceContact *contact; gchar *node, *domain, *resource, *bare_jid; contact = g_hash_table_lookup (priv->resource_contacts, full_jid); if (contact != NULL) return g_object_ref (contact); wocky_decode_jid (full_jid, &node, &domain, &resource); bare_jid = g_strdup_printf ("%s@%s", node, domain); bare = wocky_contact_factory_ensure_bare_contact (self, bare_jid); contact = wocky_resource_contact_new (bare, resource); g_object_weak_ref (G_OBJECT (contact), contact_disposed_cb, priv->resource_contacts); g_hash_table_insert (priv->resource_contacts, g_strdup (full_jid), contact); wocky_bare_contact_add_resource (bare, contact); g_free (node); g_free (domain); g_free (resource); g_free (bare_jid); g_object_unref (bare); g_signal_emit (self, signals[RESOURCE_CONTACT_ADDED], 0, contact); return contact; } /** * wocky_contact_factory_lookup_resource_contact: * @factory: a #WockyContactFactory instance * @full_jid: the full JID of a resource * * Looks up if there's a #WockyResourceContact for @full_jid in the cache, and * returns it if it's found. * * Returns: a borrowed #WockyResourceContact instance (which the caller should * reference with g_object_ref() if it will be kept), or %NULL if the * contact is not found. */ WockyResourceContact * wocky_contact_factory_lookup_resource_contact (WockyContactFactory *self, const gchar *full_jid) { WockyContactFactoryPrivate *priv = self->priv; return g_hash_table_lookup (priv->resource_contacts, full_jid); } /** * wocky_contact_factory_ensure_ll_contact: * @factory: a #WockyContactFactory instance * @jid: the JID of a contact * * Returns an instance of #WockyLLContact for @jid. * The factory cache is used, but if the contact is not found in the cache, * a new #WockyLLContact is created and cached for future use. * * Returns: a new reference to a #WockyLLContact instance, which the * caller is expected to release with g_object_unref() after use. */ WockyLLContact * wocky_contact_factory_ensure_ll_contact (WockyContactFactory *self, const gchar *jid) { WockyContactFactoryPrivate *priv = self->priv; WockyLLContact *contact; g_return_val_if_fail (jid != NULL, NULL); contact = g_hash_table_lookup (priv->ll_contacts, jid); if (contact != NULL) return g_object_ref (contact); contact = wocky_ll_contact_new (jid); g_object_weak_ref (G_OBJECT (contact), contact_disposed_cb, priv->ll_contacts); g_hash_table_insert (priv->ll_contacts, g_strdup (jid), contact); g_signal_emit (self, signals[LL_CONTACT_ADDED], 0, contact); return contact; } /** * wocky_contact_factory_lookup_ll_contact: * @factory: a #WockyContactFactory instance * @jid: the JID of a contact * * Looks up if there's a #WockyLLContact for @jid in the cache, and * returns it if it's found. * * Returns: a borrowed #WockyLLContact instance (which the caller should * reference with g_object_ref() if it will be kept), or %NULL if the * contact is not found. */ WockyLLContact * wocky_contact_factory_lookup_ll_contact (WockyContactFactory *self, const gchar *jid) { WockyContactFactoryPrivate *priv = self->priv; return g_hash_table_lookup (priv->ll_contacts, jid); } /** * wocky_contact_factory_add_ll_contact: * @factory: a #WockyContactFactory instance * @contact: a #WockyLLContact * * Adds @contact to the contact factory. */ void wocky_contact_factory_add_ll_contact (WockyContactFactory *self, WockyLLContact *contact) { WockyContactFactoryPrivate *priv = self->priv; gchar *jid = wocky_contact_dup_jid (WOCKY_CONTACT (contact)); WockyLLContact *old_contact = g_hash_table_lookup (priv->ll_contacts, jid); if (old_contact == contact) { g_free (jid); return; } if (old_contact != NULL) { g_object_weak_unref (G_OBJECT (old_contact), contact_disposed_cb, priv->ll_contacts); } g_object_weak_ref (G_OBJECT (contact), contact_disposed_cb, priv->ll_contacts); g_hash_table_insert (priv->ll_contacts, jid, contact); g_signal_emit (self, signals[LL_CONTACT_ADDED], 0, contact); } /** * wocky_contact_factory_get_ll_contacts: * @factory: a #WockyContactFactory instance * * * * Returns: a newly allocated #GList of #WockyLLContacts which * should be freed using g_list_free(). */ GList * wocky_contact_factory_get_ll_contacts (WockyContactFactory *self) { return g_hash_table_get_values (self->priv->ll_contacts); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-sasl-utils.c0000644000175000017500000000617112051446215023600 0ustar00wjtwjt00000000000000/* * wocky-sasl-utils.c - Some sasl helper functions * Copyright (C) 2006-2010 Collabora Ltd. * @author Sjoerd Simons * Copyright (C) 2010 Sjoerd Simons * * 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 */ #include #include "wocky-sasl-utils.h" /* Generate a good random nonce encoded with base64 such that it falls in the * allowable alphabet of various crypto mechanism. */ gchar * sasl_generate_base64_nonce (void) { /* RFC 2831 recommends the the nonce to be either hexadecimal or base64 with * at least 64 bits of entropy */ #define NR 8 guint32 n[NR]; int i; for (i = 0; i < NR; i++) n[i] = g_random_int (); return g_base64_encode ((guchar *) n, sizeof (n)); } GByteArray * sasl_calculate_hmac_sha1 (guint8 *key, gsize key_len, guint8 *text, gsize text_len) { /* Calculate the HMAC keyed hash algorithm as defined in RFC2104, using * SHA-1 as the hash algorithm */ GChecksum *checksum; guint8 k_ipad[WOCKY_SHA1_BLOCK_SIZE]; guint8 k_opad[WOCKY_SHA1_BLOCK_SIZE]; guint8 inner_checksum[WOCKY_SHA1_DIGEST_SIZE]; GByteArray *result; gsize len = WOCKY_SHA1_DIGEST_SIZE, i; memset (k_ipad, 0x36, WOCKY_SHA1_BLOCK_SIZE); memset (k_opad, 0x5c, WOCKY_SHA1_BLOCK_SIZE); if (key_len > WOCKY_SHA1_BLOCK_SIZE) { guchar k[WOCKY_SHA1_DIGEST_SIZE]; checksum = g_checksum_new (G_CHECKSUM_SHA1); g_checksum_update (checksum, key, key_len); g_checksum_get_digest (checksum, k, &len); g_checksum_free (checksum); for (i = 0; i < WOCKY_SHA1_DIGEST_SIZE; i++) { k_ipad[i] ^= k[i]; k_opad[i] ^= k[i]; } } else { for (i = 0; i < key_len; i++) { k_ipad[i] ^= key[i]; k_opad[i] ^= key[i]; } } /* inner checksum */ checksum = g_checksum_new (G_CHECKSUM_SHA1); g_checksum_update (checksum, k_ipad, WOCKY_SHA1_BLOCK_SIZE); g_checksum_update (checksum, text, text_len); g_checksum_get_digest (checksum, inner_checksum, &len); g_checksum_free (checksum); /* outer checksum */ result = g_byte_array_new (); g_byte_array_set_size (result, WOCKY_SHA1_DIGEST_SIZE); checksum = g_checksum_new (G_CHECKSUM_SHA1); g_checksum_update (checksum, k_opad, WOCKY_SHA1_BLOCK_SIZE); g_checksum_update (checksum, inner_checksum, WOCKY_SHA1_DIGEST_SIZE); g_checksum_get_digest (checksum, result->data, &len); g_checksum_free (checksum); return result; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-ll-contact.c0000644000175000017500000001531611720473445023550 0ustar00wjtwjt00000000000000/* * wocky-ll-contact.c - Source for WockyLLContact * Copyright (C) 2011 Collabora Ltd. * * 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 */ /** * SECTION: wocky-ll-contact * @title: WockyLLContact * @short_description: Wrapper around a link-local contact. * @include: wocky/wocky-ll-contact.h * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-ll-contact.h" #include #include "wocky-utils.h" G_DEFINE_TYPE (WockyLLContact, wocky_ll_contact, WOCKY_TYPE_CONTACT) /* properties */ enum { PROP_JID = 1, }; /* signal enum */ enum { LAST_SIGNAL, }; /* private structure */ struct _WockyLLContactPrivate { gboolean dispose_has_run; gchar *jid; }; static void wocky_ll_contact_init (WockyLLContact *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_LL_CONTACT, WockyLLContactPrivate); } static void wocky_ll_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyLLContact *self = WOCKY_LL_CONTACT (object); WockyLLContactPrivate *priv = self->priv; switch (property_id) { case PROP_JID: priv->jid = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_ll_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyLLContact *self = WOCKY_LL_CONTACT (object); WockyLLContactPrivate *priv = self->priv; switch (property_id) { case PROP_JID: g_value_set_string (value, priv->jid); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_ll_contact_constructed (GObject *object) { WockyLLContact *self = WOCKY_LL_CONTACT (object); g_assert (self->priv->jid != NULL); } static void wocky_ll_contact_finalize (GObject *object) { WockyLLContact *self = WOCKY_LL_CONTACT (object); WockyLLContactPrivate *priv = self->priv; if (priv->jid != NULL) g_free (priv->jid); G_OBJECT_CLASS (wocky_ll_contact_parent_class)->finalize (object); } static gchar * ll_contact_dup_jid (WockyContact *contact) { return g_strdup (wocky_ll_contact_get_jid (WOCKY_LL_CONTACT (contact))); } static void wocky_ll_contact_class_init (WockyLLContactClass *wocky_ll_contact_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_ll_contact_class); WockyContactClass *contact_class = WOCKY_CONTACT_CLASS (wocky_ll_contact_class); GParamSpec *spec; g_type_class_add_private (wocky_ll_contact_class, sizeof (WockyLLContactPrivate)); object_class->constructed = wocky_ll_contact_constructed; object_class->set_property = wocky_ll_contact_set_property; object_class->get_property = wocky_ll_contact_get_property; object_class->finalize = wocky_ll_contact_finalize; contact_class->dup_jid = ll_contact_dup_jid; /** * WockyLLContact:jid: * * The contact's link-local JID. */ spec = g_param_spec_string ("jid", "Contact JID", "Contact JID", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_JID, spec); } /** * wocky_ll_contact_new: * @jid: the JID of the contact to create * * Creates a new #WockyLLContact for a given JID. * * Returns: a newly constructed #WockyLLContact */ WockyLLContact * wocky_ll_contact_new (const gchar *jid) { return g_object_new (WOCKY_TYPE_LL_CONTACT, "jid", jid, NULL); } /** * wocky_ll_contact_get_jid: * @contact: a #WockyLLContact instance * * Returns the JID of the contact wrapped by @contact. * * Returns: @contact's JID. */ const gchar * wocky_ll_contact_get_jid (WockyLLContact *contact) { WockyLLContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_LL_CONTACT (contact), NULL); priv = contact->priv; return priv->jid; } /** * wocky_ll_contact_equal: * @a: a #WockyLLContact instance * @b: a #WockyLLContact instance to compare with @a * * Compares whether two #WockyLLContact instances refer to the same * link-local contact. * * Returns: #TRUE if the two contacts match. */ gboolean wocky_ll_contact_equal (WockyLLContact *a, WockyLLContact *b) { if (a == NULL || b == NULL) return FALSE; if (wocky_strdiff (wocky_ll_contact_get_jid (a), wocky_ll_contact_get_jid (b))) return FALSE; return TRUE; } /** * wocky_ll_contact_get_addresses: * @self: a #WockyLLContact * * Returns a #GList of #GInetSocketAddresses which are * advertised by the contact @self as addresses to connect on. Note * that the #GInetSocketAddresses should be unreffed by calling * g_object_unref() on each list member and the list freed using * g_list_free() when the caller is finished. * * Returns: (element-type GInetSocketAddress) (transfer full): a new * #GList of #GInetSocketAddresses. */ GList * wocky_ll_contact_get_addresses (WockyLLContact *self) { WockyLLContactClass *cls; g_return_val_if_fail (WOCKY_IS_LL_CONTACT (self), NULL); cls = WOCKY_LL_CONTACT_GET_CLASS (self); if (cls->get_addresses != NULL) return cls->get_addresses (self); return NULL; } /** * wocky_ll_contact_has_address: * @self: a #WockyLLContact * @address: a #GInetAddress * * Checks whether @address relates to the contact @self. * * Returns: %TRUE if @address relates to the contact @self, otherwise * %FALSE */ gboolean wocky_ll_contact_has_address (WockyLLContact *self, GInetAddress *address) { gchar *s = g_inet_address_to_string (address); gboolean ret = FALSE; GList *l, *addresses = wocky_ll_contact_get_addresses (self); for (l = addresses; l != NULL; l = l->next) { GInetAddress *a = g_inet_socket_address_get_address ( G_INET_SOCKET_ADDRESS (l->data)); gchar *tmp = g_inet_address_to_string (a); if (!wocky_strdiff (tmp, s)) ret = TRUE; g_free (tmp); if (ret) break; } g_list_foreach (addresses, (GFunc) g_object_unref, NULL); g_list_free (addresses); g_free (s); return ret; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-helpers.c0000644000175000017500000003502612051446215024441 0ustar00wjtwjt00000000000000/* * wocky-pubsub-helpers.c — PubSub helper functions * Copyright © 2009–2012 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ #include "wocky-pubsub-helpers.h" #include "wocky-namespaces.h" #include "wocky-pubsub-service.h" #include "wocky-session.h" #include "wocky-xep-0115-capabilities.h" /** * wocky_pubsub_make_event_stanza: * @node: the the name of the pubsub node; may not be %NULL * @from: a JID to use as the 'from' attribute, or %NULL * @item_out: a location to store the item #WockyNode, or %NULL * * Generates a new message stanza to send to other contacts about an * updated PEP node. * * Note that this should only be used in link-local * connections. Regular pubsub consists of making a publish stanza * with wocky_pubsub_make_publish_stanza() and sending it to your own * server. The server will then send the event stanza on to your * contacts who have the appropriate capability. * * Returns: a new #WockyStanza pubsub event stanza; free with g_object_unref() */ WockyStanza * wocky_pubsub_make_event_stanza (const gchar *node, const gchar *from, WockyNode **item_out) { WockyStanza *stanza; WockyNode *message, *event, *items, *item; g_return_val_if_fail (node != NULL, NULL); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_HEADLINE, from, NULL, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", node, '(', "item", ')', ')', ')', NULL); message = wocky_stanza_get_top_node (stanza); event = wocky_node_get_first_child (message); items = wocky_node_get_first_child (event); item = wocky_node_get_first_child (items); if (item_out != NULL) *item_out = item; return stanza; } /** * wocky_pubsub_make_publish_stanza: * @service: the JID of a PubSub service, or %NULL * @node: the name of a node on @service; may not be %NULL * @pubsub_out: address at which to store a pointer to the <pubsub/> node * @publish_out: address at which to store a pointer to the <publish/> * node * @item_out: address at which to store a pointer to the <item/> node * * * * Returns: a new iq[type='set']/pubsub/publish/item stanza */ WockyStanza * wocky_pubsub_make_publish_stanza ( const gchar *service, const gchar *node, WockyNode **pubsub_out, WockyNode **publish_out, WockyNode **item_out) { WockyStanza *stanza; WockyNode *publish, *item; g_return_val_if_fail (node != NULL, NULL); stanza = wocky_pubsub_make_stanza (service, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB, "publish", pubsub_out, &publish); wocky_node_set_attribute (publish, "node", node); item = wocky_node_add_child (publish, "item"); if (publish_out != NULL) *publish_out = publish; if (item_out != NULL) *item_out = item; return stanza; } /** * wocky_pubsub_make_stanza: * @service: the JID of a PubSub service, or %NULL * @pubsub_ns: the namespace for the <pubsub/> node of the stanza * @action_name: the action node to add to <pubsub/> * @pubsub_node: address at which to store a pointer to the <pubsub/> node * @action_node: address at wihch to store a pointer to the <@action/> * node * * * * Returns: a new iq[type='set']/pubsub/@action stanza */ WockyStanza * wocky_pubsub_make_stanza ( const gchar *service, WockyStanzaSubType sub_type, const gchar *pubsub_ns, const gchar *action_name, WockyNode **pubsub_node, WockyNode **action_node) { WockyStanza *stanza; WockyNode *pubsub, *action; g_assert (pubsub_ns != NULL); g_assert (action_name != NULL); stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, sub_type, NULL, service, '(', "pubsub", ':', pubsub_ns, '*', &pubsub, '(', action_name, '*', &action, ')', ')', NULL); if (pubsub_node != NULL) *pubsub_node = pubsub; if (action_node != NULL) *action_node = action; return stanza; } static void send_stanza_to_contact (WockyPorter *porter, WockyContact *contact, WockyStanza *stanza) { WockyStanza *to_send = wocky_stanza_copy (stanza); wocky_stanza_set_to_contact (to_send, contact); wocky_porter_send (porter, to_send); g_object_unref (to_send); } /** * wocky_send_ll_pep_event: * @session: the WockySession to send on * @stanza: the PEP event stanza to send * * Send a PEP event to all link-local contacts interested in receiving it. */ void wocky_send_ll_pep_event (WockySession *session, WockyStanza *stanza) { WockyContactFactory *contact_factory; WockyPorter *porter; WockyLLContact *self_contact; GList *contacts, *l; WockyNode *message, *event, *items; const gchar *pep_node; gchar *node; g_return_if_fail (WOCKY_IS_SESSION (session)); g_return_if_fail (WOCKY_IS_STANZA (stanza)); message = wocky_stanza_get_top_node (stanza); event = wocky_node_get_first_child (message); items = wocky_node_get_first_child (event); pep_node = wocky_node_get_attribute (items, "node"); if (pep_node == NULL) return; node = g_strdup_printf ("%s+notify", pep_node); contact_factory = wocky_session_get_contact_factory (session); porter = wocky_session_get_porter (session); contacts = wocky_contact_factory_get_ll_contacts (contact_factory); for (l = contacts; l != NULL; l = l->next) { WockyXep0115Capabilities *contact; if (!WOCKY_IS_XEP_0115_CAPABILITIES (l->data)) continue; contact = l->data; if (wocky_xep_0115_capabilities_has_feature (contact, node)) send_stanza_to_contact (porter, WOCKY_CONTACT (contact), stanza); } /* now send to self */ self_contact = wocky_contact_factory_ensure_ll_contact (contact_factory, wocky_porter_get_full_jid (porter)); send_stanza_to_contact (porter, WOCKY_CONTACT (self_contact), stanza); g_object_unref (self_contact); g_list_free (contacts); g_free (node); } static gboolean get_pubsub_child_node (WockyStanza *reply, const gchar *pubsub_ns, const gchar *child_name, WockyNodeTree **child_out, GError **error) { WockyNode *n; g_return_val_if_fail (reply != NULL, FALSE); n = wocky_node_get_child_ns ( wocky_stanza_get_top_node (reply), "pubsub", pubsub_ns); if (n == NULL) { g_set_error (error, WOCKY_PUBSUB_SERVICE_ERROR, WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, "Reply doesn't contain <pubsub/> node"); return FALSE; } n = wocky_node_get_child (n, child_name); if (n == NULL) { g_set_error (error, WOCKY_PUBSUB_SERVICE_ERROR, WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, "Reply doesn't contain <%s/> node", child_name); return FALSE; } if (child_out != NULL) *child_out = wocky_node_tree_new_from_node (n); return TRUE; } static gboolean wocky_pubsub_distill_iq_reply_internal (GObject *source, GAsyncResult *res, const gchar *pubsub_ns, const gchar *child_name, gboolean body_optional, WockyNodeTree **child_out, GError **error) { WockyStanza *reply; gboolean ret = FALSE; if (child_out != NULL) *child_out = NULL; /* Superlative news out of the 00:04 to Cambridge: earlier today, an * asynchronous method call announced its plans to bring a node to The * People's Republic of Wocky. */ reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, error); if (reply != NULL) { if (!wocky_stanza_extract_errors (reply, NULL, error, NULL, NULL)) { if (pubsub_ns == NULL) ret = TRUE; else ret = wocky_pubsub_distill_stanza (reply, pubsub_ns, child_name, body_optional, child_out, error); } g_object_unref (reply); } return ret; } /** * wocky_pubsub_distill_stanza: * @result: an iq type='result' * @pubsub_ns: the namespace of the <pubsub/> node expected in this reply * (such as #WOCKY_XMPP_NS_PUBSUB) * @child_name: the name of the child of <pubsub/> expected in this reply * (such as "subscriptions") * @body_optional: If %TRUE, the child being absent is not considered an error * @child_out: location at which to store a reference to the node tree at * @child_name, if it is found, or to be set to %NULL if it is not. * @error: location at which to store an error if the child node is not found * and @body_optional is %FALSE * * Helper function to extract a particular pubsub child node from a reply, if * it is present. If @body_optional is %FALSE, the * <pubsub><@child_name/></pubsub> tree being absent is not * considered an error: @child_out is set to %NULL and the function returns * %TRUE. * * If you are happy to delegate calling wocky_porter_send_iq_finish() and * extracting stanza errors, you would probably be better served by one of * wocky_pubsub_distill_iq_reply() or * wocky_pubsub_distill_ambivalent_iq_reply(). * * Returns: %TRUE if the child was found or was optional; %FALSE with @error * set otherwise. */ gboolean wocky_pubsub_distill_stanza (WockyStanza *result, const gchar *pubsub_ns, const gchar *child_name, gboolean body_optional, WockyNodeTree **child_out, GError **error) { g_return_val_if_fail (pubsub_ns != NULL, FALSE); g_return_val_if_fail (child_name != NULL, FALSE); if (child_out != NULL) *child_out = NULL; /* A force of a thousand function calls will anchor the node to * a resplendent out parameter modeled on the Dear Leader's hand. */ if (get_pubsub_child_node (result, pubsub_ns, child_name, child_out, error)) { /* The People's Great and Harmonious Node Pointer of Peter * Saint-Andre will conclude the most astonishing stanza breakdown * ever witnessed by man. */ return TRUE; } else if (body_optional) { /* “The stanza is perfect. We have already succeeded.” */ g_clear_error (error); return TRUE; } else { /* Meanwhile, the American president today revealed himself to be a * lizard. */ return FALSE; } } /** * wocky_pubsub_distill_iq_reply: * @source: a #WockyPorter instance * @res: a result passed to the callback for wocky_porter_send_iq_async() * @pubsub_ns: the namespace of the <pubsub/> node expected in this reply * (such as #WOCKY_XMPP_NS_PUBSUB), or %NULL if one is not expected * @child_name: the name of the child of <pubsub/> expected in this reply * (such as "subscriptions"); ignored if @pubsub_ns is %NULL * @child_out: location at which to store a reference to the node tree at * @child_name, or %NULL if you don't need it. * @error: location at which to store an error if the call to * wocky_porter_send_iq_async() returned an error, or if the reply was * an error * * Helper function to finish a wocky_porter_send_iq_async() operation * and extract a particular pubsub child from the resulting reply, if needed. * * Returns: %TRUE if the desired pubsub child was found; %FALSE if * sending the IQ failed, the reply had type='error', or the * pubsub child was not found, with @error set appropriately. */ gboolean wocky_pubsub_distill_iq_reply (GObject *source, GAsyncResult *res, const gchar *pubsub_ns, const gchar *child_name, WockyNodeTree **child_out, GError **error) { return wocky_pubsub_distill_iq_reply_internal (source, res, pubsub_ns, child_name, FALSE, child_out, error); } /** * wocky_pubsub_distill_void_iq_reply: * @source: a #WockyPorter instance * @res: a result passed to the callback for wocky_porter_send_iq_async() * @error: location at which to store an error if the call to * wocky_porter_send_iq_async() returned an error, or if the reply was * an error * * Helper function to finish a wocky_porter_send_iq_async() operation where no * pubsub child is expected in the resulting reply. * * Returns: %TRUE if the IQ was a success; %FALSE if * sending the IQ failed or the reply had type='error', * with @error set appropriately. */ gboolean wocky_pubsub_distill_void_iq_reply (GObject *source, GAsyncResult *res, GError **error) { return wocky_pubsub_distill_iq_reply_internal (source, res, NULL, NULL, TRUE, NULL, error); } /** * wocky_pubsub_distill_ambivalent_iq_reply: * @source: a #WockyPorter instance * @res: a result passed to the callback for wocky_porter_send_iq_async() * @pubsub_ns: the namespace of the <pubsub/> node accepted in this reply * (such as #WOCKY_XMPP_NS_PUBSUB) * @child_name: the name of the child of <pubsub/> accepted in this reply * (such as "subscriptions") * @child_out: location at which to store a reference to the node tree at * @child_name, if it is found, or to be set to %NULL if it is not * found * @error: location at which to store an error if the call to * wocky_porter_send_iq_async() returned an error, or if the reply was * an error * * Helper function to finish a wocky_porter_send_iq_async() operation * and extract a particular pubsub child from the resulting reply, if it is * present. This is like wocky_pubsub_distill_iq_reply(), but is ambivalent as * to whether the <pubsub/> structure has to be included. * * Returns: %TRUE if the IQ was a success; %FALSE if * sending the IQ failed or the reply had type='error', * with @error set appropriately. */ gboolean wocky_pubsub_distill_ambivalent_iq_reply (GObject *source, GAsyncResult *res, const gchar *pubsub_ns, const gchar *child_name, WockyNodeTree **child_out, GError **error) { return wocky_pubsub_distill_iq_reply_internal (source, res, pubsub_ns, child_name, TRUE, child_out, error); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-service.c0000644000175000017500000007441312051446215024442 0ustar00wjtwjt00000000000000/* * wocky-pubsub-service.c - WockyPubsubService * Copyright (C) 2009 Collabora Ltd. * * 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 */ #include "wocky-pubsub-service.h" #include "wocky-pubsub-service-protected.h" #include "wocky-porter.h" #include "wocky-utils.h" #include "wocky-pubsub-helpers.h" #include "wocky-pubsub-node.h" #include "wocky-pubsub-node-protected.h" #include "wocky-pubsub-node-internal.h" #include "wocky-namespaces.h" #include "wocky-signals-marshal.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PUBSUB #include "wocky-debug-internal.h" static gboolean pubsub_service_propagate_event (WockyPorter *porter, WockyStanza *event_stanza, gpointer user_data); G_DEFINE_TYPE (WockyPubsubService, wocky_pubsub_service, G_TYPE_OBJECT) /* signal enum */ enum { SIG_EVENT_RECEIVED, SIG_SUB_STATE_CHANGED, SIG_NODE_DELETED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; enum { PROP_SESSION = 1, PROP_JID, }; /* private structure */ typedef struct _EventTrampoline EventTrampoline; struct _EventTrampoline { const WockyPubsubNodeEventMapping *mapping; WockyPubsubService *self; guint handler_id; }; struct _WockyPubsubServicePrivate { WockySession *session; WockyPorter *porter; gchar *jid; /* owned (gchar *) => weak reffed (WockyPubsubNode *) */ GHashTable *nodes; /* slice-allocated (EventTrampoline *) s, used for handlers */ GPtrArray *trampolines; gboolean dispose_has_run; }; GQuark wocky_pubsub_service_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-pubsub-service-error"); return quark; } static void wocky_pubsub_service_init (WockyPubsubService *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_PUBSUB_SERVICE, WockyPubsubServicePrivate); self->priv->nodes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } static void wocky_pubsub_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (object); WockyPubsubServicePrivate *priv = self->priv; switch (property_id) { case PROP_SESSION: priv->session = g_value_get_object (value); break; case PROP_JID: priv->jid = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pubsub_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (object); WockyPubsubServicePrivate *priv = self->priv; switch (property_id) { case PROP_SESSION: g_value_set_object (value, priv->session); break; case PROP_JID: g_value_set_string (value, priv->jid); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pubsub_service_dispose (GObject *object) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (object); WockyPubsubServicePrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->porter != NULL) { guint i; for (i = 0; i < priv->trampolines->len; i++) { EventTrampoline *t = g_ptr_array_index (priv->trampolines, i); wocky_porter_unregister_handler (priv->porter, t->handler_id); g_slice_free (EventTrampoline, t); } g_ptr_array_unref (priv->trampolines); priv->trampolines = NULL; g_object_unref (priv->porter); priv->porter = NULL; } if (G_OBJECT_CLASS (wocky_pubsub_service_parent_class)->dispose) G_OBJECT_CLASS (wocky_pubsub_service_parent_class)->dispose (object); } static void wocky_pubsub_service_finalize (GObject *object) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (object); WockyPubsubServicePrivate *priv = self->priv; g_free (priv->jid); g_hash_table_unref (priv->nodes); G_OBJECT_CLASS (wocky_pubsub_service_parent_class)->finalize (object); } static void wocky_pubsub_service_constructed (GObject *object) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (object); WockyPubsubServicePrivate *priv = self->priv; const WockyPubsubNodeEventMapping *m; guint n_mappings; g_assert (priv->session != NULL); g_assert (priv->jid != NULL); priv->porter = wocky_session_get_porter (priv->session); g_object_ref (priv->porter); m = _wocky_pubsub_node_get_event_mappings (&n_mappings); priv->trampolines = g_ptr_array_sized_new (n_mappings); for (; m->action != NULL; m++) { EventTrampoline *t = g_slice_new (EventTrampoline); t->mapping = m; t->self = self; t->handler_id = wocky_porter_register_handler_from (priv->porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, priv->jid, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, pubsub_service_propagate_event, t, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', m->action, ')', ')', NULL); g_ptr_array_add (priv->trampolines, t); } } static void wocky_pubsub_service_class_init ( WockyPubsubServiceClass *wocky_pubsub_service_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_pubsub_service_class); GType ctype = G_OBJECT_CLASS_TYPE (wocky_pubsub_service_class); GParamSpec *param_spec; g_type_class_add_private (wocky_pubsub_service_class, sizeof (WockyPubsubServicePrivate)); object_class->set_property = wocky_pubsub_service_set_property; object_class->get_property = wocky_pubsub_service_get_property; object_class->dispose = wocky_pubsub_service_dispose; object_class->finalize = wocky_pubsub_service_finalize; object_class->constructed = wocky_pubsub_service_constructed; param_spec = g_param_spec_object ("session", "session", "the Wocky Session associated with this pubsub service", WOCKY_TYPE_SESSION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SESSION, param_spec); param_spec = g_param_spec_string ("jid", "jid", "The jid of the pubsub service", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_JID, param_spec); /** * WockyPubsubService::event-received: * @service: a pubsub service * @node: the node on @service for which an event has been received * wire * @event_stanza: the message/event stanza in its entirity * @event_node: the event node from the stanza * @items_node: the items node from the stanza * @items: a list of WockyNode *s for each item child of @items_node * * Emitted when an event is received for a node. */ signals[SIG_EVENT_RECEIVED] = g_signal_new ("event-received", ctype, 0, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_OBJECT_POINTER_POINTER_POINTER, G_TYPE_NONE, 5, WOCKY_TYPE_PUBSUB_NODE, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); /** * WockyPubsubService::subscription-state-changed: * @service: a pubsub service * @node: a pubsub node for which the subscription state has changed * @stanza: the message/event stanza in its entirety * @event_node: the event node from @stanza * @subscription_node: the subscription node from @stanza * @subscription: subscription information parsed from @subscription_node */ signals[SIG_SUB_STATE_CHANGED] = g_signal_new ("subscription-state-changed", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_OBJECT_POINTER_POINTER_BOXED, G_TYPE_NONE, 5, WOCKY_TYPE_PUBSUB_NODE, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER, WOCKY_TYPE_PUBSUB_SUBSCRIPTION); /** * WockyPubsubService::node-deleted * @node: a pubsub node * @stanza: the message/event stanza in its entirety * @event_node: the event node from @stanza * @delete_node: the delete node from @stanza * * Emitted when a notification of a node's deletion is received from the * server. */ signals[SIG_NODE_DELETED] = g_signal_new ("node-deleted", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_OBJECT_POINTER_POINTER, G_TYPE_NONE, 4, WOCKY_TYPE_PUBSUB_NODE, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER); wocky_pubsub_service_class->node_object_type = WOCKY_TYPE_PUBSUB_NODE; } WockyPubsubService * wocky_pubsub_service_new (WockySession *session, const gchar *jid) { return g_object_new (WOCKY_TYPE_PUBSUB_SERVICE, "session", session, "jid", jid, NULL); } static gboolean remove_node (gpointer key, gpointer value, gpointer node) { return value == node; } /* Called when a WockyPubsubNode has been disposed so we can remove it from * the hash table. */ static void node_disposed_cb (gpointer user_data, GObject *node) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (user_data); WockyPubsubServicePrivate *priv = self->priv; g_hash_table_foreach_remove (priv->nodes, remove_node, node); } static void pubsub_service_node_event_received_cb ( WockyPubsubNode *node, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node, GList *items, gpointer user_data) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (user_data); g_signal_emit (self, signals[SIG_EVENT_RECEIVED], 0, node, event_stanza, event_node, items_node, items); } static void pubsub_service_node_subscription_state_changed_cb ( WockyPubsubNode *node, WockyStanza *stanza, WockyNode *event_node, WockyNode *subscription_node, WockyPubsubSubscription *subscription, gpointer user_data) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (user_data); g_signal_emit (self, signals[SIG_SUB_STATE_CHANGED], 0, node, stanza, event_node, subscription_node, subscription); } static void pubsub_service_node_deleted_cb ( WockyPubsubNode *node, WockyStanza *stanza, WockyNode *event_node, WockyNode *delete_node, gpointer user_data) { WockyPubsubService *self = WOCKY_PUBSUB_SERVICE (user_data); g_signal_emit (self, signals[SIG_NODE_DELETED], 0, node, stanza, event_node, delete_node); } static WockyPubsubNode * pubsub_service_create_node (WockyPubsubService *self, const gchar *name) { WockyPubsubServicePrivate *priv = self->priv; WockyPubsubServiceClass *class = WOCKY_PUBSUB_SERVICE_GET_CLASS (self); WockyPubsubNode *node; g_return_val_if_fail ( g_type_is_a (class->node_object_type, WOCKY_TYPE_PUBSUB_NODE), NULL); node = g_object_new (class->node_object_type, "service", self, "name", name, NULL); g_object_weak_ref (G_OBJECT (node), node_disposed_cb, self); g_hash_table_insert (priv->nodes, g_strdup (name), node); /* It's safe to never explicitly disconnect these handlers: the node holds a * reference to the service, so the service will always outlive the node. */ g_signal_connect (node, "event-received", (GCallback) pubsub_service_node_event_received_cb, self); g_signal_connect (node, "subscription-state-changed", (GCallback) pubsub_service_node_subscription_state_changed_cb, self); g_signal_connect (node, "deleted", (GCallback) pubsub_service_node_deleted_cb, self); return node; } /** * wocky_pubsub_service_ensure_node: * @self: a pubsub service * @name: the name of a node on @self * * Fetches or creates an object representing a node on the pubsub service. Note * that this does not ensure that a node exists on the server; it merely * ensures a local representation. * * Returns: a new reference to an object representing a node named @name on * @self */ WockyPubsubNode * wocky_pubsub_service_ensure_node (WockyPubsubService *self, const gchar *name) { WockyPubsubServicePrivate *priv = self->priv; WockyPubsubNode *node; node = g_hash_table_lookup (priv->nodes, name); if (node != NULL) return g_object_ref (node); else return pubsub_service_create_node (self, name); } /** * wocky_pubsub_service_lookup_node: * @self: a pubsub service * @name: the name of a node on @self * * Fetches an object representing a node on a pubsub service, if the object * already exists; if not, returns %NULL. Note that this does not check whether * a node exists on the server; it only checks for a local representation. * * Returns: a borrowed reference to a node, or %NULL */ WockyPubsubNode * wocky_pubsub_service_lookup_node (WockyPubsubService *self, const gchar *name) { WockyPubsubServicePrivate *priv = self->priv; return g_hash_table_lookup (priv->nodes, name); } static gboolean pubsub_service_propagate_event (WockyPorter *porter, WockyStanza *event_stanza, gpointer user_data) { EventTrampoline *trampoline = user_data; WockyPubsubService *self = trampoline->self; WockyNode *event_node, *action_node; const gchar *node_name; WockyPubsubNode *node; g_assert (WOCKY_IS_PUBSUB_SERVICE (self)); event_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (event_stanza), "event", WOCKY_XMPP_NS_PUBSUB_EVENT); g_return_val_if_fail (event_node != NULL, FALSE); action_node = wocky_node_get_child (event_node, trampoline->mapping->action); g_return_val_if_fail (action_node != NULL, FALSE); node_name = wocky_node_get_attribute (action_node, "node"); if (node_name == NULL) { DEBUG_STANZA (event_stanza, "no node='' attribute on <%s/>", trampoline->mapping->action); return FALSE; } node = wocky_pubsub_service_ensure_node (self, node_name); trampoline->mapping->method (node, event_stanza, event_node, action_node); g_object_unref (node); return TRUE; } static void default_configuration_iq_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); GError *error = NULL; WockyNodeTree *default_tree; WockyDataForm *form; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB_OWNER, "default", &default_tree, &error)) { form = wocky_data_form_new_from_form ( wocky_node_tree_get_top_node (default_tree), &error); if (form != NULL) g_simple_async_result_set_op_res_gpointer (result, form, NULL); g_object_unref (default_tree); } if (error != NULL) { g_simple_async_result_set_from_error (result, error); g_clear_error (&error); } g_simple_async_result_complete (result); g_object_unref (result); } void wocky_pubsub_service_get_default_node_configuration_async ( WockyPubsubService *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubServicePrivate *priv = self->priv; WockyStanza *stanza; GSimpleAsyncResult *result; stanza = wocky_pubsub_make_stanza (priv->jid, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "default", NULL, NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_service_get_default_node_configuration_async); wocky_porter_send_iq_async (priv->porter, stanza, NULL, default_configuration_iq_cb, result); g_object_unref (stanza); } WockyDataForm * wocky_pubsub_service_get_default_node_configuration_finish ( WockyPubsubService *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_pubsub_service_get_default_node_configuration_async), NULL); return g_simple_async_result_get_op_res_gpointer ( G_SIMPLE_ASYNC_RESULT (result)); } WockyPubsubSubscription * wocky_pubsub_service_parse_subscription (WockyPubsubService *self, WockyNode *subscription_node, const gchar *parent_node_attr, GError **error) { const gchar *node; const gchar *jid = wocky_node_get_attribute (subscription_node, "jid"); const gchar *subscription = wocky_node_get_attribute (subscription_node, "subscription"); const gchar *subid = wocky_node_get_attribute (subscription_node, "subid"); WockyPubsubNode *node_obj; gint state; WockyPubsubSubscription *sub; if (parent_node_attr != NULL) node = parent_node_attr; else node = wocky_node_get_attribute (subscription_node, "node"); #define FAIL_IF_NULL(attr) \ if (attr == NULL) \ { \ g_set_error (error, WOCKY_PUBSUB_SERVICE_ERROR, \ WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, \ " missing " #attr "='' attribute"); \ return NULL; \ } FAIL_IF_NULL (node); FAIL_IF_NULL (jid); FAIL_IF_NULL (subscription); /* subid is technically a MUST if the service supports it, but... */ #undef FAIL_IF_NULL if (!wocky_enum_from_nick (WOCKY_TYPE_PUBSUB_SUBSCRIPTION_STATE, subscription, &state)) { g_set_error (error, WOCKY_PUBSUB_SERVICE_ERROR, WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, "subscription='%s' is not a valid state", subscription); return NULL; } node_obj = wocky_pubsub_service_ensure_node (self, node); sub = wocky_pubsub_subscription_new (node_obj, jid, state, subid); g_object_unref (node_obj); return sub; } GList * wocky_pubsub_service_parse_subscriptions (WockyPubsubService *self, WockyNode *subscriptions_node, GList **subscription_nodes) { const gchar *parent_node_attr = wocky_node_get_attribute ( subscriptions_node, "node"); GQueue subs = G_QUEUE_INIT; GQueue sub_nodes = G_QUEUE_INIT; WockyNode *n; WockyNodeIter i; wocky_node_iter_init (&i, subscriptions_node, "subscription", NULL); while (wocky_node_iter_next (&i, &n)) { GError *error = NULL; WockyPubsubSubscription *sub = wocky_pubsub_service_parse_subscription ( self, n, parent_node_attr, &error); if (sub != NULL) { g_queue_push_tail (&subs, sub); g_queue_push_tail (&sub_nodes, n); } else { DEBUG ("%s", error->message); g_clear_error (&error); } } if (subscription_nodes == NULL) g_queue_clear (&sub_nodes); else *subscription_nodes = sub_nodes.head; return subs.head; } static void receive_subscriptions_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubService *self = WOCKY_PUBSUB_SERVICE ( g_async_result_get_source_object (user_data)); WockyNodeTree *subs_tree; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB, "subscriptions", &subs_tree, &error)) { GList *subs = wocky_pubsub_service_parse_subscriptions (self, wocky_node_tree_get_top_node (subs_tree), NULL); g_simple_async_result_set_op_res_gpointer (simple, subs, (GDestroyNotify) wocky_pubsub_subscription_list_free); g_object_unref (subs_tree); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } WockyStanza * wocky_pubsub_service_create_retrieve_subscriptions_stanza ( WockyPubsubService *self, WockyPubsubNode *node, WockyNode **pubsub_node, WockyNode **subscriptions_node) { WockyPubsubServicePrivate *priv = self->priv; WockyStanza *stanza; WockyNode *subscriptions; stanza = wocky_pubsub_make_stanza (priv->jid, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB, "subscriptions", pubsub_node, &subscriptions); if (node != NULL) wocky_node_set_attribute (subscriptions, "node", wocky_pubsub_node_get_name (node)); if (subscriptions_node != NULL) *subscriptions_node = subscriptions; return stanza; } void wocky_pubsub_service_retrieve_subscriptions_async ( WockyPubsubService *self, WockyPubsubNode *node, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubServicePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_service_retrieve_subscriptions_async); WockyStanza *stanza; stanza = wocky_pubsub_service_create_retrieve_subscriptions_stanza (self, node, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, receive_subscriptions_cb, simple); g_object_unref (stanza); } gboolean wocky_pubsub_service_retrieve_subscriptions_finish ( WockyPubsubService *self, GAsyncResult *result, GList **subscriptions, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_pubsub_service_retrieve_subscriptions_async, wocky_pubsub_subscription_list_copy, subscriptions); } /** * wocky_pubsub_service_handle_create_node_reply: * @self: a pubsub service * @create_tree: the <create/> tree from the reply to an attempt to * create a node, or %NULL if none was present in the reply. * @requested_name: the name we asked the server to use for the node, or %NULL * if we requested an instant node * @error: location at which to store an error * * Handles the body of a reply to a create node request. This is * ever-so-slightly involved, because the server is allowed to omit the body of * the reply if you specified a node name and it created a node with that name, * but it may also tell you "hey, you asked for 'ringo', but I gave you * 'george'". Good times. * * Returns: a pubsub node if the reply made sense, or %NULL with @error set if * not. */ WockyPubsubNode * wocky_pubsub_service_handle_create_node_reply ( WockyPubsubService *self, WockyNodeTree *create_tree, const gchar *requested_name, GError **error) { WockyPubsubNode *node = NULL; const gchar *name = NULL; if (create_tree != NULL) { /* If the reply contained , it'd better contain the * nodeID. */ name = wocky_node_get_attribute ( wocky_node_tree_get_top_node (create_tree), "node"); if (name == NULL) g_set_error (error, WOCKY_PUBSUB_SERVICE_ERROR, WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, "reply doesn't contain node='' attribute"); } else if (requested_name == NULL) { g_set_error (error, WOCKY_PUBSUB_SERVICE_ERROR, WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, "requested an instant node, but the server did not report the " "newly-created node's name"); } else { name = requested_name; } if (name != NULL) { node = wocky_pubsub_service_ensure_node (self, name); DEBUG ("node %s created\n", name); } return node; } static void create_node_iq_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubService *self; WockyPubsubNode *node = NULL; const gchar *requested_name; WockyNodeTree *create_tree; GError *error = NULL; self = WOCKY_PUBSUB_SERVICE (g_async_result_get_source_object (user_data)); requested_name = g_object_get_data ((GObject *) result, "requested-name"); if (wocky_pubsub_distill_ambivalent_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB, "create", &create_tree, &error)) { node = wocky_pubsub_service_handle_create_node_reply (self, create_tree, requested_name, &error); if (create_tree != NULL) g_object_unref (create_tree); } if (node != NULL) { /* 'result' steals our reference to 'node' */ g_simple_async_result_set_op_res_gpointer (result, node, g_object_unref); } else { g_assert (error != NULL); g_simple_async_result_set_from_error (result, error); g_clear_error (&error); } g_simple_async_result_complete (result); g_object_unref (result); g_object_unref (self); } WockyStanza * wocky_pubsub_service_create_create_node_stanza ( WockyPubsubService *self, const gchar *name, WockyDataForm *config, WockyNode **pubsub_node, WockyNode **create_node) { WockyPubsubServicePrivate *priv = self->priv; WockyStanza *stanza; WockyNode *pubsub, *create; stanza = wocky_pubsub_make_stanza (priv->jid, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB, "create", &pubsub, &create); if (name != NULL) wocky_node_set_attribute (create, "node", name); if (config != NULL) wocky_data_form_submit (config, wocky_node_add_child (pubsub, "configure")); if (pubsub_node != NULL) *pubsub_node = pubsub; if (create_node != NULL) *create_node = create; return stanza; } void wocky_pubsub_service_create_node_async (WockyPubsubService *self, const gchar *name, WockyDataForm *config, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubServicePrivate *priv = self->priv; WockyStanza *stanza = wocky_pubsub_service_create_create_node_stanza ( self, name, config, NULL, NULL); GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_service_create_node_async); g_object_set_data_full ((GObject *) result, "requested-name", g_strdup (name), g_free); wocky_porter_send_iq_async (priv->porter, stanza, NULL, create_node_iq_cb, result); g_object_unref (stanza); } WockyPubsubNode * wocky_pubsub_service_create_node_finish (WockyPubsubService *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; WockyPubsubNode *node; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_pubsub_service_create_node_async), NULL); simple = (GSimpleAsyncResult *) result; if (g_simple_async_result_propagate_error (simple, error)) return NULL; node = WOCKY_PUBSUB_NODE (g_simple_async_result_get_op_res_gpointer (simple)); return g_object_ref (node); } WockyPorter * wocky_pubsub_service_get_porter (WockyPubsubService *self) { WockyPubsubServicePrivate *priv = self->priv; return priv->porter; } WockyPubsubSubscription * wocky_pubsub_subscription_new ( WockyPubsubNode *node, const gchar *jid, WockyPubsubSubscriptionState state, const gchar *subid) { WockyPubsubSubscription *sub = g_slice_new (WockyPubsubSubscription); sub->node = g_object_ref (node); sub->jid = g_strdup (jid); sub->state = state; sub->subid = g_strdup (subid); return sub; } WockyPubsubSubscription * wocky_pubsub_subscription_copy (WockyPubsubSubscription *sub) { g_return_val_if_fail (sub != NULL, NULL); return wocky_pubsub_subscription_new (sub->node, sub->jid, sub->state, sub->subid); } void wocky_pubsub_subscription_free (WockyPubsubSubscription *sub) { g_return_if_fail (sub != NULL); g_object_unref (sub->node); g_free (sub->jid); g_free (sub->subid); g_slice_free (WockyPubsubSubscription, sub); } GList * wocky_pubsub_subscription_list_copy (GList *subs) { return wocky_list_deep_copy ((GBoxedCopyFunc) wocky_pubsub_subscription_copy, subs); } void wocky_pubsub_subscription_list_free (GList *subs) { g_list_foreach (subs, (GFunc) wocky_pubsub_subscription_free, NULL); g_list_free (subs); } GType wocky_pubsub_subscription_get_type (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = g_boxed_type_register_static ("WockyPubsubSubscription", (GBoxedCopyFunc) wocky_pubsub_subscription_copy, (GBoxedFreeFunc) wocky_pubsub_subscription_free); return t; } /** * WockyPubsubServiceClass: * @parent_class: parent * @node_object_type: the subtype of #WOCKY_TYPE_PUBSUB_NODE to be created by * wocky_pubsub_service_ensure_node() * * The class structure for the #WockyPubsubService type. */ /** * WockyPubsubSubscription: * @node: a PubSub node * @jid: the JID which is subscribed to @node. This may be a bare JID, or a * full JID with a resource, depending on which was specified when * subscribing to @node. See XEP-0060 §6.1 Subscribe to a Node * @state: the state of this subscription * @subid: a unique identifier for this subscription, if a JID is subscribed to * a node multiple times, or %NULL if there is no such identifier. See * XEP-0060 §6.1.6 “Multiple Subscriptions” * * Represents a subscription to a node on a pubsub service, as seen when * listing your own subscriptions on a service with * wocky_pubsub_service_retrieve_subscriptions_async() or subscribing to a node * with wocky_pubsub_node_subscribe_async(). */ /** * WockyPubsubSubscriptionState: * @WOCKY_PUBSUB_SUBSCRIPTION_NONE: The node MUST NOT send event notifications * or payloads to the Entity. * @WOCKY_PUBSUB_SUBSCRIPTION_PENDING: An entity has requested to subscribe to * a node and the request has not yet been approved by a node owner. The node * MUST NOT send event notifications or payloads to the entity while it is in * this state. * @WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED: An entity has subscribed but its * subscription options have not yet been configured. The node MAY send event * notifications or payloads to the entity while it is in this state. The * service MAY timeout unconfigured subscriptions. * @WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED: An entity is subscribed to a node. * The node MUST send all event notifications (and, if configured, payloads) * to the entity while it is in this state (subject to subscriber * configuration and content filtering). * * Describes the state of a subscription to a node. Definitions are taken from * XEP-0060 * §4.2. */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-reader.h0000644000175000017500000000765112051446215023735 0ustar00wjtwjt00000000000000/* * wocky-xmpp-reader.h - Header for WockyXmppReader * Copyright (C) 2006,2009 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_XMPP_READER_H__ #define __WOCKY_XMPP_READER_H__ #include #include "wocky-xmpp-reader-enumtypes.h" #include "wocky-stanza.h" G_BEGIN_DECLS typedef struct _WockyXmppReader WockyXmppReader; /** * WockyXmppReaderClass: * * The class of a #WockyXmppReader. */ typedef struct _WockyXmppReaderClass WockyXmppReaderClass; typedef struct _WockyXmppReaderPrivate WockyXmppReaderPrivate; struct _WockyXmppReaderClass { /**/ GObjectClass parent_class; }; struct _WockyXmppReader { /**/ GObject parent; WockyXmppReaderPrivate *priv; }; /** * WockyXmppReaderState: * @WOCKY_XMPP_READER_STATE_INITIAL : initial state * @WOCKY_XMPP_READER_STATE_OPENED : stream is open * @WOCKY_XMPP_READER_STATE_CLOSED : stream has been closed * @WOCKY_XMPP_READER_STATE_ERROR : stream reader hit an error * * The possible states a reader can be in. */ typedef enum { WOCKY_XMPP_READER_STATE_INITIAL, WOCKY_XMPP_READER_STATE_OPENED, WOCKY_XMPP_READER_STATE_CLOSED, WOCKY_XMPP_READER_STATE_ERROR, } WockyXmppReaderState; /** * WockyXmppReaderError: * @WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START : invalid start of xmpp stream * @WOCKY_XMPP_READER_ERROR_PARSE_ERROR : error in parsing the XML * * The different errors that can occur while reading a stream */ typedef enum { WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START, WOCKY_XMPP_READER_ERROR_PARSE_ERROR, } WockyXmppReaderError; GQuark wocky_xmpp_reader_error_quark (void); /** * WOCKY_XMPP_READER_ERROR: * * Get access to the error quark of the reader. */ #define WOCKY_XMPP_READER_ERROR (wocky_xmpp_reader_error_quark ()) GType wocky_xmpp_reader_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_XMPP_READER \ (wocky_xmpp_reader_get_type ()) #define WOCKY_XMPP_READER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_XMPP_READER, \ WockyXmppReader)) #define WOCKY_XMPP_READER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_XMPP_READER, \ WockyXmppReaderClass)) #define WOCKY_IS_XMPP_READER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_XMPP_READER)) #define WOCKY_IS_XMPP_READER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_XMPP_READER)) #define WOCKY_XMPP_READER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_XMPP_READER, \ WockyXmppReaderClass)) WockyXmppReader * wocky_xmpp_reader_new (void); WockyXmppReader * wocky_xmpp_reader_new_no_stream (void); WockyXmppReaderState wocky_xmpp_reader_get_state (WockyXmppReader *reader); void wocky_xmpp_reader_push (WockyXmppReader *reader, const guint8 *data, gsize length); WockyStanza *wocky_xmpp_reader_pop_stanza (WockyXmppReader *reader); WockyStanza *wocky_xmpp_reader_peek_stanza (WockyXmppReader *reader); GError *wocky_xmpp_reader_get_error (WockyXmppReader *reader); void wocky_xmpp_reader_reset (WockyXmppReader *reader); G_END_DECLS #endif /* #ifndef __WOCKY_XMPP_READER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-namespaces.h0000644000175000017500000000723212050202021023603 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_NAMESPACES_H__ #define __WOCKY_NAMESPACES_H__ #define WOCKY_XMPP_NS_JABBER_CLIENT \ "jabber:client" #define WOCKY_XMPP_NS_STREAM \ "http://etherx.jabber.org/streams" #define WOCKY_XMPP_NS_STREAMS \ "urn:ietf:params:xml:ns:xmpp-streams" #define WOCKY_XMPP_NS_BIND \ "urn:ietf:params:xml:ns:xmpp-bind" #define WOCKY_XMPP_NS_SESSION \ "urn:ietf:params:xml:ns:xmpp-session" #define WOCKY_XMPP_NS_TLS \ "urn:ietf:params:xml:ns:xmpp-tls" #define WOCKY_XMPP_NS_SASL_AUTH \ "urn:ietf:params:xml:ns:xmpp-sasl" #define WOCKY_NS_DISCO_INFO \ "http://jabber.org/protocol/disco#info" #define WOCKY_NS_DISCO_ITEMS \ "http://jabber.org/protocol/disco#items" #define WOCKY_XMPP_NS_XHTML_IM \ "http://jabber.org/protocol/xhtml-im" #define WOCKY_XMPP_NS_IBB \ "http://jabber.org/protocol/ibb" #define WOCKY_XMPP_NS_AMP \ "http://jabber.org/protocol/amp" #define WOCKY_W3C_NS_XHTML \ "http://www.w3.org/1999/xhtml" #define WOCKY_TELEPATHY_NS_CAPS \ "http://telepathy.freedesktop.org/caps" #define WOCKY_TELEPATHY_NS_TUBES \ "http://telepathy.freedesktop.org/xmpp/tubes" #define WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS \ "http://laptop.org/xmpp/activity-properties" #define WOCKY_XMPP_NS_SI \ "http://jabber.org/protocol/si" #define WOCKY_XMPP_NS_FEATURENEG \ "http://jabber.org/protocol/feature-neg" #define WOCKY_XMPP_NS_DATA \ "jabber:x:data" #define WOCKY_XMPP_NS_EVENT \ "jabber:x:event" #define WOCKY_XMPP_NS_DELAY \ "jabber:x:delay" #define WOCKY_XMPP_NS_STANZAS \ "urn:ietf:params:xml:ns:xmpp-stanzas" #define WOCKY_XMPP_NS_IQ_OOB \ "jabber:iq:oob" #define WOCKY_XMPP_NS_X_OOB \ "jabber:x:oob" #define WOCKY_TELEPATHY_NS_CLIQUE \ "http://telepathy.freedesktop.org/xmpp/clique" #define WOCKY_XEP77_NS_REGISTER \ "jabber:iq:register" /* XEP-0166 Jingle */ #define WOCKY_XMPP_NS_JINGLE \ "urn:xmpp:jingle:1" #define WOCKY_XMPP_NS_JINGLE_ERRORS \ "urn:xmpp:jingle:errors:1" /* XEP-0167 (Jingle RTP) */ #define WOCKY_XMPP_NS_JINGLE_RTP \ "urn:xmpp:jingle:apps:rtp:1" #define WOCKY_XMPP_NS_JINGLE_RTP_ERRORS \ "urn:xmpp:jingle:apps:rtp:errors:1" #define WOCKY_XMPP_NS_JINGLE_RTP_INFO \ "urn:xmpp:jingle:apps:rtp:info:1" #define WOCKY_XMPP_NS_JINGLE_RTP_AUDIO \ "urn:xmpp:jingle:apps:rtp:audio" #define WOCKY_XMPP_NS_JINGLE_RTP_VIDEO \ "urn:xmpp:jingle:apps:rtp:video" /* legacy namespaces */ #define WOCKY_JABBER_NS_AUTH \ "jabber:iq:auth" #define WOCKY_JABBER_NS_AUTH_FEATURE \ "http://jabber.org/features/iq-auth" #define WOCKY_GOOGLE_NS_AUTH \ "http://www.google.com/talk/protocol/auth" #define WOCKY_XMPP_NS_ROSTER \ "jabber:iq:roster" #define WOCKY_XMPP_NS_PUBSUB \ "http://jabber.org/protocol/pubsub" #define WOCKY_XMPP_NS_PUBSUB_EVENT \ WOCKY_XMPP_NS_PUBSUB "#event" #define WOCKY_XMPP_NS_PUBSUB_OWNER \ WOCKY_XMPP_NS_PUBSUB "#owner" #define WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG \ WOCKY_XMPP_NS_PUBSUB "#node_config" #define WOCKY_XMPP_NS_PUBSUB_ERRORS \ WOCKY_XMPP_NS_PUBSUB "#errors" #define WOCKY_XMPP_NS_PING \ "urn:xmpp:ping" #define WOCKY_NS_MUC \ "http://jabber.org/protocol/muc" #define WOCKY_NS_MUC_USER \ WOCKY_NS_MUC "#user" #define WOCKY_NS_MUC_ADMIN \ WOCKY_NS_MUC "#admin" #define WOCKY_NS_MUC_OWNER \ WOCKY_NS_MUC "#owner" #define WOCKY_NS_MUC_UNIQUE \ WOCKY_NS_MUC "#unique" #define WOCKY_NS_CHATSTATE \ "http://jabber.org/protocol/chatstates" #define WOCKY_NS_GOOGLE_SESSION_PHONE \ "http://www.google.com/session/phone" #define WOCKY_NS_GOOGLE_SESSION_VIDEO \ "http://www.google.com/session/video" #endif /* #ifndef __WOCKY_NAMESPACES_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pubsub-node-protected.h0000644000175000017500000000467612050202021025707 0ustar00wjtwjt00000000000000/* * wocky-pubsub-node-protected.h - protected methods on WockyPubsubNode * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef WOCKY_PUBSUB_NODE_PROTECTED_H #define WOCKY_PUBSUB_NODE_PROTECTED_H #include "wocky-pubsub-node.h" WockyPorter *wocky_pubsub_node_get_porter (WockyPubsubNode *self); WockyStanza *wocky_pubsub_node_make_subscribe_stanza (WockyPubsubNode *self, const gchar *jid, WockyNode **pubsub_node, WockyNode **subscribe_node); WockyStanza *wocky_pubsub_node_make_unsubscribe_stanza ( WockyPubsubNode *self, const gchar *jid, const gchar *subid, WockyNode **pubsub_node, WockyNode **unsubscribe_node); WockyStanza *wocky_pubsub_node_make_delete_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **delete_node); WockyStanza *wocky_pubsub_node_make_list_subscribers_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **subscriptions_node); WockyStanza *wocky_pubsub_node_make_list_affiliates_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **affiliations_node); GList *wocky_pubsub_node_parse_affiliations ( WockyPubsubNode *self, WockyNode *affiliations_node); WockyStanza *wocky_pubsub_node_make_modify_affiliates_stanza ( WockyPubsubNode *self, const GList *affiliates, WockyNode **pubsub_node, WockyNode **affiliations_node); WockyStanza *wocky_pubsub_node_make_get_configuration_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **configure_node); #endif /* WOCKY_PUBSUB_NODE_PROTECTED_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-connector.c0000644000175000017500000021404212051446215023470 0ustar00wjtwjt00000000000000/* * wocky-connector.c - Source for WockyConnector * Copyright © 2009 Collabora Ltd. * @author Vivek Dasmohapatra * * 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 */ /** * SECTION: wocky-connector * @title: WockyConnector * @short_description: Low-level XMPP connection generator. * @include: wocky/wocky-connector.h * * See: RFC3920 XEP-0077 * * Sends and receives #WockyStanzas from an underlying #GIOStream. * negotiating TLS if possible and completing authentication with the server * by the "most suitable" method available. * Returns a #WockyXmppConnection object to the user on successful completion. * * Can also be used to register or unregister an account: When unregistering * (cancelling) an account, a #WockyXmppConnection is NOT returned - a #gboolean * value indicating success or failure is returned instead. * * The WOCKY_DEBUG tag for this module is "connector". * * The flow of control during connection is roughly as follows: * (registration/cancellation flows are not represented with here) * * * * tcp_srv_connected * │ * ├→ tcp_host_connected * │ ↓ * └→ maybe_old_ssl * ↓ * xmpp_init ←─────────────────┬──┐ * ↓ │ │ * xmpp_init_sent_cb │ │ * ↓ │ │ * xmpp_init_recv_cb │ │ * │ ↓ │ │ * │ xmpp_features_cb │ │ * │ │ │ ↓ │ │ * │ │ │ tls_module_secure_cb ─┘ │ ① * │ │ ↓ │ ↑ * │ │ sasl_request_auth │ jabber_auth_done * │ │ ↓ │ ↑ * │ │ sasl_auth_done ────────┴─[no sasl]─→ jabber_request_auth * │ ↓ ↑ * │ iq_bind_resource │ * │ ↓ │ * │ iq_bind_resource_sent_cb │ * │ ↓ │ * │ iq_bind_resource_recv_cb │ * │ ↓ │ * │ ① │ * └──────────[old auth]────────────────────┘ * * ① * ↓ * establish_session ─────────→ success * ↓ ↑ * establish_session_sent_cb │ * ↓ │ * establish_session_recv_cb ─────┘ * * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-connector.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_CONNECTOR #include "wocky-debug-internal.h" #include "wocky-http-proxy.h" #include "wocky-sasl-auth.h" #include "wocky-tls-handler.h" #include "wocky-tls-connector.h" #include "wocky-jabber-auth.h" #include "wocky-namespaces.h" #include "wocky-xmpp-connection.h" #include "wocky-xmpp-error.h" #include "wocky-signals-marshal.h" #include "wocky-utils.h" G_DEFINE_TYPE (WockyConnector, wocky_connector, G_TYPE_OBJECT); static void wocky_connector_class_init (WockyConnectorClass *klass); /* XMPP connect/auth/etc handlers */ static void tcp_srv_connected (GObject *source, GAsyncResult *result, gpointer connector); static void tcp_host_connected (GObject *source, GAsyncResult *result, gpointer connector); static void maybe_old_ssl (WockyConnector *self); static void xmpp_init (WockyConnector *connector); static void xmpp_init_sent_cb (GObject *source, GAsyncResult *result, gpointer data); static void xmpp_init_recv_cb (GObject *source, GAsyncResult *result, gpointer data); static void xmpp_features_cb (GObject *source, GAsyncResult *result, gpointer data); static void tls_connector_secure_cb (GObject *source, GAsyncResult *res, gpointer user_data); static void sasl_request_auth (WockyConnector *object, WockyStanza *stanza); static void sasl_auth_done (GObject *source, GAsyncResult *result, gpointer data); static void xep77_begin (WockyConnector *self); static void xep77_begin_sent (GObject *source, GAsyncResult *result, gpointer data); static void xep77_begin_recv (GObject *source, GAsyncResult *result, gpointer data); static void xep77_cancel_send (WockyConnector *self); static void xep77_cancel_sent (GObject *source, GAsyncResult *res, gpointer data); static void xep77_cancel_recv (GObject *source, GAsyncResult *res, gpointer data); static void xep77_signup_send (WockyConnector *self, WockyNode *req); static void xep77_signup_sent (GObject *source, GAsyncResult *result, gpointer data); static void xep77_signup_recv (GObject *source, GAsyncResult *result, gpointer data); static void iq_bind_resource (WockyConnector *self); static void iq_bind_resource_sent_cb (GObject *source, GAsyncResult *result, gpointer data); static void iq_bind_resource_recv_cb (GObject *source, GAsyncResult *result, gpointer data); void establish_session (WockyConnector *self); static void establish_session_sent_cb (GObject *source, GAsyncResult *result, gpointer data); static void establish_session_recv_cb (GObject *source, GAsyncResult *result, gpointer data); /* old-style jabber auth handlers */ static void jabber_request_auth (WockyConnector *self); static void jabber_auth_done (GObject *source, GAsyncResult *res, gpointer data); /* private methods */ static void wocky_connector_dispose (GObject *object); static void wocky_connector_finalize (GObject *object); enum { PROP_JID = 1, PROP_PASS, PROP_AUTH_INSECURE_OK, PROP_ENC_PLAIN_AUTH_OK, PROP_RESOURCE, PROP_TLS_REQUIRED, PROP_XMPP_PORT, PROP_XMPP_HOST, PROP_IDENTITY, PROP_FEATURES, PROP_LEGACY, PROP_LEGACY_SSL, PROP_SESSION_ID, PROP_EMAIL, PROP_AUTH_REGISTRY, PROP_TLS_HANDLER, }; /* this tracks which XEP 0077 operation (register account, cancel account) * * we are attempting (if any). There is at leats one other XEP77 operation, * * password change - but we don't deal with that here as it's not really a * * connector operation: */ typedef enum { XEP77_NONE, XEP77_SIGNUP, XEP77_CANCEL, } WockyConnectorXEP77Op; typedef enum { WCON_DISCONNECTED, WCON_TCP_CONNECTING, WCON_TCP_CONNECTED, WCON_XMPP_AUTHED, WCON_XMPP_BOUND, } WockyConnectorState; struct _WockyConnectorPrivate { /* properties: */ GIOStream *stream; /* caller's choices about what to allow/disallow */ gboolean auth_insecure_ok; /* can we auth over non-ssl */ gboolean encrypted_plain_auth_ok; /* plaintext auth over secure channel */ /* xmpp account related properties */ gboolean tls_required; guint xmpp_port; gchar *xmpp_host; gchar *pass; gchar *email; gchar *jid; gchar *resource; /* the /[...] part of the jid, if any */ gchar *user; /* the [...]@ part of the initial JID */ gchar *domain; /* the @[...]/ part of the initial JID */ /* volatile/derived property: identity = jid, but may be updated by server: */ gchar *identity; /* if the server hands us a new JID (not handled yet) */ gboolean legacy_support; gboolean legacy_ssl; gchar *session_id; gchar *ca; /* file or dir containing x509 CA files */ /* XMPP connection data */ WockyStanza *features; /* misc internal state: */ WockyConnectorState state; gboolean dispose_has_run; gboolean authed; gboolean encrypted; gboolean connected; /* register/cancel account, or normal login */ WockyConnectorXEP77Op reg_op; GSimpleAsyncResult *result; GCancellable *cancellable; /* Used to hold the error from connecting to the result of an SRV lookup * while we fall back to connecting directly to the host. */ GError *srv_connect_error /* jesus christ it's a lion */; /* socket/tls/etc structures */ GSocketClient *client; GSocketConnection *sock; WockyXmppConnection *conn; WockyTLSHandler *tls_handler; WockyAuthRegistry *auth_registry; }; /* choose an appropriate chunk of text describing our state for debug/error */ static char * state_message (WockyConnectorPrivate *priv, const char *str) { const char *state = NULL; if (priv->authed) state = "Authentication Completed"; else if (priv->encrypted) { if (priv->legacy_ssl) state = "SSL Negotiated"; else state = "TLS Negotiated"; } else if (priv->connected) state = "TCP Connection Established"; else state = "Connecting... "; return g_strdup_printf ("%s: %s", state, str); } static void abort_connect_error (WockyConnector *connector, GError **error, const char *fmt, ...) { GSimpleAsyncResult *tmp = NULL; WockyConnectorPrivate *priv = NULL; va_list args; DEBUG ("connector: %p", connector); priv = connector->priv; g_assert (error != NULL); g_assert (*error != NULL); va_start (args, fmt); if ((fmt != NULL) && (*fmt != '\0')) { gchar *msg = g_strdup_vprintf (fmt, args); g_prefix_error (error, "%s: ", msg); g_free (msg); } va_end (args); if (priv->sock != NULL) { g_object_unref (priv->sock); priv->sock = NULL; } priv->state = WCON_DISCONNECTED; if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } tmp = priv->result; priv->result = NULL; g_simple_async_result_set_from_error (tmp, *error); g_simple_async_result_complete (tmp); g_object_unref (tmp); } static void abort_connect (WockyConnector *connector, GError *error) { GSimpleAsyncResult *tmp = NULL; WockyConnectorPrivate *priv = connector->priv; if (priv->sock != NULL) { g_object_unref (priv->sock); priv->sock = NULL; } priv->state = WCON_DISCONNECTED; if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } tmp = priv->result; priv->result = NULL; g_simple_async_result_set_from_error (tmp, error); g_simple_async_result_complete (tmp); g_object_unref (tmp); } static void abort_connect_code (WockyConnector *connector, int code, const char *fmt, ...) { GError *err = NULL; va_list args; va_start (args, fmt); err = g_error_new_valist (WOCKY_CONNECTOR_ERROR, code, fmt, args); va_end (args); abort_connect (connector, err); g_error_free (err); } GQuark wocky_connector_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-connector-error"); return quark; } static void wocky_connector_init (WockyConnector *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_CONNECTOR, WockyConnectorPrivate); } static void wocky_connector_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyConnector *connector = WOCKY_CONNECTOR (object); WockyConnectorPrivate *priv = connector->priv; switch (property_id) { case PROP_TLS_REQUIRED: priv->tls_required = g_value_get_boolean (value); break; case PROP_AUTH_INSECURE_OK: priv->auth_insecure_ok = g_value_get_boolean (value); break; case PROP_ENC_PLAIN_AUTH_OK: priv->encrypted_plain_auth_ok = g_value_get_boolean (value); break; case PROP_JID: g_free (priv->jid); priv->jid = g_value_dup_string (value); break; case PROP_EMAIL: g_free (priv->email); priv->email = g_value_dup_string (value); break; case PROP_PASS: g_free (priv->pass); priv->pass = g_value_dup_string (value); break; case PROP_RESOURCE: g_free (priv->resource); if ((g_value_get_string (value) != NULL) && *g_value_get_string (value) != '\0') priv->resource = g_value_dup_string (value); else priv->resource = g_strdup_printf ("Wocky_%x", rand()); break; case PROP_XMPP_PORT: priv->xmpp_port = g_value_get_uint (value); break; case PROP_XMPP_HOST: g_free (priv->xmpp_host); priv->xmpp_host = g_value_dup_string (value); break; case PROP_LEGACY: priv->legacy_support = g_value_get_boolean (value); break; case PROP_LEGACY_SSL: priv->legacy_ssl = g_value_get_boolean (value); break; case PROP_SESSION_ID: g_free (priv->session_id); priv->session_id = g_value_dup_string (value); break; case PROP_AUTH_REGISTRY: priv->auth_registry = g_value_dup_object (value); break; case PROP_TLS_HANDLER: priv->tls_handler = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_connector_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyConnector *connector = WOCKY_CONNECTOR (object); WockyConnectorPrivate *priv = connector->priv; switch (property_id) { case PROP_TLS_REQUIRED: g_value_set_boolean (value, priv->tls_required); break; case PROP_AUTH_INSECURE_OK: g_value_set_boolean (value, priv->auth_insecure_ok); break; case PROP_ENC_PLAIN_AUTH_OK: g_value_set_boolean (value, priv->encrypted_plain_auth_ok); break; case PROP_JID: g_value_set_string (value, priv->jid); break; case PROP_PASS: g_value_set_string (value, priv->pass); break; case PROP_EMAIL: g_value_set_string (value, priv->email); break; case PROP_RESOURCE: g_value_set_string (value, priv->resource); break; case PROP_XMPP_PORT: g_value_set_uint (value, priv->xmpp_port); break; case PROP_XMPP_HOST: g_value_set_string (value, priv->xmpp_host); break; case PROP_IDENTITY: g_value_set_string (value, priv->identity); break; case PROP_FEATURES: g_value_set_object (value, priv->features); break; case PROP_LEGACY: g_value_set_boolean (value, priv->legacy_support); break; case PROP_LEGACY_SSL: g_value_set_boolean (value, priv->legacy_ssl); break; case PROP_SESSION_ID: g_value_set_string (value, priv->session_id); break; case PROP_AUTH_REGISTRY: g_value_set_object (value, priv->auth_registry); break; case PROP_TLS_HANDLER: g_value_set_object (value, priv->tls_handler); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_connector_class_init (WockyConnectorClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *spec; g_type_class_add_private (klass, sizeof (WockyConnectorPrivate)); oclass->set_property = wocky_connector_set_property; oclass->get_property = wocky_connector_get_property; oclass->dispose = wocky_connector_dispose; oclass->finalize = wocky_connector_finalize; #if HAVE_GIO_PROXY /* Ensure that HTTP Proxy extension is registered */ _wocky_http_proxy_get_type (); #endif /** * WockyConnector:plaintext-auth-allowed: * * Whether auth info can be sent in the clear (eg PLAINTEXT auth). * This is independent of any encryption (TLS, SSL) that has been negotiated. */ spec = g_param_spec_boolean ("plaintext-auth-allowed", "plaintext-auth-allowed", "Whether auth info can be sent in the clear", FALSE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_AUTH_INSECURE_OK, spec); /** * WockyConnector:encrypted-plain-auth-ok: * * Whether PLAINTEXT auth is ok when encrypted. */ spec = g_param_spec_boolean ("encrypted-plain-auth-ok", "encrypted-plain-auth-ok", "Whether PLAIN auth can be used when encrypted", TRUE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_ENC_PLAIN_AUTH_OK, spec); /** * WockyConnector:tls-required: * * Whether we require successful tls/ssl negotiation to continue. */ spec = g_param_spec_boolean ("tls-required", "TLS required", "Whether SSL/TLS is required", TRUE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_TLS_REQUIRED, spec); /** * WockyConnector:jid: * * The XMPP account's JID (with or without a /resource). */ spec = g_param_spec_string ("jid", "jid", "The XMPP jid", NULL, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_JID, spec); /** * WockyConnector:email: * * The XMPP account's email address (optional, MAY be required by the server * if we are registering an account, not required otherwise). */ spec = g_param_spec_string ("email", "email", "user's email address", NULL, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_EMAIL, spec); /** * WockyConnector:password: * * XMPP Account password. */ spec = g_param_spec_string ("password", "pass", "Password", NULL, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_PASS, spec); /** * WockyConnector:resource: * * The resource (sans '/') for this connection. Will be generated * automatically if not set. May be altered by the server anyway * upon successful binding. */ spec = g_param_spec_string ("resource", "resource", "XMPP resource to append to the jid", NULL, (G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_RESOURCE, spec); /** * WockyConnector:identity: * * JID + resource (a AT b SLASH c) that is in effect _after_ a successful * resource binding operation. This is NOT guaranteed to be related to * the JID specified in the original #WockyConnector:jid property. * The resource, in particular, is often different, and with gtalk the * domain is often different. */ spec = g_param_spec_string ("identity", "identity", "jid + resource (set by XMPP server)", NULL, (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_IDENTITY, spec); /** * WockyConnector:xmpp-server: * * Optional XMPP connect server. Any DNS SRV record and the host specified * in #WockyConnector:jid will be ignored if this is set. May be a hostname * (fully qualified or otherwise), a dotted quad or an ipv6 address. */ spec = g_param_spec_string ("xmpp-server", "XMPP server", "XMPP connect server hostname or address", NULL, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_XMPP_HOST, spec); /** * WockyConnector:xmpp-port: * * Optional XMPP connect port. Any DNS SRV record will be ignored if * this is set. (So the host will be either the WockyConnector:xmpp-server * property or the domain part of the JID, in descending order of preference) */ spec = g_param_spec_uint ("xmpp-port", "XMPP port", "XMPP port", 0, 65535, 0, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_XMPP_PORT, spec); /** * WockyConnector:features: * * A #WockyStanza instance, the last WockyStanza instance received * by the connector during the connection procedure (there may be several, * the most recent one always being the one we should refer to). */ spec = g_param_spec_object ("features", "XMPP Features", "Last XMPP Feature Stanza advertised by server", WOCKY_TYPE_STANZA, (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_FEATURES, spec); /** * WockyConnector:legacy: * * Whether to attempt old-style (non-SASL) jabber auth. */ spec = g_param_spec_boolean ("legacy", "Legacy Jabber Support", "Old style Jabber (Auth) support", FALSE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_LEGACY, spec); /** * WockyConnector:old-ssl: * * Whether to use old-style SSL-at-connect-time encryption rather than * the more modern STARTTLS approach. */ spec = g_param_spec_boolean ("old-ssl", "Legacy SSL Support", "Old style SSL support", FALSE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_LEGACY_SSL, spec); /** * WockyConnector:session-id: * * The Session ID supplied by the server upon successfully connecting. * May be useful later on as some XEPs suggest this value should be used * at various stages as part of a hash or as an ID. */ spec = g_param_spec_string ("session-id", "XMPP Session ID", "XMPP Session ID", NULL, (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_SESSION_ID, spec); /** * WockyConnector:auth-registry * * An authentication registry that holds handlers for different * authentication mechanisms, arbitrates mechanism selection and relays * challenges and responses between the handlers and the connection. */ spec = g_param_spec_object ("auth-registry", "Authentication Registry", "Authentication Registry", WOCKY_TYPE_AUTH_REGISTRY, (G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_AUTH_REGISTRY, spec); /** * WockyConnector:tls-handler * * A TLS handler that carries out the interactive verification of the * TLS certitificates provided by the server. */ spec = g_param_spec_object ("tls-handler", "TLS Handler", "TLS Handler", WOCKY_TYPE_TLS_HANDLER, (G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (oclass, PROP_TLS_HANDLER, spec); } #define UNREF_AND_FORGET(x) if (x != NULL) { g_object_unref (x); x = NULL; } #define GFREE_AND_FORGET(x) g_free (x); x = NULL; static void wocky_connector_dispose (GObject *object) { WockyConnector *self = WOCKY_CONNECTOR (object); WockyConnectorPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; UNREF_AND_FORGET (priv->conn); UNREF_AND_FORGET (priv->client); UNREF_AND_FORGET (priv->sock); UNREF_AND_FORGET (priv->features); UNREF_AND_FORGET (priv->auth_registry); UNREF_AND_FORGET (priv->tls_handler); if (G_OBJECT_CLASS (wocky_connector_parent_class )->dispose) G_OBJECT_CLASS (wocky_connector_parent_class)->dispose (object); } static void wocky_connector_finalize (GObject *object) { WockyConnector *self = WOCKY_CONNECTOR (object); WockyConnectorPrivate *priv = self->priv; GFREE_AND_FORGET (priv->jid); GFREE_AND_FORGET (priv->user); GFREE_AND_FORGET (priv->domain); GFREE_AND_FORGET (priv->resource); GFREE_AND_FORGET (priv->identity); GFREE_AND_FORGET (priv->xmpp_host); GFREE_AND_FORGET (priv->pass); GFREE_AND_FORGET (priv->session_id); GFREE_AND_FORGET (priv->email); if (priv->srv_connect_error != NULL) g_clear_error (&priv->srv_connect_error); G_OBJECT_CLASS (wocky_connector_parent_class)->finalize (object); } static void connect_to_host_async (WockyConnector *connector, const gchar *host, guint port) { WockyConnectorPrivate *priv = connector->priv; #if HAVE_GIO_PROXY /* Legacy SSL mode is just like doing HTTPS, so let's trigger HTTPS * proxy setting if any */ gchar *uri = g_strdup_printf ("%s://%s:%i", priv->legacy_ssl ? "https" : "xmpp-client", host, port); g_socket_client_connect_to_uri_async (priv->client, uri, port, NULL, tcp_host_connected, connector); g_free (uri); #else g_socket_client_connect_to_host_async (priv->client, host, port, NULL, tcp_host_connected, connector); #endif } static void tcp_srv_connected (GObject *source, GAsyncResult *result, gpointer connector) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (connector); WockyConnectorPrivate *priv = self->priv; priv->sock = g_socket_client_connect_to_service_finish (G_SOCKET_CLIENT (source), result, &error); /* if we didn't manage to connect via SRV records based on the JID (no SRV records or host unreachable/not listening) fall back to treating the domain part of the JID as a real host and try to talk to that */ if (priv->sock == NULL) { gchar *node = NULL; /* username */ /* @ */ gchar *host = NULL; /* domain.tld */ /* / */ guint port = (priv->xmpp_port == 0) ? 5222 : priv->xmpp_port; /* g_socket_client_connect_to_service_finish() should have set error if * it returned %NULL. */ g_return_if_fail (error != NULL); DEBUG ("SRV connect failed: %s:%d %s", g_quark_to_string (error->domain), error->code, error->message); /* An IO error implies there IS a SRV record but we could not * connect. Stash the error, and fall back to connecting to the host * directly; if we also fail to connect to the host, we'll report the * error we stashed here rather than the later error. This is * predominantly to work around chat.facebook.com having a broken SRV * record. * * For any other kind of error, we assume this means there's no SRV * record, bin the GError and just fall back to the host completely. */ if (error->domain == G_IO_ERROR) priv->srv_connect_error = error; else g_clear_error (&error); priv->state = WCON_TCP_CONNECTING; /* decode a hostname from the JID here: Don't check for an explicit * * connect host supplied by the user as we shouldn't even try a SRV * * connection in that case, and should therefore never get here */ wocky_decode_jid (priv->jid, &node, &host, NULL); if ((host != NULL) && (*host != '\0')) { DEBUG ("Falling back to HOST connection to %s port %u", host, port); connect_to_host_async (connector, host, port); } else { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_BAD_JID, "JID contains no domain: %s", priv->jid); } g_free (node); g_free (host); } else { DEBUG ("SRV connection succeeded"); priv->connected = TRUE; priv->state = WCON_TCP_CONNECTED; maybe_old_ssl (self); } } static void tcp_host_connected (GObject *source, GAsyncResult *result, gpointer connector) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (connector); WockyConnectorPrivate *priv = self->priv; GSocketClient *sock = G_SOCKET_CLIENT (source); priv->sock = g_socket_client_connect_to_host_finish (sock, result, &error); if (priv->sock == NULL) { DEBUG ("HOST connect failed: %s", error->message); if (priv->srv_connect_error != NULL) { DEBUG ("we previously hit a GIOError when connecting using SRV; " "reporting that error"); abort_connect_error (connector, &priv->srv_connect_error, "couldn't connect to server specified by SRV record"); } else { abort_connect_error (connector, &error, "couldn't connect to server"); } g_error_free (error); } else { DEBUG ("HOST connection succeeded"); priv->connected = TRUE; priv->state = WCON_TCP_CONNECTED; maybe_old_ssl (self); } } /* ************************************************************************* */ /* legacy jabber support */ static void jabber_request_auth (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; WockyJabberAuth *jabber_auth; gboolean clear = FALSE; jabber_auth = wocky_jabber_auth_new (priv->session_id, priv->user, priv->resource, priv->pass, priv->conn, priv->auth_registry); if (priv->auth_insecure_ok || (priv->encrypted && priv->encrypted_plain_auth_ok)) clear = TRUE; DEBUG ("handing over control to WockyJabberAuth"); wocky_jabber_auth_authenticate_async (jabber_auth, clear, priv->encrypted, priv->cancellable, jabber_auth_done, self); } static void jabber_auth_done (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyJabberAuth *jabber_auth = WOCKY_JABBER_AUTH (source); if (!wocky_jabber_auth_authenticate_finish (jabber_auth, result, &error)) { /* nothing to add, the SASL error should be informative enough */ DEBUG ("Jabber auth complete (failure)"); abort_connect_error (self, &error, ""); g_error_free (error); goto out; } DEBUG ("Jabber auth complete (success)"); priv->state = WCON_XMPP_AUTHED; priv->authed = TRUE; priv->identity = g_strdup_printf ("%s@%s/%s", priv->user, priv->domain, priv->resource); /* if there has been no features stanza, this will just finish up * * if there has been a feature stanza, we are in an XMPP 1.x * * server that _only_ supports old style auth (no SASL). In this * * bizarre situation, we would then proceed as if we were in a * * normal XMPP server after a successful bind. */ establish_session (self); out: g_object_unref (jabber_auth); } /* ************************************************************************* */ /* old-style SSL */ static const gchar * get_peername (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; const gchar *peer; if (priv->legacy_ssl) peer = (priv->xmpp_host != NULL) ? priv->xmpp_host : priv->domain; else peer = priv->domain; return peer; } static void maybe_old_ssl (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; g_assert (priv->conn == NULL); g_assert (priv->sock != NULL); priv->conn = wocky_xmpp_connection_new (G_IO_STREAM (priv->sock)); if (priv->legacy_ssl && !priv->encrypted) { WockyTLSConnector *tls_connector; DEBUG ("Creating SSL connector"); tls_connector = wocky_tls_connector_new (priv->tls_handler); DEBUG ("Beginning SSL handshake"); wocky_tls_connector_secure_async (tls_connector, priv->conn, TRUE, get_peername (self), NULL, priv->cancellable, tls_connector_secure_cb, self); g_object_unref (tls_connector); } else { xmpp_init (self); } } /* ************************************************************************* */ /* standard XMPP stanza handling */ static void xmpp_init (WockyConnector *connector) { WockyConnector *self = WOCKY_CONNECTOR (connector); WockyConnectorPrivate *priv = self->priv; DEBUG ("sending XMPP stream open to server"); wocky_xmpp_connection_send_open_async (priv->conn, priv->domain, NULL, "1.0", NULL, NULL, priv->cancellable, xmpp_init_sent_cb, connector); } static void xmpp_init_sent_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; if (!wocky_xmpp_connection_send_open_finish (priv->conn, result, &error)) { abort_connect_error (self, &error, "Failed to send open stanza"); g_error_free (error); return; } DEBUG ("waiting for stream open from server"); wocky_xmpp_connection_recv_open_async (priv->conn, priv->cancellable, xmpp_init_recv_cb, data); } static void xmpp_init_recv_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; gchar *debug = NULL; gchar *version = NULL; gchar *from = NULL; gchar *id = NULL; gdouble ver = 0; if (!wocky_xmpp_connection_recv_open_finish (priv->conn, result, NULL, &from, &version, NULL, &id, &error)) { char *msg = state_message (priv, error->message); abort_connect_error (self, &error, msg); g_free (msg); g_error_free (error); goto out; } g_free (priv->session_id); priv->session_id = g_strdup (id); debug = state_message (priv, ""); DEBUG ("%s: received XMPP version=%s stream open from server", debug, version != NULL ? version : "(unspecified)"); g_free (debug); ver = (version != NULL) ? atof (version) : -1; if (ver < 1.0) { if (!priv->legacy_support) abort_connect_code (self, WOCKY_CONNECTOR_ERROR_NON_XMPP_V1_SERVER, "Server not XMPP 1.0 Compliant"); else jabber_request_auth (self); } else { DEBUG ("waiting for feature stanza from server"); wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, xmpp_features_cb, data); } out: g_free (version); g_free (from); g_free (id); } /* ************************************************************************* */ /* handle stream errors */ static gboolean stream_error_abort (WockyConnector *connector, WockyStanza *stanza) { GError *error = NULL; if (!wocky_stanza_extract_stream_error (stanza, &error)) return FALSE; DEBUG ("Received stream error: %s", error->message); abort_connect (connector, error); g_error_free (error); return TRUE; } /* ************************************************************************* */ static void xmpp_features_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyStanza *stanza; WockyNode *node; gboolean can_encrypt = FALSE; gboolean can_bind = FALSE; stanza = wocky_xmpp_connection_recv_stanza_finish (priv->conn, result, &error); if (stanza == NULL) { abort_connect_error (self, &error, "disconnected before XMPP features stanza"); g_error_free (error); return; } if (stream_error_abort (self, stanza)) goto out; DEBUG ("received feature stanza from server"); node = wocky_stanza_get_top_node (stanza); if (!wocky_node_matches (node, "features", WOCKY_XMPP_NS_STREAM)) { char *msg = state_message (priv, "Malformed or missing feature stanza"); abort_connect_code (data, WOCKY_CONNECTOR_ERROR_BAD_FEATURES, msg); g_free (msg); goto out; } /* cache the current feature set: according to the RFC, we should forget * any previous feature set as soon as we open a new stream, so that * happens elsewhere */ if (stanza != NULL) { if (priv->features != NULL) g_object_unref (priv->features); priv->features = g_object_ref (stanza); } can_encrypt = wocky_node_get_child_ns (node, "starttls", WOCKY_XMPP_NS_TLS) != NULL; can_bind = wocky_node_get_child_ns (node, "bind", WOCKY_XMPP_NS_BIND) != NULL; /* conditions: * not encrypted, not encryptable, require encryption → ABORT * !encrypted && encryptable → STARTTLS * !authed && xep77_reg → XEP77 REGISTRATION * !authed → AUTH * not bound && can bind → BIND */ if (!priv->encrypted && !can_encrypt && priv->tls_required) { abort_connect_code (data, WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE, "TLS requested but lack server support"); goto out; } if (!priv->encrypted && can_encrypt) { WockyTLSConnector *tls_connector; tls_connector = wocky_tls_connector_new (priv->tls_handler); wocky_tls_connector_secure_async (tls_connector, priv->conn, FALSE, get_peername (self), NULL, priv->cancellable, tls_connector_secure_cb, self); g_object_unref (tls_connector); goto out; } if (!priv->authed && priv->reg_op == XEP77_SIGNUP) { xep77_begin (self); goto out; } if (!priv->authed) { sasl_request_auth (self, stanza); goto out; } /* we MUST bind here http://www.ietf.org/rfc/rfc3920.txt */ if (can_bind) iq_bind_resource (self); else abort_connect_code (data, WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE, "XMPP Server does not support resource binding"); out: if (stanza != NULL) g_object_unref (stanza); } static void tls_connector_secure_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyTLSConnector *tls_connector = WOCKY_TLS_CONNECTOR (source); WockyConnector *self = user_data; GError *error = NULL; WockyXmppConnection *new_connection; new_connection = wocky_tls_connector_secure_finish (tls_connector, res, &error); if (error != NULL) { abort_connect (self, error); g_error_free (error); return; } if (self->priv->conn != NULL) g_object_unref (self->priv->conn); self->priv->conn = new_connection; self->priv->encrypted = TRUE; xmpp_init (self); } /* ************************************************************************* */ /* AUTH calls */ static void sasl_request_auth (WockyConnector *object, WockyStanza *stanza) { WockyConnector *self = WOCKY_CONNECTOR (object); WockyConnectorPrivate *priv = self->priv; WockySaslAuth *s; gboolean clear = FALSE; s = wocky_sasl_auth_new (priv->domain, priv->user, priv->pass, priv->conn, priv->auth_registry); if (priv->auth_insecure_ok || (priv->encrypted && priv->encrypted_plain_auth_ok)) clear = TRUE; DEBUG ("handing over control to SASL module"); wocky_sasl_auth_authenticate_async (s, stanza, clear, priv->encrypted, priv->cancellable, sasl_auth_done, self); } static void sasl_auth_done (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockySaslAuth *sasl = WOCKY_SASL_AUTH (source); if (!wocky_sasl_auth_authenticate_finish (sasl, result, &error)) { /* nothing to add, the SASL error should be informative enough */ DEBUG ("SASL complete (failure)"); /* except: if there's no SASL and Jabber auth is available, we * * are allowed to attempt that instead */ if ((error->domain == WOCKY_AUTH_ERROR) && (error->code == WOCKY_AUTH_ERROR_NOT_SUPPORTED) && (wocky_node_get_child_ns ( wocky_stanza_get_top_node (priv->features), "auth", WOCKY_JABBER_NS_AUTH_FEATURE) != NULL)) jabber_request_auth (self); else abort_connect_error (self, &error, ""); g_error_free (error); goto out; } DEBUG ("SASL complete (success)"); priv->state = WCON_XMPP_AUTHED; priv->authed = TRUE; wocky_xmpp_connection_reset (priv->conn); xmpp_init (self); out: g_object_unref (sasl); } /* ************************************************************************* */ /* XEP 0077 register/cancel calls */ static void xep77_cancel_send (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; WockyStanza *iqs = NULL; gchar *iid = NULL; DEBUG (""); iid = wocky_xmpp_connection_new_id (priv->conn); iqs = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, /* FIXME: It is debatable (XEP0077 section 3.2) whether we should * * include our JID here. The examples include it, the text states * * that we SHOULD NOT, at least in some use cases */ NULL /* priv->identity */, priv->domain, '@', "id", iid, '(', "query", ':', WOCKY_XEP77_NS_REGISTER, '(', "remove", ')', ')', NULL); wocky_xmpp_connection_send_stanza_async (priv->conn, iqs, priv->cancellable, xep77_cancel_sent, self); g_free (iid); g_object_unref (iqs); } static void xep77_cancel_sent (GObject *source, GAsyncResult *res, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (priv->conn, res, &error)) { abort_connect_error (self, &error, "Failed to send unregister iq set"); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, xep77_cancel_recv, self); } static void xep77_cancel_recv (GObject *source, GAsyncResult *res, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyStanza *iq = NULL; WockyStanzaType type; WockyStanzaSubType sub_type; DEBUG (""); iq = wocky_xmpp_connection_recv_stanza_finish (priv->conn, res, &error); if (iq == NULL) { g_simple_async_result_set_from_error (priv->result, error); g_error_free (error); goto out; } wocky_stanza_get_type_info (iq, &type, &sub_type); DEBUG ("type == %d; sub_type: %d", type, sub_type); if (wocky_stanza_extract_stream_error (iq, &error)) { if (error->code != WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED) g_simple_async_result_set_from_error (priv->result, error); g_error_free (error); goto out; } if (type != WOCKY_STANZA_TYPE_IQ) { g_simple_async_result_set_error (priv->result, WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED, "Unregister: Invalid response"); goto out; } switch (sub_type) { int code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (iq, NULL, &error, NULL, NULL); switch (error->code) { case WOCKY_XMPP_ERROR_FORBIDDEN: case WOCKY_XMPP_ERROR_NOT_ALLOWED: code = WOCKY_CONNECTOR_ERROR_UNREGISTER_DENIED; break; default: code = WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED; } g_simple_async_result_set_error (priv->result, WOCKY_CONNECTOR_ERROR, code, "Unregister: %s", error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: /* Do nothing, we have already succeeded. */ break; default: g_simple_async_result_set_error (priv->result, WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED, "Unregister: Malformed Response"); break; } out: if (iq != NULL) g_object_unref (iq); if (priv->sock != NULL) { g_object_unref (priv->sock); priv->sock = NULL; } if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } g_simple_async_result_complete (priv->result); priv->state = WCON_DISCONNECTED; } static void xep77_begin (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; WockyStanza *iqs = NULL; gchar *iid = NULL; gchar *jid = NULL; DEBUG (""); if (!priv->encrypted && !priv->auth_insecure_ok) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_INSECURE, "Cannot register account without encryption"); return; } jid = g_strdup_printf ("%s@%s", priv->user, priv->domain); iid = wocky_xmpp_connection_new_id (priv->conn); iqs = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, jid, priv->domain, '@', "id", iid, '(', "query", ':', WOCKY_XEP77_NS_REGISTER, ')', NULL); wocky_xmpp_connection_send_stanza_async (priv->conn, iqs, priv->cancellable, xep77_begin_sent, self); g_free (jid); g_free (iid); g_object_unref (iqs); } static void xep77_begin_sent (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (priv->conn, result, &error)) { abort_connect_error (self, &error, "Failed to send register iq get"); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, xep77_begin_recv, self); } static void xep77_begin_recv (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyStanza *iq = NULL; WockyNode *query = NULL; WockyStanzaType type; WockyStanzaSubType sub_type; DEBUG (""); iq = wocky_xmpp_connection_recv_stanza_finish (priv->conn, result, &error); if (iq == NULL) { abort_connect_error (self, &error, "Failed to receive register iq set"); g_error_free (error); goto out; } wocky_stanza_get_type_info (iq, &type, &sub_type); if (type != WOCKY_STANZA_TYPE_IQ) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED, "Register: Response Invalid"); goto out; } switch (sub_type) { int code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (iq, NULL, &error, NULL, NULL); if (error->code == WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE) code = WOCKY_CONNECTOR_ERROR_REGISTRATION_UNAVAILABLE; else code = WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED; abort_connect_code (self, code, "Registration: %s", error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: DEBUG ("WOCKY_STANZA_SUB_TYPE_RESULT"); query = wocky_node_get_child_ns ( wocky_stanza_get_top_node (iq), "query", WOCKY_XEP77_NS_REGISTER); if (query == NULL) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED, "Malformed response to register iq"); goto out; } /* already registered. woo hoo. proceed to auth stage */ if (wocky_node_get_child (query, "registered") != NULL) { priv->reg_op = XEP77_NONE; sasl_request_auth (self, priv->features); goto out; } switch (priv->reg_op) { case XEP77_SIGNUP: xep77_signup_send (self, query); break; case XEP77_CANCEL: xep77_cancel_send (self); break; default: abort_connect_code (self, WOCKY_CONNECTOR_ERROR_UNKNOWN, "This should never happen: broken logic in connctor"); } break; default: DEBUG ("WOCKY_STANZA_SUB_TYPE_*"); abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED, "Register: Response Invalid"); break; } out: if (iq != NULL) g_object_unref (iq); } static void xep77_signup_send (WockyConnector *self, WockyNode *req) { WockyConnectorPrivate *priv = self->priv; WockyStanza *riq = NULL; WockyNode *reg = NULL; GSList *arg = NULL; gchar *jid = g_strdup_printf ("%s@%s", priv->user, priv->domain); gchar *iid = wocky_xmpp_connection_new_id (priv->conn); guint args = 0; DEBUG (""); riq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, jid, priv->domain, '@', "id", iid, NULL); reg = wocky_node_add_child_ns (wocky_stanza_get_top_node (riq), "query", WOCKY_XEP77_NS_REGISTER); for (arg = req->children; arg != NULL; arg = g_slist_next (arg)) { gchar *value = NULL; WockyNode *a = (WockyNode *) arg->data; if (!wocky_strdiff ("instructions", a->name)) continue; else if (!wocky_strdiff ("username", a->name)) value = priv->user; else if (!wocky_strdiff ("password", a->name)) value = priv->pass; else if (!wocky_strdiff ("email", a->name)) if ((priv->email != NULL) && *(priv->email) != '0') value = priv->email; else { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED, "Registration parameter %s missing", a->name); goto out; } else { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_UNSUPPORTED, "Did not understand '%s' registration parameter", a->name); goto out; } DEBUG ("%s := %s", a->name, value); wocky_node_add_child_with_content (reg, a->name, value); args++; } /* we understood all args, and there was at least one of them: */ if (args > 0) wocky_xmpp_connection_send_stanza_async (priv->conn, riq, priv->cancellable, xep77_signup_sent, self); else abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_EMPTY, "Registration without parameters makes no sense"); out: g_object_unref (riq); g_free (jid); g_free (iid); } static void xep77_signup_sent (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (priv->conn, result, &error)) { abort_connect_error (self, &error, "Failed to send registration"); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, xep77_signup_recv, self); } static void xep77_signup_recv (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyStanza *iq = NULL; WockyStanzaType type; WockyStanzaSubType sub_type; DEBUG (""); iq = wocky_xmpp_connection_recv_stanza_finish (priv->conn, result, &error); if (iq == NULL) { abort_connect_error (self, &error, "Failed to receive register result"); g_error_free (error); return; } wocky_stanza_get_type_info (iq, &type, &sub_type); if (type != WOCKY_STANZA_TYPE_IQ) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED, "Register: Response Invalid"); goto out; } switch (sub_type) { int code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (iq, NULL, &error, NULL, NULL); switch (error->code) { case WOCKY_XMPP_ERROR_CONFLICT: code = WOCKY_CONNECTOR_ERROR_REGISTRATION_CONFLICT; break; case WOCKY_XMPP_ERROR_NOT_ACCEPTABLE: code = WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED; break; default: code = WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED; } abort_connect_code (self, code, "Registration: %s %s", wocky_xmpp_error_string (error->code), error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: DEBUG ("WOCKY_STANZA_SUB_TYPE_RESULT"); /* successfully registered. woo hoo. proceed to auth stage */ priv->reg_op = XEP77_NONE; sasl_request_auth (self, priv->features); break; default: DEBUG ("WOCKY_STANZA_SUB_TYPE_*"); abort_connect_code (self, WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED, "Register: Response Invalid"); break; } out: g_object_unref (iq); } /* ************************************************************************* */ /* BIND calls */ static void iq_bind_resource (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; gchar *id = wocky_xmpp_connection_new_id (priv->conn); WockyNode *bind; WockyStanza *iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '@', "id", id, '(', "bind", ':', WOCKY_XMPP_NS_BIND, '*', &bind, ')', NULL); /* if we have a specific resource to ask for, ask for it: otherwise the * server will make one up for us */ if ((priv->resource != NULL) && (*priv->resource != '\0')) wocky_node_add_child_with_content (bind, "resource", priv->resource); DEBUG ("sending bind iq set stanza"); wocky_xmpp_connection_send_stanza_async (priv->conn, iq, priv->cancellable, iq_bind_resource_sent_cb, self); g_free (id); g_object_unref (iq); } static void iq_bind_resource_sent_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; if (!wocky_xmpp_connection_send_stanza_finish (priv->conn, result, &error)) { abort_connect_error (self, &error, "Failed to send bind iq set"); g_error_free (error); return; } DEBUG ("bind iq set stanza sent"); wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, iq_bind_resource_recv_cb, data); } static void iq_bind_resource_recv_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyStanza *reply = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType sub = WOCKY_STANZA_SUB_TYPE_NONE; reply = wocky_xmpp_connection_recv_stanza_finish (priv->conn, result, &error); DEBUG ("bind iq response stanza received"); if (reply == NULL) { abort_connect_error (self, &error, "Failed to receive bind iq result"); g_error_free (error); return; } if (stream_error_abort (self, reply)) goto out; wocky_stanza_get_type_info (reply, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_BIND_FAILED, "Bind iq response invalid"); goto out; } switch (sub) { WockyNode *node = NULL; WockyConnectorError code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (reply, NULL, &error, NULL, NULL); switch (error->code) { case WOCKY_XMPP_ERROR_BAD_REQUEST: code = WOCKY_CONNECTOR_ERROR_BIND_INVALID; break; case WOCKY_XMPP_ERROR_NOT_ALLOWED: code = WOCKY_CONNECTOR_ERROR_BIND_DENIED; break; case WOCKY_XMPP_ERROR_CONFLICT: code = WOCKY_CONNECTOR_ERROR_BIND_CONFLICT; break; default: code = WOCKY_CONNECTOR_ERROR_BIND_REJECTED; } abort_connect_code (self, code, "resource binding: %s", wocky_xmpp_error_string (error->code)); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: node = wocky_node_get_child ( wocky_stanza_get_top_node (reply), "bind"); if (node != NULL) node = wocky_node_get_child (node, "jid"); /* store the returned id (or the original if none came back)*/ g_free (priv->identity); if ((node != NULL) && (node->content != NULL) && *(node->content)) priv->identity = g_strdup (node->content); else priv->identity = g_strdup (priv->jid); priv->state = WCON_XMPP_BOUND; establish_session (self); break; default: abort_connect_code (self, WOCKY_CONNECTOR_ERROR_BIND_FAILED, "Bizarre response to bind iq set"); break; } out: g_object_unref (reply); } /* ************************************************************************* */ /* final stage: establish a session, if so advertised: */ void establish_session (WockyConnector *self) { WockyConnectorPrivate *priv = self->priv; WockyNode *feat = (priv->features != NULL) ? wocky_stanza_get_top_node (priv->features) : NULL; /* _if_ session setup is advertised, a session _must_ be established to * * allow presence/messaging etc to work. If not, it is not important */ if ((feat != NULL) && wocky_node_get_child_ns (feat, "session", WOCKY_XMPP_NS_SESSION)) { WockyXmppConnection *conn = priv->conn; gchar *id = wocky_xmpp_connection_new_id (conn); WockyStanza *session = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '@', "id", id, '(', "session", ':', WOCKY_XMPP_NS_SESSION, ')', NULL); wocky_xmpp_connection_send_stanza_async (conn, session, priv->cancellable, establish_session_sent_cb, self); g_object_unref (session); g_free (id); } else if (priv->reg_op == XEP77_CANCEL) { /* sessions unavailable and we are cancelling our registration: * * enter the xep77 code instead of completing the _async call */ xep77_begin (self); } else { GSimpleAsyncResult *tmp = priv->result; if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } priv->result = NULL; g_simple_async_result_complete (tmp); g_object_unref (tmp); } } static void establish_session_sent_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; if (!wocky_xmpp_connection_send_stanza_finish (priv->conn, result, &error)) { abort_connect_error (self, &error, "Failed to send session iq set"); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, establish_session_recv_cb, data); } static void establish_session_recv_cb (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; WockyConnector *self = WOCKY_CONNECTOR (data); WockyConnectorPrivate *priv = self->priv; WockyStanza *reply = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType sub = WOCKY_STANZA_SUB_TYPE_NONE; reply = wocky_xmpp_connection_recv_stanza_finish (priv->conn, result, &error); if (reply == NULL) { abort_connect_error (self, &error, "Failed to receive session iq result"); g_error_free (error); return; } if (stream_error_abort (self, reply)) goto out; wocky_stanza_get_type_info (reply, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_SESSION_FAILED, "Session iq response invalid"); goto out; } switch (sub) { WockyConnectorError code; GSimpleAsyncResult *tmp; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (reply, NULL, &error, NULL, NULL); switch (error->code) { case WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR: code = WOCKY_CONNECTOR_ERROR_SESSION_FAILED; break; case WOCKY_XMPP_ERROR_FORBIDDEN: code = WOCKY_CONNECTOR_ERROR_SESSION_DENIED; break; case WOCKY_XMPP_ERROR_CONFLICT: code = WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT; break; default: code = WOCKY_CONNECTOR_ERROR_SESSION_REJECTED; } abort_connect_code (self, code, "establish session: %s", wocky_xmpp_error_string (error->code)); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: if (priv->reg_op == XEP77_CANCEL) { /* session initialised: if we were cancelling our account * * we can now start the xep77 cancellation process */ xep77_begin (self); } else { if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } tmp = priv->result; g_simple_async_result_complete (tmp); g_object_unref (tmp); } break; default: abort_connect_code (self, WOCKY_CONNECTOR_ERROR_SESSION_FAILED, "Bizarre response to session iq set"); break; } out: g_object_unref (reply); } static void connector_propagate_jid_and_sid (WockyConnector *self, gchar **jid, gchar **sid) { if (jid != NULL) { if (*jid != NULL) g_warning ("overwriting non-NULL gchar * pointer arg (JID)"); *jid = g_strdup (self->priv->identity); } if (sid != NULL) { if (*sid != NULL) g_warning ("overwriting non-NULL gchar * pointer arg (Session ID)"); *sid = g_strdup (self->priv->session_id); } } /* ************************************************************************* * exposed methods * ************************************************************************* */ /** * wocky_connector_connect_finish: * @self: a #WockyConnector instance. * @res: a #GAsyncResult (from your wocky_connector_connect_async() callback). * @jid: (%NULL to ignore) the user JID from the server is stored here. * @sid: (%NULL to ignore) the Session ID is stored here. * @error: (%NULL to ignore) the #GError (if any) is sored here. * * Called by the callback passed to wocky_connector_connect_async(). * * Returns: a #WockyXmppConnection instance (success), or %NULL (failure). */ WockyXmppConnection * wocky_connector_connect_finish (WockyConnector *self, GAsyncResult *res, gchar **jid, gchar **sid, GError **error) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (res); if (g_simple_async_result_propagate_error (result, error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (self), wocky_connector_connect_async), NULL); connector_propagate_jid_and_sid (self, jid, sid); return self->priv->conn; } /** * wocky_connector_register_finish: * @self: a #WockyConnector instance. * @res: a #GAsyncResult (from your wocky_connector_register_async() callback). * @jid: (%NULL to ignore) the JID in effect after connection is stored here. * @sid: (%NULL to ignore) the Session ID after connection is stored here. * @error: (%NULL to ignore) the #GError (if any) is stored here. * * Called by the callback passed to wocky_connector_register_async(). * * Returns: a #WockyXmppConnection instance (success), or %NULL (failure). */ WockyXmppConnection * wocky_connector_register_finish (WockyConnector *self, GAsyncResult *res, gchar **jid, gchar **sid, GError **error) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (res); if (g_simple_async_result_propagate_error (result, error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (self), wocky_connector_register_async), NULL); connector_propagate_jid_and_sid (self, jid, sid); return self->priv->conn; } /** * wocky_connector_unregister_finish: * @self: a #WockyConnector instance. * @res: a #GAsyncResult (from the wocky_connector_unregister_async() callback). * @error: (%NULL to ignore) the #GError (if any) is stored here. * * Called by the callback passed to wocky_connector_unregister_async(). * * Returns: a #gboolean value %TRUE (success), or %FALSE (failure). */ gboolean wocky_connector_unregister_finish (WockyConnector *self, GAsyncResult *res, GError **error) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (res); GObject *obj = G_OBJECT (self); if (g_simple_async_result_propagate_error (result, error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (res, obj, wocky_connector_unregister_async), FALSE); return TRUE; } static void connector_connect_async (WockyConnector *self, gpointer source_tag, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer user_data) { WockyConnectorPrivate *priv = self->priv; /* 'host' is (by default) the part of the jid after the @ * it must be non-empty (although this test may need to be changed * for serverless XMPP (eg 'Bonjour')): if the xmpp_host property * is set, it takes precedence for the purposes of finding a * an XMPP server: Otherwise we look for a SRV record for 'host', * falling back to a direct connection to 'host' if that fails. */ gchar *node = NULL; /* username */ /* @ */ gchar *host = NULL; /* domain.tld */ /* / */ gchar *uniq = NULL; /* uniquifier */ if (priv->result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), cb, user_data, WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_IN_PROGRESS, "Connection already established or in progress"); return; } if (priv->cancellable != NULL) { g_warning ("Cancellable already present, but the async result is NULL; " "something's wrong with the state of the connector, please file a bug."); g_object_unref (priv->cancellable); priv->cancellable = NULL; } priv->result = g_simple_async_result_new (G_OBJECT (self), cb, user_data, source_tag); if (cancellable != NULL) priv->cancellable = g_object_ref (cancellable); wocky_decode_jid (priv->jid, &node, &host, &uniq); if (host == NULL) { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_BAD_JID, "Invalid JID %s", priv->jid); goto abort; } if (*host == '\0') { abort_connect_code (self, WOCKY_CONNECTOR_ERROR_BAD_JID, "Missing Domain %s", priv->jid); goto abort; } if (priv->resource == NULL) priv->resource = uniq; else g_free (uniq); priv->user = node; priv->domain = host; priv->client = g_socket_client_new (); priv->state = WCON_TCP_CONNECTING; /* if the user supplied a specific HOST or PORT, use those: if just a HOST is supplied, HOST:5222, if just a port, set HOST from the JID and use JIDHOST:PORT otherwise attempt to find a SRV record */ if ((priv->xmpp_host != NULL) || (priv->xmpp_port != 0)) { guint port = (priv->xmpp_port == 0) ? 5222 : priv->xmpp_port; const gchar *srv = (priv->xmpp_host == NULL) ? host : priv->xmpp_host; DEBUG ("host: %s; port: %d", priv->xmpp_host, priv->xmpp_port); connect_to_host_async (self, srv, port); } else { g_socket_client_connect_to_service_async (priv->client, host, "xmpp-client", priv->cancellable, tcp_srv_connected, self); } return; abort: g_free (host); g_free (node); g_free (uniq); return; } /** * wocky_connector_connect_async: * @self: a #WockyConnector instance. * @cancellable: an #GCancellable, or %NULL * @cb: a #GAsyncReadyCallback to call when the operation completes. * @user_data: a #gpointer to pass to the callback. * * Connect to the account/server specified by the @self. * @cb should invoke wocky_connector_connect_finish(). */ void wocky_connector_connect_async (WockyConnector *self, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer user_data) { connector_connect_async (self, wocky_connector_connect_async, cancellable, cb, user_data); } /** * wocky_connector_unregister_async: * @self: a #WockyConnector instance. * @cancellable: an #GCancellable, or %NULL * @cb: a #GAsyncReadyCallback to call when the operation completes. * @user_data: a #gpointer to pass to the callback @cb. * * Connect to the account/server specified by @self, and unregister (cancel) * the account there. * @cb should invoke wocky_connector_unregister_finish(). */ void wocky_connector_unregister_async (WockyConnector *self, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer user_data) { WockyConnectorPrivate *priv = self->priv; priv->reg_op = XEP77_CANCEL; connector_connect_async (self, wocky_connector_unregister_async, cancellable, cb, user_data); } /** * wocky_connector_register_async: * @self: a #WockyConnector instance. * @cancellable: an #GCancellable, or %NULL * @cb: a #GAsyncReadyCallback to call when the operation completes. * @user_data: a #gpointer to pass to the callback @cb. * * Connect to the account/server specified by @self, register (set up) * the account there and then log in to it. * @cb should invoke wocky_connector_register_finish(). */ void wocky_connector_register_async (WockyConnector *self, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer user_data) { WockyConnectorPrivate *priv = self->priv; priv->reg_op = XEP77_SIGNUP; connector_connect_async (self, wocky_connector_register_async, cancellable, cb, user_data); } /** * wocky_connector_new: * @jid: a JID (user AT domain). * @pass: the password. * @resource: the resource (sans '/'), or NULL to autogenerate one. * @auth_registry: a #WockyAuthRegistry, or %NULL * @tls_handler: a #WockyTLSHandler, or %NULL * * Connect to the account/server specified by @self. * To set other #WockyConnector properties, use g_object_new() instead. * * Returns: a #WockyConnector instance which can be used to connect to, * register or cancel an account */ WockyConnector * wocky_connector_new (const gchar *jid, const gchar *pass, const gchar *resource, WockyAuthRegistry *auth_registry, WockyTLSHandler *tls_handler) { return g_object_new (WOCKY_TYPE_CONNECTOR, "jid", jid, "password", pass, "resource", resource, "auth-registry", auth_registry, "tls-handler", tls_handler, NULL); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-debug.h0000644000175000017500000000241512050202021022550 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_DEBUG_H__ #define __WOCKY_DEBUG_H__ G_BEGIN_DECLS typedef enum { /*< private > */ WOCKY_DEBUG_TRANSPORT = 1 << 0, WOCKY_DEBUG_NET = 1 << 1, WOCKY_DEBUG_XMPP_READER = 1 << 2, WOCKY_DEBUG_XMPP_WRITER = 1 << 3, WOCKY_DEBUG_AUTH = 1 << 4, WOCKY_DEBUG_SSL = 1 << 5, WOCKY_DEBUG_RMULTICAST = 1 << 6, WOCKY_DEBUG_RMULTICAST_SENDER = 1 << 7, WOCKY_DEBUG_MUC_CONNECTION = 1 << 8, WOCKY_DEBUG_BYTESTREAM = 1 << 9, WOCKY_DEBUG_FILE_TRANSFER = 1 << 10, WOCKY_DEBUG_PORTER = 1 << 11, WOCKY_DEBUG_CONNECTOR = 1 << 12, WOCKY_DEBUG_ROSTER = 1 << 13, WOCKY_DEBUG_TLS = 1 << 14, WOCKY_DEBUG_PUBSUB = 1 << 15, WOCKY_DEBUG_DATA_FORM = 1 << 16, WOCKY_DEBUG_PING = 1 << 17, WOCKY_DEBUG_HEARTBEAT = 1 << 18, WOCKY_DEBUG_PRESENCE = 1 << 19, WOCKY_DEBUG_CONNECTION_FACTORY= 1 << 20, } WockyDebugFlags; #define WOCKY_DEBUG_XMPP (WOCKY_DEBUG_XMPP_READER | WOCKY_DEBUG_XMPP_WRITER) void wocky_debug_set_flags (WockyDebugFlags flags); G_END_DECLS #endif telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pep-service.c0000644000175000017500000003134312051446215023721 0ustar00wjtwjt00000000000000/* * wocky-pep-service.c - WockyPepService * Copyright © 2009,2012 Collabora Ltd. * * 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 */ /** * SECTION: wocky-pep-service * @title: WockyPepService * @short_description: Object to represent a single PEP service * @include: wocky/wocky-pep-service.h * * Object to aid with looking up PEP nodes and listening for changes. */ #include "wocky-pep-service.h" #include "wocky-pubsub-helpers.h" #include "wocky-porter.h" #include "wocky-utils.h" #include "wocky-namespaces.h" #include "wocky-signals-marshal.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PUBSUB #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyPepService, wocky_pep_service, G_TYPE_OBJECT) /* signal enum */ enum { CHANGED, LAST_SIGNAL, }; static guint signals[LAST_SIGNAL] = {0}; enum { PROP_NODE = 1, PROP_SUBSCRIBE, }; /* private structure */ struct _WockyPepServicePrivate { WockySession *session; WockyPorter *porter; WockyContactFactory *contact_factory; gchar *node; gboolean subscribe; guint handler_id; gboolean dispose_has_run; }; static void wocky_pep_service_init (WockyPepService *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_PEP_SERVICE, WockyPepServicePrivate); } static void wocky_pep_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; switch (property_id) { case PROP_NODE: priv->node = g_value_dup_string (value); break; case PROP_SUBSCRIBE: priv->subscribe = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pep_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; switch (property_id) { case PROP_NODE: g_value_set_string (value, priv->node); break; case PROP_SUBSCRIBE: g_value_set_boolean (value, priv->subscribe); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pep_service_dispose (GObject *object) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->porter != NULL) { g_assert (priv->handler_id != 0); wocky_porter_unregister_handler (priv->porter, priv->handler_id); g_object_unref (priv->porter); } if (priv->contact_factory != NULL) g_object_unref (priv->contact_factory); if (G_OBJECT_CLASS (wocky_pep_service_parent_class)->dispose) G_OBJECT_CLASS (wocky_pep_service_parent_class)->dispose (object); } static void wocky_pep_service_finalize (GObject *object) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; g_free (priv->node); G_OBJECT_CLASS (wocky_pep_service_parent_class)->finalize (object); } static void wocky_pep_service_constructed (GObject *object) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; g_assert (priv->node != NULL); } static void wocky_pep_service_class_init (WockyPepServiceClass *wocky_pep_service_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_pep_service_class); GParamSpec *param_spec; g_type_class_add_private (wocky_pep_service_class, sizeof (WockyPepServicePrivate)); object_class->set_property = wocky_pep_service_set_property; object_class->get_property = wocky_pep_service_get_property; object_class->dispose = wocky_pep_service_dispose; object_class->finalize = wocky_pep_service_finalize; object_class->constructed = wocky_pep_service_constructed; /** * WockyPepService:node: * * Namespace of the PEP node. */ param_spec = g_param_spec_string ("node", "node", "namespace of the pep node", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NODE, param_spec); /** * WockyPepService:subscribe: * * %TRUE if Wocky is to subscribe to the notifications of the node. */ param_spec = g_param_spec_boolean ("subscribe", "subscribe", "if TRUE, Wocky will subscribe to the notifications of the node", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUBSCRIBE, param_spec); /** * WockyPepService::changed: * @self: a #WockyPepService object * @contact: the #WockyBareContact who changed the node * @stanza: the #WockyStanza * @item: the first—and typically only—<item> element in @stanza, or * %NULL if there is none. * * Emitted when the node value changes. */ signals[CHANGED] = g_signal_new ("changed", G_OBJECT_CLASS_TYPE (wocky_pep_service_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_OBJECT_POINTER, G_TYPE_NONE, 3, WOCKY_TYPE_BARE_CONTACT, WOCKY_TYPE_STANZA, G_TYPE_POINTER); } /** * wocky_pep_service_new: * @node: the namespace of the PEP node * @subscribe: %TRUE if Wocky is to subscribe to the notifications of * the node, otherwise %FALSE * * A convenience function to create a new #WockyPepService object. * * Returns: a new #WockyPepService */ WockyPepService * wocky_pep_service_new (const gchar *node, gboolean subscribe) { return g_object_new (WOCKY_TYPE_PEP_SERVICE, "node", node, "subscribe", subscribe, NULL); } static gboolean msg_event_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyPepService *self = WOCKY_PEP_SERVICE (user_data); WockyPepServicePrivate *priv = self->priv; const gchar *from; WockyBareContact *contact; WockyStanzaSubType sub_type; WockyNode *event, *items, *item; from = wocky_stanza_get_from (stanza); if (from == NULL) { DEBUG ("No 'from' attribute; ignoring event"); return FALSE; } wocky_stanza_get_type_info (stanza, NULL, &sub_type); /* type of the message is supposed to be 'headline' but old ejabberd * omits it */ if (sub_type != WOCKY_STANZA_SUB_TYPE_NONE && sub_type != WOCKY_STANZA_SUB_TYPE_HEADLINE) { return FALSE; } event = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "event", WOCKY_XMPP_NS_PUBSUB_EVENT); g_return_val_if_fail (event != NULL, FALSE); items = wocky_node_get_child (event, "items"); g_return_val_if_fail (items != NULL, FALSE); item = wocky_node_get_child (items, "item"); contact = wocky_contact_factory_ensure_bare_contact ( priv->contact_factory, from); g_signal_emit (G_OBJECT (self), signals[CHANGED], 0, contact, stanza, item); g_object_unref (contact); return TRUE; } /** * wocky_pep_service_start: * @self: a #WockyPepService object * @session: a #WockySession object * * Start listening to the PEP node @node and signal changes by using * #WockyPepService::changed. */ void wocky_pep_service_start (WockyPepService *self, WockySession *session) { WockyPepServicePrivate *priv = self->priv; g_assert (priv->session == NULL); priv->session = session; priv->porter = wocky_session_get_porter (priv->session); g_object_ref (priv->porter); priv->contact_factory = wocky_session_get_contact_factory (priv->session); g_object_ref (priv->contact_factory); /* Register event handler */ priv->handler_id = wocky_porter_register_handler_from_anyone (priv->porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_MAX, msg_event_cb, self, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", priv->node, ')', ')', NULL); /* TODO: subscribe to node if needed */ } static void send_query_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); GError *error = NULL; WockyStanza *reply; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, &error); if (reply == NULL) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gpointer (result, reply, g_object_unref); } g_simple_async_result_complete (result); g_object_unref (result); } /** * wocky_pep_service_get_async: * @self: a #WockyPepService object * @contact: a #WockyBareContact object * @cancellable: an optional #GCancellable object, or %NULL * @callback: a function to call when the node is retrieved * @user_data: user data for @callback * * Starts an asynchronous operation to get the PEP node, * #WockyPepService:node. * * When the operation is complete, @callback will be called and the * function should call wocky_pep_service_get_finish(). */ void wocky_pep_service_get_async (WockyPepService *self, WockyBareContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPepServicePrivate *priv = self->priv; WockyStanza *msg; GSimpleAsyncResult *result; const gchar *jid; if (priv->porter == NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED, "Service has not been started"); return; } jid = wocky_bare_contact_get_jid (contact); msg = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, jid, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "items", '@', "node", priv->node, ')', ')', NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pep_service_get_async); wocky_porter_send_iq_async (priv->porter, msg, cancellable, send_query_cb, result); g_object_unref (msg); } /** * wocky_pep_service_get_finish: * @self: a #WockyPepService object * @result: a #GAsyncResult * @item: (out) (allow-none): on success, the first <item> element * in the result, or %NULL if @self has no published items. * @error: a location to store a #GError if an error occurs * * Finishes an asynchronous operation to get the PEP node, * #WockyPepService:node. For more details, see * wocky_pep_service_get_async(). * * Returns: the #WockyStanza retrieved from getting the PEP node. */ WockyStanza * wocky_pep_service_get_finish (WockyPepService *self, GAsyncResult *result, WockyNode **item, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); WockyStanza *reply; if (g_simple_async_result_propagate_error (simple, error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_pep_service_get_async), NULL); reply = WOCKY_STANZA (g_simple_async_result_get_op_res_gpointer (simple)); if (item != NULL) { WockyNode *pubsub_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (reply), "pubsub", WOCKY_XMPP_NS_PUBSUB); WockyNode *items_node = NULL; if (pubsub_node != NULL) items_node = wocky_node_get_child (pubsub_node, "items"); if (items_node != NULL) *item = wocky_node_get_child (items_node, "item"); else *item = NULL; } return g_object_ref (reply); } /** * wocky_pep_service_make_publish_stanza: * @self: a #WockyPepService * @item: a location to store the item #WockyNode, or %NULL * * Generates a new IQ type='set' PEP publish stanza. * * Returns: a new #WockyStanza PEP publish stanza; free with g_object_unref() */ WockyStanza * wocky_pep_service_make_publish_stanza (WockyPepService *self, WockyNode **item) { WockyPepServicePrivate *priv = self->priv; return wocky_pubsub_make_publish_stanza (NULL, priv->node, NULL, NULL, item); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-c2s-porter.c0000644000175000017500000017417712051446215023514 0ustar00wjtwjt00000000000000/* * wocky-c2s-porter.c - Source for WockyC2SPorter * Copyright (C) 2009-2011 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ /** * SECTION: wocky-c2s-porter * @title: WockyC2SPorter * @short_description: Wrapper around a #WockyXmppConnection providing a * higher level API. * * Sends and receives #WockyStanza from an underlying * #WockyXmppConnection. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-c2s-porter.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-porter.h" #include "wocky-utils.h" #include "wocky-namespaces.h" #include "wocky-contact-factory.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PORTER #include "wocky-debug-internal.h" static void wocky_porter_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (WockyC2SPorter, wocky_c2s_porter, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_PORTER, wocky_porter_iface_init)); /* properties */ enum { PROP_CONNECTION = 1, PROP_FULL_JID, PROP_BARE_JID, PROP_RESOURCE, }; /* private structure */ struct _WockyC2SPorterPrivate { gboolean dispose_has_run; gboolean forced_shutdown; gchar *full_jid; gchar *bare_jid; gchar *resource; gchar *domain; /* Queue of (sending_queue_elem *) */ GQueue *sending_queue; GCancellable *receive_cancellable; gboolean sending_whitespace_ping; GSimpleAsyncResult *close_result; gboolean waiting_to_close; gboolean remote_closed; gboolean local_closed; GCancellable *close_cancellable; GSimpleAsyncResult *force_close_result; GCancellable *force_close_cancellable; /* guint => owned (StanzaHandler *) */ GHashTable *handlers_by_id; /* Sort listed (by decreasing priority) of borrowed (StanzaHandler *) */ GList *handlers; guint next_handler_id; /* (const gchar *) => owned (StanzaIqHandler *) * This key is the ID of the IQ */ GHashTable *iq_reply_handlers; gboolean power_saving_mode; /* Queue of (owned WockyStanza *) */ GQueue *unimportant_queue; /* List of (owned WockyStanza *) */ GQueue queueable_stanza_patterns; WockyXmppConnection *connection; }; typedef struct { WockyC2SPorter *self; WockyStanza *stanza; GCancellable *cancellable; GSimpleAsyncResult *result; gulong cancelled_sig_id; } sending_queue_elem; static void wocky_c2s_porter_send_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); static sending_queue_elem * sending_queue_elem_new (WockyC2SPorter *self, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { sending_queue_elem *elem = g_slice_new0 (sending_queue_elem); elem->self = self; elem->stanza = g_object_ref (stanza); if (cancellable != NULL) elem->cancellable = g_object_ref (cancellable); elem->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_send_async); return elem; } static void sending_queue_elem_free (sending_queue_elem *elem) { g_object_unref (elem->stanza); if (elem->cancellable != NULL) { g_object_unref (elem->cancellable); if (elem->cancelled_sig_id != 0) g_signal_handler_disconnect (elem->cancellable, elem->cancelled_sig_id); /* FIXME: we should use g_cancellable_disconnect but it raises a dead * lock (#587300) */ } g_object_unref (elem->result); g_slice_free (sending_queue_elem, elem); } typedef enum { MATCH_ANYONE, MATCH_SERVER, MATCH_JID } SenderMatch; typedef struct { WockyStanzaType type; WockyStanzaSubType sub_type; SenderMatch sender_match; gchar *node; gchar *domain; gchar *resource; guint priority; WockyStanza *match; WockyPorterHandlerFunc callback; gpointer user_data; } StanzaHandler; static StanzaHandler * stanza_handler_new ( WockyStanzaType type, WockyStanzaSubType sub_type, SenderMatch sender_match, const gchar *from, guint priority, WockyStanza *stanza, WockyPorterHandlerFunc callback, gpointer user_data) { StanzaHandler *result = g_slice_new0 (StanzaHandler); result->type = type; result->sub_type = sub_type; result->priority = priority; result->callback = callback; result->user_data = user_data; result->sender_match = sender_match; if (stanza != NULL) result->match = g_object_ref (stanza); if (sender_match == MATCH_JID) { gboolean from_valid; g_assert (from != NULL); from_valid = wocky_decode_jid (from, &(result->node), &(result->domain), &(result->resource)); g_assert (from_valid); } else { g_assert (from == NULL); } return result; } static void stanza_handler_free (StanzaHandler *handler) { g_free (handler->node); g_free (handler->domain); g_free (handler->resource); if (handler->match != NULL) g_object_unref (handler->match); g_slice_free (StanzaHandler, handler); } typedef struct { WockyC2SPorter *self; GSimpleAsyncResult *result; GCancellable *cancellable; gulong cancelled_sig_id; gchar *recipient; gchar *id; gboolean sent; } StanzaIqHandler; static StanzaIqHandler * stanza_iq_handler_new (WockyC2SPorter *self, gchar *id, GSimpleAsyncResult *result, GCancellable *cancellable, const gchar *recipient) { StanzaIqHandler *handler = g_slice_new0 (StanzaIqHandler); gchar *to = NULL; if (recipient != NULL) { to = wocky_normalise_jid (recipient); if (to == NULL) { DEBUG ("Failed to normalise stanza recipient '%s'", recipient); to = g_strdup (recipient); } } handler->self = self; handler->result = result; handler->id = id; if (cancellable != NULL) handler->cancellable = g_object_ref (cancellable); handler->recipient = to; return handler; } static void stanza_iq_handler_remove_cancellable (StanzaIqHandler *handler) { if (handler->cancellable != NULL) { /* FIXME: we should use g_cancellable_disconnect but it raises a dead * lock (#587300) */ /* We might have already have disconnected the signal handler * from send_head_stanza(), so check whether it's still connected. */ if (handler->cancelled_sig_id > 0) g_signal_handler_disconnect (handler->cancellable, handler->cancelled_sig_id); g_object_unref (handler->cancellable); handler->cancelled_sig_id = 0; handler->cancellable = NULL; } } static void stanza_iq_handler_free (StanzaIqHandler *handler) { if (handler->result != NULL) g_object_unref (handler->result); stanza_iq_handler_remove_cancellable (handler); g_free (handler->id); g_free (handler->recipient); g_slice_free (StanzaIqHandler, handler); } static void stanza_iq_handler_maybe_remove (StanzaIqHandler *handler) { /* Always wait till the iq sent operation has finished and something * completed the operation from the perspective of the API user */ if (handler->sent && handler->result == NULL) { WockyC2SPorterPrivate *priv = handler->self->priv; g_hash_table_remove (priv->iq_reply_handlers, handler->id); } } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data); static void send_close (WockyC2SPorter *self); static gboolean handle_iq_reply (WockyPorter *porter, WockyStanza *reply, gpointer user_data); static void remote_connection_closed (WockyC2SPorter *self, GError *error); static void wocky_c2s_porter_init (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_C2S_PORTER, WockyC2SPorterPrivate); priv = self->priv; priv->sending_queue = g_queue_new (); priv->handlers_by_id = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) stanza_handler_free); /* these are guints, reserve 0 for "not a valid handler" */ priv->next_handler_id = 1; priv->handlers = NULL; priv->power_saving_mode = FALSE; priv->unimportant_queue = g_queue_new (); priv->iq_reply_handlers = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) stanza_iq_handler_free); } static void wocky_c2s_porter_dispose (GObject *object); static void wocky_c2s_porter_finalize (GObject *object); static void wocky_c2s_porter_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyC2SPorter *connection = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = connection->priv; switch (property_id) { gchar *node; case PROP_CONNECTION: g_assert (priv->connection == NULL); priv->connection = g_value_dup_object (value); g_assert (priv->connection != NULL); break; case PROP_FULL_JID: g_assert (priv->full_jid == NULL); /* construct-only */ g_assert (priv->bare_jid == NULL); g_assert (priv->resource == NULL); priv->full_jid = g_value_dup_string (value); g_assert (priv->full_jid != NULL); wocky_decode_jid (priv->full_jid, &node, &priv->domain, &priv->resource); priv->bare_jid = wocky_compose_jid (node, priv->domain, NULL); g_free (node); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_c2s_porter_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyC2SPorter *connection = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = connection->priv; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_FULL_JID: g_value_set_string (value, priv->full_jid); break; case PROP_BARE_JID: g_value_set_string (value, priv->bare_jid); break; case PROP_RESOURCE: g_value_set_string (value, priv->resource); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gboolean handle_stream_error (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); GError *error = NULL; gboolean ret = wocky_stanza_extract_stream_error (stanza, &error); /* If wocky_stanza_extract_stream_error() failed, @stanza wasn't a stream * error, in which case we are broken. */ g_return_val_if_fail (ret, FALSE); DEBUG ("Received stream error; consider the remote connection to be closed"); remote_connection_closed (self, error); g_error_free (error); return TRUE; } static void wocky_c2s_porter_constructed (GObject *object) { WockyC2SPorter *self = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = self->priv; if (G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->constructed) G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->constructed (object); g_assert (priv->connection != NULL); /* Register the IQ reply handler */ wocky_porter_register_handler_from_anyone (WOCKY_PORTER (self), WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, WOCKY_PORTER_HANDLER_PRIORITY_MAX, handle_iq_reply, self, NULL); wocky_porter_register_handler_from_anyone (WOCKY_PORTER (self), WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, WOCKY_PORTER_HANDLER_PRIORITY_MAX, handle_iq_reply, self, NULL); /* Register the stream error handler. We use _from_anyone() here because we can * trust servers not to relay spurious stream errors to us, and this feels * safer than risking missing a stream error to bugs in the _from_server() * checking code. */ wocky_porter_register_handler_from_anyone (WOCKY_PORTER (self), WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_MAX, handle_stream_error, self, NULL); } static void wocky_c2s_porter_class_init ( WockyC2SPorterClass *wocky_c2s_porter_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_c2s_porter_class); g_type_class_add_private (wocky_c2s_porter_class, sizeof (WockyC2SPorterPrivate)); object_class->constructed = wocky_c2s_porter_constructed; object_class->set_property = wocky_c2s_porter_set_property; object_class->get_property = wocky_c2s_porter_get_property; object_class->dispose = wocky_c2s_porter_dispose; object_class->finalize = wocky_c2s_porter_finalize; g_object_class_override_property (object_class, PROP_CONNECTION, "connection"); g_object_class_override_property (object_class, PROP_FULL_JID, "full-jid"); g_object_class_override_property (object_class, PROP_BARE_JID, "bare-jid"); g_object_class_override_property (object_class, PROP_RESOURCE, "resource"); } void wocky_c2s_porter_dispose (GObject *object) { WockyC2SPorter *self = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->connection != NULL) { g_object_unref (priv->connection); priv->connection = NULL; } if (priv->receive_cancellable != NULL) { g_warning ("Disposing an open XMPP porter"); g_cancellable_cancel (priv->receive_cancellable); g_object_unref (priv->receive_cancellable); priv->receive_cancellable = NULL; } if (priv->close_result != NULL) { g_object_unref (priv->close_result); priv->close_result = NULL; } if (priv->close_cancellable != NULL) { g_object_unref (priv->close_cancellable); priv->close_cancellable = NULL; } if (priv->force_close_result != NULL) { g_object_unref (priv->force_close_result); priv->force_close_result = NULL; } if (priv->force_close_cancellable != NULL) { g_object_unref (priv->force_close_cancellable); priv->force_close_cancellable = NULL; } if (G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->dispose) G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->dispose (object); } void wocky_c2s_porter_finalize (GObject *object) { WockyC2SPorter *self = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = self->priv; DEBUG ("finalize porter %p", self); /* sending_queue_elem keeps a ref on the Porter (through the * GSimpleAsyncResult) so it shouldn't be destroyed while there are * elements in the queue. */ g_assert_cmpuint (g_queue_get_length (priv->sending_queue), ==, 0); g_queue_free (priv->sending_queue); g_hash_table_unref (priv->handlers_by_id); g_list_free (priv->handlers); g_hash_table_unref (priv->iq_reply_handlers); g_queue_free (priv->unimportant_queue); g_queue_foreach (&priv->queueable_stanza_patterns, (GFunc) g_object_unref, NULL); g_queue_clear (&priv->queueable_stanza_patterns); g_free (priv->full_jid); g_free (priv->bare_jid); g_free (priv->resource); g_free (priv->domain); G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->finalize (object); } /** * wocky_c2s_porter_new: * @connection: #WockyXmppConnection which will be used to receive and send * #WockyStanza * @full_jid: the full JID of the user * * Convenience function to create a new #WockyC2SPorter. * * Returns: a new #WockyPorter. */ WockyPorter * wocky_c2s_porter_new (WockyXmppConnection *connection, const gchar *full_jid) { return g_object_new (WOCKY_TYPE_C2S_PORTER, "connection", connection, "full-jid", full_jid, NULL); } static void send_head_stanza (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; sending_queue_elem *elem; elem = g_queue_peek_head (priv->sending_queue); if (elem == NULL) /* Nothing to send */ return; if (elem->cancelled_sig_id != 0) { /* We are going to start sending the stanza. Lower layers are now * responsible of handling the cancellable. */ g_signal_handler_disconnect (elem->cancellable, elem->cancelled_sig_id); elem->cancelled_sig_id = 0; } wocky_xmpp_connection_send_stanza_async (priv->connection, elem->stanza, elem->cancellable, send_stanza_cb, g_object_ref (self)); g_signal_emit_by_name (self, "sending", elem->stanza); } static void terminate_sending_operations (WockyC2SPorter *self, GError *error) { WockyC2SPorterPrivate *priv = self->priv; sending_queue_elem *elem; g_return_if_fail (error != NULL); while ((elem = g_queue_pop_head (priv->sending_queue))) { g_simple_async_result_set_from_error (elem->result, error); g_simple_async_result_complete (elem->result); sending_queue_elem_free (elem); } } static gboolean sending_in_progress (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; return g_queue_get_length (priv->sending_queue) > 0 || priv->sending_whitespace_ping; } static void close_if_waiting (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; if (priv->waiting_to_close && !sending_in_progress (self)) { /* Nothing to send left and we are waiting to close the connection. */ DEBUG ("Queue has been flushed. Closing the connection."); send_close (self); } } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; GError *error = NULL; if (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, &error)) { /* Sending failed. Cancel this sending operation and all the others * pending ones as we won't be able to send any more stanza. */ terminate_sending_operations (self, error); g_error_free (error); } else { sending_queue_elem *elem = g_queue_pop_head (priv->sending_queue); if (elem == NULL) /* The elem could have been removed from the queue if its sending * operation has already been completed (for example by forcing to * close the connection). */ return; g_simple_async_result_complete (elem->result); sending_queue_elem_free (elem); if (g_queue_get_length (priv->sending_queue) > 0) { /* Send next stanza */ send_head_stanza (self); } } close_if_waiting (self); g_object_unref (self); } static void send_cancelled_cb (GCancellable *cancellable, gpointer user_data) { sending_queue_elem *elem = (sending_queue_elem *) user_data; WockyC2SPorterPrivate *priv = elem->self->priv; GError error = { G_IO_ERROR, G_IO_ERROR_CANCELLED, "Sending was cancelled" }; g_simple_async_result_set_from_error (elem->result, &error); g_simple_async_result_complete_in_idle (elem->result); g_queue_remove (priv->sending_queue, elem); sending_queue_elem_free (elem); } static void wocky_c2s_porter_send_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; sending_queue_elem *elem; if (priv->close_result != NULL || priv->force_close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING, "Porter is closing"); return; } elem = sending_queue_elem_new (self, stanza, cancellable, callback, user_data); g_queue_push_tail (priv->sending_queue, elem); if (g_queue_get_length (priv->sending_queue) == 1 && !priv->sending_whitespace_ping) { send_head_stanza (self); } else if (cancellable != NULL) { elem->cancelled_sig_id = g_cancellable_connect (cancellable, G_CALLBACK (send_cancelled_cb), elem, NULL); } } static gboolean wocky_c2s_porter_send_finish (WockyPorter *porter, GAsyncResult *result, GError **error) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_send_async), FALSE); return TRUE; } static void receive_stanza (WockyC2SPorter *self); static void complete_close (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; GSimpleAsyncResult *tmp; if (g_cancellable_is_cancelled (priv->close_cancellable)) { g_simple_async_result_set_error (priv->close_result, G_IO_ERROR, G_IO_ERROR_CANCELLED, "closing operation was cancelled"); } if (priv->close_cancellable) g_object_unref (priv->close_cancellable); priv->close_cancellable = NULL; if (priv->force_close_cancellable) g_object_unref (priv->force_close_cancellable); priv->force_close_cancellable = NULL; tmp = priv->close_result; priv->close_result = NULL; g_simple_async_result_complete (tmp); g_object_unref (tmp); } static gboolean stanza_is_from_server ( WockyC2SPorter *self, const gchar *nfrom) { return (nfrom == NULL || !wocky_strdiff (nfrom, self->priv->full_jid) || !wocky_strdiff (nfrom, self->priv->bare_jid) || !wocky_strdiff (nfrom, self->priv->domain)); } /* Return TRUE if not spoofed. */ static gboolean check_spoofing (WockyC2SPorter *self, WockyStanza *reply, const gchar *should_be_from) { const gchar *from; gchar *nfrom; gboolean ret = TRUE; from = wocky_stanza_get_from (reply); /* fast path for a byte-for-byte match */ if (G_LIKELY (!wocky_strdiff (from, should_be_from))) return TRUE; /* OK, we have to do some work */ nfrom = wocky_normalise_jid (from); /* nearly-as-fast path for a normalized match */ if (!wocky_strdiff (nfrom, should_be_from)) goto finally; /* if we sent an IQ without a 'to' attribute, it's to our server: allow it * to use our full/bare JID or domain to reply */ if (should_be_from == NULL) { if (stanza_is_from_server (self, nfrom)) goto finally; } /* if we sent an IQ to our full or bare JID, allow our server to omit 'to' * in the reply (Prosody 0.6.1 does this with the resulting error if we * send disco#info to our own bare JID), or to use our full JID. */ if (from == NULL || !wocky_strdiff (nfrom, self->priv->full_jid)) { if (!wocky_strdiff (should_be_from, self->priv->full_jid) || !wocky_strdiff (should_be_from, self->priv->bare_jid)) goto finally; } DEBUG ("'%s' (normal: '%s') attempts to spoof an IQ reply from '%s'", from == NULL ? "(null)" : from, nfrom == NULL ? "(null)" : nfrom, should_be_from == NULL ? "(null)" : should_be_from); DEBUG ("Our full JID is '%s' and our bare JID is '%s'", self->priv->full_jid, self->priv->bare_jid); ret = FALSE; finally: g_free (nfrom); return ret; } static gboolean handle_iq_reply (WockyPorter *porter, WockyStanza *reply, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; const gchar *id; StanzaIqHandler *handler; gboolean ret = FALSE; id = wocky_node_get_attribute (wocky_stanza_get_top_node (reply), "id"); if (id == NULL) { DEBUG ("Ignoring reply without IQ id"); return FALSE; } handler = g_hash_table_lookup (priv->iq_reply_handlers, id); if (handler == NULL) { DEBUG ("Ignored IQ reply"); return FALSE; } if (!check_spoofing (self, reply, handler->recipient)) return FALSE; if (handler->result != NULL) { GSimpleAsyncResult *r = handler->result; handler->result = NULL; /* Don't want to get cancelled during completion */ stanza_iq_handler_remove_cancellable (handler); g_simple_async_result_set_op_res_gpointer (r, reply, NULL); g_simple_async_result_complete (r); g_object_unref (r); ret = TRUE; } stanza_iq_handler_maybe_remove (handler); return ret; } static void handle_stanza (WockyC2SPorter *self, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; GList *l; const gchar *from; WockyStanzaType type; WockyStanzaSubType sub_type; gchar *node = NULL, *domain = NULL, *resource = NULL; gboolean is_from_server; gboolean handled = FALSE; wocky_stanza_get_type_info (stanza, &type, &sub_type); /* The from attribute of the stanza need not always be present, for example * when receiving roster items, so don't enforce it. */ from = wocky_stanza_get_from (stanza); if (from == NULL) { is_from_server = TRUE; } else if (wocky_decode_jid (from, &node, &domain, &resource)) { /* FIXME: the stanza should really ensure that 'from' and 'to' are * pre-validated and normalized so we don't have to do this again. */ gchar *nfrom = wocky_compose_jid (node, domain, resource); is_from_server = stanza_is_from_server (self, nfrom); g_free (nfrom); } else { is_from_server = FALSE; } for (l = priv->handlers; l != NULL && !handled; l = g_list_next (l)) { StanzaHandler *handler = (StanzaHandler *) l->data; if (type != handler->type && handler->type != WOCKY_STANZA_TYPE_NONE) continue; if (sub_type != handler->sub_type && handler->sub_type != WOCKY_STANZA_SUB_TYPE_NONE) continue; switch (handler->sender_match) { case MATCH_ANYONE: break; case MATCH_SERVER: if (!is_from_server) continue; break; case MATCH_JID: g_assert (handler->domain != NULL); if (wocky_strdiff (node, handler->node)) continue; if (wocky_strdiff (domain, handler->domain)) continue; /* If a resource was specified, we need to match against it. */ if (handler->resource != NULL && wocky_strdiff (resource, handler->resource)) continue; break; } /* Check if the stanza matches the pattern */ if (handler->match != NULL && !wocky_node_is_superset (wocky_stanza_get_top_node (stanza), wocky_stanza_get_top_node (handler->match))) continue; handled = handler->callback (WOCKY_PORTER (self), stanza, handler->user_data); } if (!handled) { DEBUG ("Stanza not handled"); if (type == WOCKY_STANZA_TYPE_IQ && (sub_type == WOCKY_STANZA_SUB_TYPE_GET || sub_type == WOCKY_STANZA_SUB_TYPE_SET)) wocky_porter_send_iq_error (WOCKY_PORTER (self), stanza, WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE, NULL); } g_free (node); g_free (domain); g_free (resource); } /* immediately handle any queued stanzas */ static void flush_unimportant_queue (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; while (!g_queue_is_empty (priv->unimportant_queue)) { WockyStanza *stanza = g_queue_pop_head (priv->unimportant_queue); handle_stanza (self, stanza); g_object_unref (stanza); } } /* create a list of patterns of stanzas that can be safely queued */ static void build_queueable_stanza_patterns (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; gchar **node_name = NULL; gchar *node_names [] = { "http://jabber.org/protocol/geoloc", "http://jabber.org/protocol/nick", "http://laptop.org/xmpp/buddy-properties", "http://laptop.org/xmpp/activities", "http://laptop.org/xmpp/current-activity", "http://laptop.org/xmpp/activity-properties", NULL}; for (node_name = node_names; *node_name != NULL ; node_name++) { WockyStanza *pattern = wocky_stanza_build ( WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", *node_name, ')', ')', NULL); g_queue_push_tail (&priv->queueable_stanza_patterns, pattern); } } static gboolean is_stanza_important (WockyC2SPorter *self, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; WockyNode *node = wocky_stanza_get_top_node (stanza); WockyStanzaType type; GList *l; wocky_stanza_get_type_info (stanza, &type, NULL); /* and are queueable */ if (type == WOCKY_STANZA_TYPE_PRESENCE) { const gchar *ptype = wocky_node_get_attribute (node, "type"); /* presence type is either missing or "unavailable" */ if ((ptype == NULL) || !wocky_strdiff (ptype, "unavailable")) { return FALSE; } } if (priv->queueable_stanza_patterns.length == 0) build_queueable_stanza_patterns (self); /* check whether stanza matches any of the queueable patterns */ for (l = priv->queueable_stanza_patterns.head; l != NULL; l = l->next) { if (wocky_node_is_superset (node, wocky_stanza_get_top_node ( WOCKY_STANZA (l->data)))) return FALSE; } /* everything else is important */ return TRUE; } static void queue_or_handle_stanza (WockyC2SPorter *self, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; if (priv->power_saving_mode) { if (is_stanza_important (self, stanza)) { flush_unimportant_queue (self); handle_stanza (self, stanza); } else { g_queue_push_tail (priv->unimportant_queue, g_object_ref (stanza)); } } else { handle_stanza (self, stanza); } } static void abort_pending_iqs (WockyC2SPorter *self, GError *error) { WockyC2SPorterPrivate *priv = self->priv; GHashTableIter iter; gpointer value; g_hash_table_iter_init (&iter, priv->iq_reply_handlers); while (g_hash_table_iter_next (&iter, NULL, &value)) { StanzaIqHandler *handler = value; if (handler->result == NULL) continue; /* Don't want to get cancelled during completion */ stanza_iq_handler_remove_cancellable (handler); g_simple_async_result_set_from_error (handler->result, error); g_simple_async_result_complete_in_idle (handler->result); g_object_unref (handler->result); handler->result = NULL; if (handler->sent) g_hash_table_iter_remove (&iter); } } static void remote_connection_closed (WockyC2SPorter *self, GError *error) { WockyC2SPorterPrivate *priv = self->priv; gboolean error_occured = TRUE; /* Completing a close operation and firing the remote-closed/remote-error * signals could make the library user unref the porter. So we take a * reference to ourself for the duration of this function. */ g_object_ref (self); /* Complete pending send IQ operations as we won't be able to receive their * IQ replies */ abort_pending_iqs (self, error); if (g_error_matches (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED)) error_occured = FALSE; /* This flag MUST be set before we emit the remote-* signals: If it is not * * some very subtle and hard to debug problems are created, which can in * * turn conceal further problems in the code. You have been warned. */ priv->remote_closed = TRUE; if (error_occured) { g_signal_emit_by_name (self, "remote-error", error->domain, error->code, error->message); } else { g_signal_emit_by_name (self, "remote-closed"); } if (priv->close_result != NULL && priv->local_closed) { if (error_occured) { /* We sent our close but something went wrong with the connection * so we won't be able to receive close from the other side. * Complete the close operation. */ g_simple_async_result_set_from_error (priv->close_result, error); } complete_close (self); } if (priv->receive_cancellable != NULL) { g_object_unref (priv->receive_cancellable); priv->receive_cancellable = NULL; } g_object_unref (self); } static void connection_force_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; GSimpleAsyncResult *r = priv->force_close_result; GError *error = NULL; /* null out the result so no-one else can use it after us * * this should never happen, but nullifying it lets us trap * * that internal inconsistency if it arises */ priv->force_close_result = NULL; priv->local_closed = TRUE; /* This can fail if the porter has put two * * wocky_xmpp_connection_force_close_async ops in flight * * at the same time: this is bad and should never happen: */ g_assert (r != NULL); if (!wocky_xmpp_connection_force_close_finish (WOCKY_XMPP_CONNECTION (source), res, &error)) { g_simple_async_result_set_from_error (r, error); g_error_free (error); } if (priv->receive_cancellable != NULL) { g_object_unref (priv->receive_cancellable); priv->receive_cancellable = NULL; } DEBUG ("XMPP connection has been closed; complete the force close operation"); g_simple_async_result_complete (r); g_object_unref (r); g_object_unref (self); } static void stanza_received_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; WockyStanza *stanza; GError *error = NULL; stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, &error); if (stanza == NULL) { if (g_error_matches (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED)) { DEBUG ("Remote connection has been closed"); } else { DEBUG ("Error receiving stanza: %s", error->message); } if (priv->force_close_result != NULL) { DEBUG ("Receive operation has been cancelled; "); if (!priv->forced_shutdown) { /* We are forcing the closing. Actually close the connection. */ DEBUG ("force shutdown of the XMPP connection"); g_object_ref (self); priv->forced_shutdown = TRUE; wocky_xmpp_connection_force_close_async (priv->connection, priv->force_close_cancellable, connection_force_close_cb, self); } else { DEBUG ("forced shutdown of XMPP connection already in progress"); } } else { remote_connection_closed (self, error); } g_error_free (error); return; } /* Calling out to a stanza handler could make the library user unref the * porter; hence, we take a reference to ourself for the rest of the * function. */ g_object_ref (self); queue_or_handle_stanza (self, stanza); g_object_unref (stanza); if (!priv->remote_closed) { /* We didn't detect any error on the stream, wait for next stanza */ receive_stanza (self); } else { DEBUG ("Remote connection has been closed, don't wait for next stanza"); DEBUG ("Remote connection has been closed; "); if (priv->forced_shutdown) { DEBUG ("forced shutdown of the XMPP connection already in progress"); } else if (priv->force_close_result != NULL) { DEBUG ("force shutdown of the XMPP connection"); g_object_ref (self); priv->forced_shutdown = TRUE; wocky_xmpp_connection_force_close_async (priv->connection, priv->force_close_cancellable, connection_force_close_cb, self); } } g_object_unref (self); } static void receive_stanza (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; wocky_xmpp_connection_recv_stanza_async (priv->connection, priv->receive_cancellable, stanza_received_cb, self); } static void wocky_c2s_porter_start (WockyPorter *porter) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; if (priv->receive_cancellable != NULL) /* Porter has already been started */ return; priv->receive_cancellable = g_cancellable_new (); receive_stanza (self); } static void close_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; GError *error = NULL; priv->local_closed = TRUE; if (!wocky_xmpp_connection_send_close_finish (WOCKY_XMPP_CONNECTION (source), res, &error)) { g_simple_async_result_set_from_error (priv->close_result, error); g_error_free (error); goto out; } if (!g_cancellable_is_cancelled (priv->close_cancellable) && !priv->remote_closed) { /* we'll complete the close operation once the remote side closes it's * connection */ return; } out: if (priv->close_result != NULL) { /* close operation could already be completed if the other side closes * before we send our close */ complete_close (self); } } static void send_close (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; wocky_xmpp_connection_send_close_async (priv->connection, NULL, close_sent_cb, self); priv->waiting_to_close = FALSE; } static void wocky_c2s_porter_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; if (priv->local_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSED, "Porter has already been closed"); return; } if (priv->receive_cancellable == NULL && !priv->remote_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED, "Porter has not been started"); return; } if (priv->close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another close operation is pending"); return; } if (priv->force_close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "A force close operation is pending"); return; } priv->close_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_close_async); g_assert (priv->close_cancellable == NULL); if (cancellable != NULL) priv->close_cancellable = g_object_ref (cancellable); g_signal_emit_by_name (self, "closing"); if (sending_in_progress (self)) { DEBUG ("Sending queue is not empty. Flushing it before " "closing the connection."); priv->waiting_to_close = TRUE; return; } send_close (self); } static gboolean wocky_c2s_porter_close_finish (WockyPorter *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_close_async), FALSE); return TRUE; } static gint compare_handler (StanzaHandler *a, StanzaHandler *b) { /* List is sorted by decreasing priority */ if (a->priority < b->priority) return 1; else if (a->priority > b->priority) return -1; else return 0; } static guint wocky_c2s_porter_register_handler_internal (WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, SenderMatch sender_match, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; StanzaHandler *handler; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); handler = stanza_handler_new (type, sub_type, sender_match, from, priority, stanza, callback, user_data); g_hash_table_insert (priv->handlers_by_id, GUINT_TO_POINTER (priv->next_handler_id), handler); priv->handlers = g_list_insert_sorted (priv->handlers, handler, (GCompareFunc) compare_handler); return priv->next_handler_id++; } static guint wocky_c2s_porter_register_handler_from_by_stanza (WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); g_return_val_if_fail (from != NULL, 0); return wocky_c2s_porter_register_handler_internal (self, type, sub_type, MATCH_JID, from, priority, callback, user_data, stanza); } static guint wocky_c2s_porter_register_handler_from_anyone_by_stanza ( WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); return wocky_c2s_porter_register_handler_internal (self, type, sub_type, MATCH_ANYONE, NULL, priority, callback, user_data, stanza); } /** * wocky_c2s_porter_register_handler_from_server_va: * @self: A #WockyC2SPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @ap: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * A va_list version of * wocky_c2s_porter_register_handler_from_server(); see that function for more * details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_c2s_porter_register_handler_from_server_va ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap) { guint ret; WockyStanza *stanza; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (self), 0); if (type == WOCKY_STANZA_TYPE_NONE) { stanza = NULL; g_return_val_if_fail ( (va_arg (ap, WockyNodeBuildTag) == 0) && "Pattern-matching is not supported when matching stanzas " "of any type", 0); } else { stanza = wocky_stanza_build_va (type, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ap); g_assert (stanza != NULL); } ret = wocky_c2s_porter_register_handler_from_server_by_stanza (self, type, sub_type, priority, callback, user_data, stanza); if (stanza != NULL) g_object_unref (stanza); return ret; } /** * wocky_c2s_porter_register_handler_from_server_by_stanza: * @self: A #WockyC2SPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @stanza: a #WockyStanza. The handler will match a stanza only if * the stanza received is a superset of the one passed to this * function, as per wocky_node_is_superset(). * * A #WockyStanza version of * wocky_c2s_porter_register_handler_from_server(); see that function for more * details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_c2s_porter_register_handler_from_server_by_stanza ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { g_return_val_if_fail (WOCKY_IS_C2S_PORTER (self), 0); if (type == WOCKY_STANZA_TYPE_NONE) g_return_val_if_fail (stanza == NULL, 0); else g_return_val_if_fail (WOCKY_IS_STANZA (stanza), 0); return wocky_c2s_porter_register_handler_internal (self, type, sub_type, MATCH_SERVER, NULL, priority, callback, user_data, stanza); } /** * wocky_c2s_porter_register_handler_from_server: * @self: A #WockyC2SPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @...: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * Registers a handler for incoming stanzas from the local user's server; that * is, stanzas with no "from" attribute, or where the sender is the user's own * bare or full JID. * * For example, to register a handler for roster pushes, call: * * |[ * id = wocky_c2s_porter_register_handler_from_server (porter, * WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_SET, * WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, roster_push_received_cb, NULL, * '(', * "query", ':', WOCKY_XMPP_NS_ROSTER, * ')', NULL); * ]| * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_c2s_porter_register_handler_from_server ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) { va_list ap; guint ret; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (self), 0); va_start (ap, user_data); ret = wocky_c2s_porter_register_handler_from_server_va (self, type, sub_type, priority, callback, user_data, ap); va_end (ap); return ret; } static void wocky_c2s_porter_unregister_handler (WockyPorter *porter, guint id) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; StanzaHandler *handler; handler = g_hash_table_lookup (priv->handlers_by_id, GUINT_TO_POINTER (id)); if (handler == NULL) { g_warning ("Trying to remove an unregistered handler: %u", id); return; } priv->handlers = g_list_remove (priv->handlers, handler); g_hash_table_remove (priv->handlers_by_id, GUINT_TO_POINTER (id)); } /** * wocky_c2s_porter_enable_power_saving_mode: * @porter: a #WockyC2SPorter * @enable: A boolean specifying whether power saving mode should be used * * Enable or disable power saving. In power saving mode, Wocky will * attempt to queue "uninteresting" stanza until it is either manually * flushed, until important stanza arrives, or until the power saving * mode is disabled. * * Queueable stanzas are: * * * <presence/> and * <presence type="unavailable"/>; * PEP updates for a hardcoded list of namespaces. * * * Whenever stanza is handled, all previously queued stanzas * (if any) are handled as well, in the order they arrived. This preserves * stanza ordering. * * Note that exiting the power saving mode will immediately handle any * queued stanzas. */ void wocky_c2s_porter_enable_power_saving_mode (WockyC2SPorter *porter, gboolean enable) { WockyC2SPorterPrivate *priv = porter->priv; if (priv->power_saving_mode && !enable) { flush_unimportant_queue (porter); } priv->power_saving_mode = enable; } static void send_iq_cancelled_cb (GCancellable *cancellable, gpointer user_data) { StanzaIqHandler *handler = (StanzaIqHandler *) user_data; GError error = { G_IO_ERROR, G_IO_ERROR_CANCELLED, "IQ sending was cancelled" }; /* The disconnect should always be disconnected if the result has been * finished */ g_assert (handler->result != NULL); g_simple_async_result_set_from_error (handler->result, &error); g_simple_async_result_complete_in_idle (handler->result); g_object_unref (handler->result); handler->result = NULL; stanza_iq_handler_maybe_remove (handler); } static void iq_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (source); StanzaIqHandler *handler = (StanzaIqHandler *) user_data; GError *error = NULL; handler->sent = TRUE; if (wocky_c2s_porter_send_finish (WOCKY_PORTER (self), res, &error)) goto finished; /* Raise an error */ if (handler->result != NULL) { GSimpleAsyncResult *r = handler->result; handler->result = NULL; /* Don't want to get cancelled during completion */ stanza_iq_handler_remove_cancellable (handler); g_simple_async_result_set_from_error (r, error); g_simple_async_result_complete (r); g_object_unref (r); } g_error_free (error); finished: stanza_iq_handler_maybe_remove (handler); } static void wocky_c2s_porter_send_iq_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; StanzaIqHandler *handler; const gchar *recipient; gchar *id = NULL; GSimpleAsyncResult *result; WockyStanzaType type; WockyStanzaSubType sub_type; if (priv->close_result != NULL || priv->force_close_result != NULL) { gchar *node = NULL; g_assert (stanza != NULL && wocky_stanza_get_top_node (stanza) != NULL); node = wocky_node_to_string (wocky_stanza_get_top_node (stanza)); g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING, "Porter is closing: iq '%s' aborted", node); g_free (node); return; } wocky_stanza_get_type_info (stanza, &type, &sub_type); if (type != WOCKY_STANZA_TYPE_IQ) goto wrong_stanza; if (sub_type != WOCKY_STANZA_SUB_TYPE_GET && sub_type != WOCKY_STANZA_SUB_TYPE_SET) goto wrong_stanza; recipient = wocky_stanza_get_to (stanza); /* Set an unique ID */ do { g_free (id); id = wocky_xmpp_connection_new_id (priv->connection); } while (g_hash_table_lookup (priv->iq_reply_handlers, id) != NULL); wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "id", id); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_send_iq_async); handler = stanza_iq_handler_new (self, id, result, cancellable, recipient); if (cancellable != NULL) { handler->cancelled_sig_id = g_cancellable_connect (cancellable, G_CALLBACK (send_iq_cancelled_cb), handler, NULL); } g_hash_table_insert (priv->iq_reply_handlers, id, handler); wocky_c2s_porter_send_async (WOCKY_PORTER (self), stanza, cancellable, iq_sent_cb, handler); return; wrong_stanza: g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_IQ, "Stanza is not an IQ query"); } static WockyStanza * wocky_c2s_porter_send_iq_finish (WockyPorter *self, GAsyncResult *result, GError **error) { WockyStanza *reply; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_send_iq_async), NULL); reply = g_simple_async_result_get_op_res_gpointer ( G_SIMPLE_ASYNC_RESULT (result)); return g_object_ref (reply); } static void wocky_c2s_porter_force_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; GError err = { WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED, "Porter was closed forcibly" }; if (priv->force_close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another force close operation is pending"); return; } if (priv->receive_cancellable == NULL && priv->local_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSED, "Porter has already been closed"); return; } if (priv->receive_cancellable == NULL && !priv->remote_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED, "Porter has not been started"); return; } /* Ensure to keep us alive during the closing */ g_object_ref (self); if (priv->close_result != NULL) { /* Finish pending close operation */ g_simple_async_result_set_from_error (priv->close_result, &err); g_simple_async_result_complete_in_idle (priv->close_result); g_object_unref (priv->close_result); priv->close_result = NULL; } else { /* the "closing" signal has already been fired when _close_async has * been called */ g_signal_emit_by_name (self, "closing"); } priv->force_close_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_force_close_async); g_assert (priv->force_close_cancellable == NULL); if (cancellable != NULL) priv->force_close_cancellable = g_object_ref (cancellable); /* force_close_result now keeps a ref on ourself so we can release the ref * without risking to destroy the object */ g_object_unref (self); /* Terminate all the pending sending operations */ terminate_sending_operations (self, &err); /* Terminate all the pending send IQ operations */ abort_pending_iqs (self, &err); if (priv->remote_closed) { /* forced shutdown in progress. noop */ if (priv->forced_shutdown) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED, "Porter is already executing a forced-shutdown"); g_object_unref (priv->force_close_result); priv->force_close_result = NULL; return; } /* No need to wait, close connection right now */ DEBUG ("remote is already closed, close the XMPP connection"); g_object_ref (self); priv->forced_shutdown = TRUE; wocky_xmpp_connection_force_close_async (priv->connection, priv->force_close_cancellable, connection_force_close_cb, self); return; } /* The operation will be completed when: * - the receive operation has been cancelled * - the XMPP connection has been closed */ g_cancellable_cancel (priv->receive_cancellable); } static gboolean wocky_c2s_porter_force_close_finish ( WockyPorter *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_force_close_async), FALSE); return TRUE; } static void send_whitespace_ping_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *res_out = user_data; WockyC2SPorter *self = WOCKY_C2S_PORTER ( g_async_result_get_source_object (G_ASYNC_RESULT (res_out))); WockyC2SPorterPrivate *priv = self->priv; GError *error = NULL; priv->sending_whitespace_ping = FALSE; if (!wocky_xmpp_connection_send_whitespace_ping_finish ( WOCKY_XMPP_CONNECTION (source), res, &error)) { g_simple_async_result_set_from_error (res_out, error); g_simple_async_result_complete (res_out); /* Sending the ping failed; there is no point in trying to send * anything else at this point. */ terminate_sending_operations (self, error); g_error_free (error); } else { g_simple_async_result_complete (res_out); /* Somebody could have tried sending a stanza while we were sending * the ping */ if (g_queue_get_length (priv->sending_queue) > 0) send_head_stanza (self); } close_if_waiting (self); g_object_unref (self); g_object_unref (res_out); } /** * wocky_c2s_porter_send_whitespace_ping_async: * @self: a #WockyC2SPorter * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous sending of a whitespace ping. When the operation is * finished @callback will be called. You can then call * wocky_c2s_porter_send_whitespace_ping_finish() to get the result of the * operation. * No pings are sent if there are already other stanzas or pings being sent * when this function is called; it would be useless. */ void wocky_c2s_porter_send_whitespace_ping_async (WockyC2SPorter *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorterPrivate *priv = self->priv; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_send_whitespace_ping_async); if (priv->close_result != NULL || priv->force_close_result != NULL) { g_simple_async_result_set_error (result, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING, "Porter is closing"); g_simple_async_result_complete_in_idle (result); } else if (sending_in_progress (self)) { g_simple_async_result_complete_in_idle (result); } else { priv->sending_whitespace_ping = TRUE; wocky_xmpp_connection_send_whitespace_ping_async (priv->connection, cancellable, send_whitespace_ping_cb, g_object_ref (result)); g_signal_emit_by_name (self, "sending", NULL); } g_object_unref (result); } /** * wocky_c2s_porter_send_whitespace_ping_finish: * @self: a #WockyC2SPorter * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes sending a whitespace ping. * * Returns: TRUE if the ping was succesfully sent, FALSE on error. */ gboolean wocky_c2s_porter_send_whitespace_ping_finish (WockyC2SPorter *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_c2s_porter_send_whitespace_ping_async); } static const gchar * wocky_c2s_porter_get_full_jid (WockyPorter *porter) { WockyC2SPorter *self; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (porter), NULL); self = (WockyC2SPorter *) porter; return self->priv->full_jid; } static const gchar * wocky_c2s_porter_get_bare_jid (WockyPorter *porter) { WockyC2SPorter *self; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (porter), NULL); self = (WockyC2SPorter *) porter; return self->priv->bare_jid; } static const gchar * wocky_c2s_porter_get_resource (WockyPorter *porter) { WockyC2SPorter *self; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (porter), NULL); self = (WockyC2SPorter *) porter; return self->priv->resource; } static void wocky_porter_iface_init (gpointer g_iface, gpointer iface_data) { WockyPorterInterface *iface = g_iface; iface->get_full_jid = wocky_c2s_porter_get_full_jid; iface->get_bare_jid = wocky_c2s_porter_get_bare_jid; iface->get_resource = wocky_c2s_porter_get_resource; iface->start = wocky_c2s_porter_start; iface->send_async = wocky_c2s_porter_send_async; iface->send_finish = wocky_c2s_porter_send_finish; iface->register_handler_from_by_stanza = wocky_c2s_porter_register_handler_from_by_stanza; iface->register_handler_from_anyone_by_stanza = wocky_c2s_porter_register_handler_from_anyone_by_stanza; iface->unregister_handler = wocky_c2s_porter_unregister_handler; iface->close_async = wocky_c2s_porter_close_async; iface->close_finish = wocky_c2s_porter_close_finish; iface->send_iq_async = wocky_c2s_porter_send_iq_async; iface->send_iq_finish = wocky_c2s_porter_send_iq_finish; iface->force_close_async = wocky_c2s_porter_force_close_async; iface->force_close_finish = wocky_c2s_porter_force_close_finish; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-node-tree.c0000644000175000017500000001232212051446215023355 0ustar00wjtwjt00000000000000/* * wocky-node-tree.c - Source for WockyNodeTree * Copyright (C) 2006-2010 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #include #include #include #include "wocky-node-tree.h" #include "wocky-node-private.h" G_DEFINE_TYPE(WockyNodeTree, wocky_node_tree, G_TYPE_OBJECT) /* properties */ enum { PROP_TOP_NODE = 1, }; struct _WockyNodeTreePrivate { gboolean dispose_has_run; WockyNode *node; }; static void wocky_node_tree_init (WockyNodeTree *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_NODE_TREE, WockyNodeTreePrivate); } static void wocky_node_tree_dispose (GObject *object); static void wocky_node_tree_finalize (GObject *object); static void wocky_node_tree_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyNodeTree *self = WOCKY_NODE_TREE (object); switch (property_id) { case PROP_TOP_NODE: self->priv->node = g_value_get_pointer (value); g_warn_if_fail (self->priv->node != NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_node_tree_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyNodeTree *self = WOCKY_NODE_TREE (object); switch (property_id) { case PROP_TOP_NODE: g_value_set_pointer (value, self->priv->node); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_node_tree_class_init (WockyNodeTreeClass *wocky_node_tree_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_node_tree_class); GParamSpec *param_spec; g_type_class_add_private (wocky_node_tree_class, sizeof (WockyNodeTreePrivate)); object_class->dispose = wocky_node_tree_dispose; object_class->finalize = wocky_node_tree_finalize; object_class->set_property = wocky_node_tree_set_property; object_class->get_property = wocky_node_tree_get_property; param_spec = g_param_spec_pointer ("top-node", "top-node", "The topmost node of the node-tree", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TOP_NODE, param_spec); } void wocky_node_tree_dispose (GObject *object) { WockyNodeTree *self = WOCKY_NODE_TREE (object); WockyNodeTreePrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_node_tree_parent_class)->dispose) G_OBJECT_CLASS (wocky_node_tree_parent_class)->dispose (object); } void wocky_node_tree_finalize (GObject *object) { WockyNodeTree *self = WOCKY_NODE_TREE (object); /* free any data held directly by the object here */ wocky_node_free (self->priv->node); G_OBJECT_CLASS (wocky_node_tree_parent_class)->finalize (object); } /** * wocky_node_tree_new: * @name: The name of the toplevel node * @ns: The namespace of the toplevel node * @...: the description of the node tree to build, * terminated with %NULL * * Build a node-tree from a list of arguments. * Example: * * * wocky_node_tree_new ("html", "http://www.w3.org/1999/xhtml", * '(', "body", '@', "textcolor", "red", * '$', "Wocky wooo", * ')', * NULL); * * * Returns: a new node-tree object */ WockyNodeTree * wocky_node_tree_new (const gchar *name, const gchar *ns, ...) { WockyNodeTree *tree; va_list va; va_start (va, ns); tree = wocky_node_tree_new_va (name, ns, va); va_end (va); return tree; } WockyNodeTree * wocky_node_tree_new_va (const gchar *name, const char *ns, va_list va) { WockyNode *top; g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (ns != NULL, NULL); top = wocky_node_new (name, ns); wocky_node_add_build_va (top, va); return g_object_new (WOCKY_TYPE_NODE_TREE, "top-node", top, NULL); } /** * wocky_node_tree_new_from_node: * @node: The node to copy * * Build a new WockyNodeTree that contains a copy of the given node. * * Returns: a new node-tree object */ WockyNodeTree * wocky_node_tree_new_from_node (WockyNode *node) { WockyNode *top = _wocky_node_copy (node); return g_object_new (WOCKY_TYPE_NODE_TREE, "top-node", top, NULL); } WockyNode * wocky_node_tree_get_top_node (WockyNodeTree *self) { return self->priv->node; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-disco-identity.h0000644000175000017500000000460612050202021024416 0ustar00wjtwjt00000000000000/* * wocky-disco-identity.h — utility API representing a Disco Identity * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_DISCO_IDENTITY_H__ #define __WOCKY_DISCO_IDENTITY_H__ #include G_BEGIN_DECLS typedef struct _WockyDiscoIdentity WockyDiscoIdentity; /** * WockyDiscoIdentity: * @category: the identity category * @type: the identity type * @lang: the identity language * @name: the identity name * * A structure used to hold information regarding an identity from a * disco reply as described in XEP-0030. */ struct _WockyDiscoIdentity { gchar *category; gchar *type; gchar *lang; gchar *name; }; #define WOCKY_TYPE_DISCO_IDENTITY (wocky_disco_identity_get_type ()) GType wocky_disco_identity_get_type (void); WockyDiscoIdentity *wocky_disco_identity_new (const gchar *category, const gchar *type, const gchar *lang, const gchar *name) G_GNUC_WARN_UNUSED_RESULT; WockyDiscoIdentity *wocky_disco_identity_copy ( const WockyDiscoIdentity *source) G_GNUC_WARN_UNUSED_RESULT; void wocky_disco_identity_free (WockyDiscoIdentity *identity); gint wocky_disco_identity_cmp (WockyDiscoIdentity *left, WockyDiscoIdentity *right); /* array of WockyDiscoIdentity helper methods */ GPtrArray * wocky_disco_identity_array_new (void) G_GNUC_WARN_UNUSED_RESULT; GPtrArray * wocky_disco_identity_array_copy (const GPtrArray *source) G_GNUC_WARN_UNUSED_RESULT; void wocky_disco_identity_array_free (GPtrArray *arr); G_END_DECLS #endif /* #ifndef __WOCKY_DISCO_IDENTITY_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-sasl-digest-md5.c0000644000175000017500000003212412051446215024377 0ustar00wjtwjt00000000000000 #include "wocky-sasl-digest-md5.h" #include "wocky-auth-registry.h" #include "wocky-sasl-utils.h" #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" typedef enum { WOCKY_SASL_DIGEST_MD5_STATE_STARTED, WOCKY_SASL_DIGEST_MD5_STATE_SENT_AUTH_RESPONSE, WOCKY_SASL_DIGEST_MD5_STATE_SENT_FINAL_RESPONSE, } WockySaslDigestMd5State; static void auth_handler_iface_init (gpointer g_iface); G_DEFINE_TYPE_WITH_CODE (WockySaslDigestMd5, wocky_sasl_digest_md5, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE ( WOCKY_TYPE_AUTH_HANDLER, auth_handler_iface_init)) enum { PROP_SERVER = 1, PROP_USERNAME, PROP_PASSWORD }; struct _WockySaslDigestMd5Private { WockySaslDigestMd5State state; gchar *username; gchar *password; gchar *server; gchar *digest_md5_rspauth; }; static void wocky_sasl_digest_md5_get_property ( GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockySaslDigestMd5 *self = (WockySaslDigestMd5 *) object; WockySaslDigestMd5Private *priv = self->priv; switch (property_id) { case PROP_USERNAME: g_value_set_string (value, priv->username); break; case PROP_PASSWORD: g_value_set_string (value, priv->password); break; case PROP_SERVER: g_value_set_string (value, priv->server); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_sasl_digest_md5_set_property ( GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockySaslDigestMd5 *self = (WockySaslDigestMd5 *) object; WockySaslDigestMd5Private *priv = self->priv; switch (property_id) { case PROP_SERVER: g_free (priv->server); priv->server = g_value_dup_string (value); break; case PROP_USERNAME: g_free (priv->username); priv->username = g_value_dup_string (value); break; case PROP_PASSWORD: g_free (priv->password); priv->password = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_sasl_digest_md5_dispose (GObject *object) { WockySaslDigestMd5 *self = (WockySaslDigestMd5 *) object; WockySaslDigestMd5Private *priv = self->priv; g_free (priv->server); g_free (priv->username); g_free (priv->password); g_free (priv->digest_md5_rspauth); G_OBJECT_CLASS (wocky_sasl_digest_md5_parent_class)->dispose (object); } static void wocky_sasl_digest_md5_class_init ( WockySaslDigestMd5Class *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockySaslDigestMd5Private)); object_class->dispose = wocky_sasl_digest_md5_dispose; object_class->set_property = wocky_sasl_digest_md5_set_property; object_class->get_property = wocky_sasl_digest_md5_get_property; g_object_class_install_property (object_class, PROP_SERVER, g_param_spec_string ("server", "server", "The name of the server we're authenticating to", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_USERNAME, g_param_spec_string ("username", "username", "The username to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_PASSWORD, g_param_spec_string ("password", "password", "The password to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); } static gboolean digest_md5_handle_auth_data (WockyAuthHandler *handler, const GString *data, GString **response, GError **error); static gboolean digest_md5_handle_success (WockyAuthHandler *handler, GError **error); static void auth_handler_iface_init (gpointer g_iface) { WockyAuthHandlerIface *iface = g_iface; iface->mechanism = WOCKY_AUTH_MECH_SASL_DIGEST_MD5; iface->plain = FALSE; iface->auth_data_func = digest_md5_handle_auth_data; iface->success_func = digest_md5_handle_success; } static void wocky_sasl_digest_md5_init (WockySaslDigestMd5 *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_SASL_DIGEST_MD5, WockySaslDigestMd5Private); self->priv->state = WOCKY_SASL_DIGEST_MD5_STATE_STARTED; } WockySaslDigestMd5 * wocky_sasl_digest_md5_new ( const gchar *server, const gchar *username, const gchar *password) { return g_object_new (WOCKY_TYPE_SASL_DIGEST_MD5, "server", server, "username", username, "password", password, NULL); } static gchar * strndup_unescaped (const gchar *str, gsize len) { const gchar *s; gchar *d, *ret; ret = g_malloc0 (len + 1); for (s = str, d = ret ; s < (str + len) ; s++, d++) { if (*s == '\\') s++; *d = *s; } return ret; } static GHashTable * digest_md5_challenge_to_hash (const GString * challenge) { GHashTable *result = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); const gchar *keystart, *keyend, *valstart; const gchar *c = challenge->str; gchar *key, *val; do { keystart = c; for (; *c != '\0' && *c != '='; c++) ; if (*c == '\0' || c == keystart) goto error; keyend = c; c++; /* eat any whitespace between the '=' and the '"' */ for (; g_ascii_isspace (*c); c++) ; if (*c == '"') { gboolean esc = FALSE; c++; valstart = c; /* " terminates a quoted value _unless_ we are in a \ escape */ /* \0 always terminates (end of string encountered) */ for (; *c != '\0' && (esc || *c != '"'); c++) { if (esc) esc = FALSE; /* we are in a \ char escape, finish it */ else esc = *c == '\\'; /* is this char \ (ie starting an escape) */ } if (*c == '\0' || c == valstart) goto error; val = strndup_unescaped (valstart, c - valstart); c++; } else { valstart = c; for (; *c != '\0' && *c != ','; c++) ; if (c == valstart) goto error; val = g_strndup (valstart, c - valstart); } /* the key is unguarded by '"' delimiters so any whitespace * * at either end should be discarded as irrelevant */ key = g_strndup (keystart, keyend - keystart); key = g_strstrip (key); DEBUG ("challenge '%s' = '%s'", key, val); g_hash_table_insert (result, key, val); /* eat any whitespace between the '"' and the next ',' */ for (; g_ascii_isspace (*c); c++) ; if (*c == ',') c++; } while (*c != '\0'); return result; error: DEBUG ("Failed to parse challenge: %s", challenge->str); g_hash_table_unref (result); return NULL; } static guint8 * md5_hash (gchar *value) { GChecksum *checksum; guint8 *result; gsize len; len = g_checksum_type_get_length (G_CHECKSUM_MD5); g_assert (len == 16); result = g_malloc (len); checksum = g_checksum_new (G_CHECKSUM_MD5); g_checksum_update (checksum, (guchar *) value, -1); g_checksum_get_digest (checksum, result, &len); g_checksum_free (checksum); g_assert (len == 16); return result; } static gchar * md5_hex_hash (gchar *value, gsize length) { return g_compute_checksum_for_string (G_CHECKSUM_MD5, value, length); } static GString * md5_prepare_response (WockySaslDigestMd5Private *priv, GHashTable *challenge, GError **error) { GString *response = g_string_new (""); const gchar *realm, *nonce; gchar *a1, *a1h, *a2, *a2h, *kd, *kdh; gchar *cnonce = NULL; gchar *tmp; guint8 *digest_md5; gsize len; if (priv->username == NULL || priv->password == NULL) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_CREDENTIALS, "No username or password provided"); goto error; } DEBUG ("Got username and password"); nonce = g_hash_table_lookup (challenge, "nonce"); if (nonce == NULL || nonce == '\0') { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server didn't provide a nonce in the challenge"); goto error; } cnonce = sasl_generate_base64_nonce (); /* FIXME challenge can contain multiple realms */ realm = g_hash_table_lookup (challenge, "realm"); if (realm == NULL) { realm = priv->server; } /* FIXME properly escape values */ g_string_append_printf (response, "username=\"%s\"", priv->username); g_string_append_printf (response, ",realm=\"%s\"", realm); g_string_append_printf (response, ",digest-uri=\"xmpp/%s\"", priv->server); g_string_append_printf (response, ",nonce=\"%s\",nc=00000001", nonce); g_string_append_printf (response, ",cnonce=\"%s\"", cnonce); /* FIXME should check if auth is in the cop challenge val */ g_string_append_printf (response, ",qop=auth,charset=utf-8"); tmp = g_strdup_printf ("%s:%s:%s", priv->username, realm, priv->password); digest_md5 = md5_hash (tmp); g_free (tmp); a1 = g_strdup_printf ("0123456789012345:%s:%s", nonce, cnonce); len = strlen (a1); /* MD5 hash is 16 bytes */ memcpy (a1, digest_md5, 16); a1h = md5_hex_hash (a1, len); g_free (digest_md5); a2 = g_strdup_printf ("AUTHENTICATE:xmpp/%s", priv->server); a2h = md5_hex_hash (a2, -1); kd = g_strdup_printf ("%s:%s:00000001:%s:auth:%s", a1h, nonce, cnonce, a2h); kdh = md5_hex_hash (kd, -1); g_string_append_printf (response, ",response=%s", kdh); g_free (kd); g_free (kdh); g_free (a2); g_free (a2h); /* Calculate the response we expect from the server */ a2 = g_strdup_printf (":xmpp/%s", priv->server); a2h = md5_hex_hash (a2, -1); kd = g_strdup_printf ("%s:%s:00000001:%s:auth:%s", a1h, nonce, cnonce, a2h); g_free (priv->digest_md5_rspauth); priv->digest_md5_rspauth = md5_hex_hash (kd, -1); g_free (a1); g_free (a1h); g_free (a2); g_free (a2h); g_free (kd); out: g_free (cnonce); return response; error: g_string_free (response, TRUE); response = NULL; goto out; } static gboolean digest_md5_make_initial_response ( WockySaslDigestMd5Private *priv, GHashTable *challenge, GString **response, GError **error) { g_return_val_if_fail (response != NULL, FALSE); *response = md5_prepare_response (priv, challenge, error); if (*response == NULL) return FALSE; DEBUG ("Prepared response: %s", (*response)->str); priv->state = WOCKY_SASL_DIGEST_MD5_STATE_SENT_AUTH_RESPONSE; return TRUE; } static gboolean digest_md5_check_server_response ( WockySaslDigestMd5Private *priv, GHashTable *challenge, GError **error) { const gchar *rspauth; rspauth = g_hash_table_lookup (challenge, "rspauth"); if (rspauth == NULL) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server sent an invalid reply (no rspauth)"); return FALSE; } if (strcmp (priv->digest_md5_rspauth, rspauth)) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server sent an invalid reply (rspauth not matching)"); return FALSE; } priv->state = WOCKY_SASL_DIGEST_MD5_STATE_SENT_FINAL_RESPONSE; return TRUE; } static GHashTable * auth_data_to_hash (const GString *challenge, GError **error) { GHashTable *h = NULL; DEBUG ("Got digest-md5 challenge: %s", challenge->str); h = digest_md5_challenge_to_hash (challenge); if (h == NULL) g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server sent invalid auth data"); return h; } static gboolean digest_md5_handle_auth_data (WockyAuthHandler *handler, const GString *data, GString **response, GError **error) { WockySaslDigestMd5 *self = WOCKY_SASL_DIGEST_MD5 (handler); WockySaslDigestMd5Private *priv = self->priv; GHashTable *h; gboolean ret = FALSE; if (data == NULL) { DEBUG ("Expected auth data but didn't get any!"); g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Expected auth data from the server, but didn't get any"); return FALSE; } h = auth_data_to_hash (data, error); if (h == NULL) return FALSE; switch (priv->state) { case WOCKY_SASL_DIGEST_MD5_STATE_STARTED: ret = digest_md5_make_initial_response (priv, h, response, error); break; case WOCKY_SASL_DIGEST_MD5_STATE_SENT_AUTH_RESPONSE: ret = digest_md5_check_server_response (priv, h, error); break; default: g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server sent unexpected auth data"); } g_hash_table_unref (h); return ret; } static gboolean digest_md5_handle_success (WockyAuthHandler *handler, GError **error) { WockySaslDigestMd5 *self = WOCKY_SASL_DIGEST_MD5 (handler); WockySaslDigestMd5Private *priv = self->priv; if (priv->state == WOCKY_SASL_DIGEST_MD5_STATE_SENT_FINAL_RESPONSE) return TRUE; g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, "Server sent success before finishing authentication"); return FALSE; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-porter.h0000644000175000017500000002521612050202021023001 0ustar00wjtwjt00000000000000/* * wocky-porter.h - Header for WockyPorter * Copyright (C) 2009-2011 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_PORTER_H__ #define __WOCKY_PORTER_H__ #include #include #include "wocky-stanza.h" G_BEGIN_DECLS /** * WockyPorterError: * @WOCKY_PORTER_ERROR_NOT_STARTED : The #WockyPorter has not been started yet * @WOCKY_PORTER_ERROR_CLOSING : The #WockyPorter is closing * @WOCKY_PORTER_ERROR_CLOSED : The #WockyPorter is closed * @WOCKY_PORTER_ERROR_NOT_IQ : The #WockyStanza is not an IQ * @WOCKY_PORTER_ERROR_FORCIBLY_CLOSED : The #WockyPorter has been forced to * close * * The #WockyPorter specific errors. */ typedef enum { WOCKY_PORTER_ERROR_NOT_STARTED, WOCKY_PORTER_ERROR_CLOSING, WOCKY_PORTER_ERROR_CLOSED, WOCKY_PORTER_ERROR_NOT_IQ, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED, } WockyPorterError; GQuark wocky_porter_error_quark (void); /** * WOCKY_PORTER_ERROR: * * Get access to the error quark of the xmpp porter. */ #define WOCKY_PORTER_ERROR (wocky_porter_error_quark ()) GType wocky_porter_get_type (void); /* type macros */ #define WOCKY_TYPE_PORTER \ (wocky_porter_get_type ()) #define WOCKY_PORTER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_PORTER, \ WockyPorter)) #define WOCKY_IS_PORTER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_PORTER)) #define WOCKY_PORTER_GET_INTERFACE(inst) \ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), WOCKY_TYPE_PORTER, \ WockyPorterInterface)) typedef struct _WockyPorter WockyPorter; typedef struct _WockyPorterInterface WockyPorterInterface; #define WOCKY_PORTER_HANDLER_PRIORITY_MIN 0 #define WOCKY_PORTER_HANDLER_PRIORITY_NORMAL (guint) (G_MAXUINT / 2) #define WOCKY_PORTER_HANDLER_PRIORITY_MAX G_MAXUINT /** * WockyPorterHandlerFunc: * @porter: the #WockyPorter dispatching the #WockyStanza * @stanza: the #WockyStanza being dispatched * @user_data: the data passed when the handler has been registered * * Handler called when a matching stanza has been received by the * #WockyPorter. * * If a handler returns %TRUE, this means that it has taken responsibility * for handling the stanza and (if applicable) sending a reply. * * If a handler returns %FALSE, this indicates that it has declined to process * the stanza. The next handler (if any) is invoked. * * A handler must not assume that @stanza will continue to exist after the * handler has returned, unless it has taken a reference to @stanza using * g_object_ref(). * * Returns: %TRUE if the stanza has been handled, %FALSE if not */ typedef gboolean (* WockyPorterHandlerFunc) ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data); /** * WockyPorterInterface: * @parent_iface: Fields shared with #GTypeInterface. * @get_full_jid: Return the full JID of the user according to the * porter; see wocky_porter_get_full_jid() for more details. * @get_bare_jid: Return the bare JID of the user according to the * porter; see wocky_porter_get_full_jid() for more details. * @get_resource: Return the resource of the user according to the * porter; see wocky_porter_get_full_jid() for more details. * @start: Start the porter; see wocky_porter_start() for more * details. * @send_async: Start an asynchronous stanza send operation; see * wocky_porter_send_async() for more details. * @send_finish: Finish an asynchronous stanza send operation; see * wocky_porter_send_finish() for more details. * @register_handler_from_by_stanza: Register a stanza handler from a * specific contact; see * wocky_porter_register_handler_from_by_stanza() for more details. * @register_handler_from_anyone_by_stanza: Register a stanza hander * from any contact; see * wocky_porter_register_handler_from_anyone_by_stanza() for more * details. * @unregister_handler: Unregister a stanza handler; see * wocky_porter_unregister_handler() for more details. * @close_async: Start an asynchronous porter close operation; see * wocky_porter_close_async() for more details. * @close_finish: Finish an asynchronous porter close operation; see * wocky_porter_close_finish() for more details. * @send_iq_async: Start an asynchronous IQ stanza send operation; see * wocky_porter_send_iq_async() for more details. * @send_iq_finish: Finish an asynchronous IQ stanza send operation; * see wocky_porter_send_iq_finish() for more details. * @force_close_async: Start an asynchronous porter force close * operation; see wocky_porter_force_close_async() for more details. * @force_close_finish: Finish an asynchronous porter force close * operation; see wocky_porter_force_close_finish() for more details. * * The vtable for a porter implementation. */ struct _WockyPorterInterface { GTypeInterface parent_iface; const gchar * (*get_full_jid) (WockyPorter *self); const gchar * (*get_bare_jid) (WockyPorter *self); const gchar * (*get_resource) (WockyPorter *self); void (*start) (WockyPorter *porter); void (*send_async) (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (*send_finish) (WockyPorter *porter, GAsyncResult *result, GError **error); guint (*register_handler_from_by_stanza) ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza); guint (*register_handler_from_anyone_by_stanza) ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza); void (*unregister_handler) (WockyPorter *self, guint id); void (*close_async) (WockyPorter *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (*close_finish) (WockyPorter *self, GAsyncResult *result, GError **error); void (*send_iq_async) (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyStanza * (*send_iq_finish) (WockyPorter *porter, GAsyncResult *result, GError **error); void (*force_close_async) (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (*force_close_finish) (WockyPorter *porter, GAsyncResult *result, GError **error); }; void wocky_porter_start (WockyPorter *porter); const gchar * wocky_porter_get_full_jid (WockyPorter *self); const gchar * wocky_porter_get_bare_jid (WockyPorter *self); const gchar * wocky_porter_get_resource (WockyPorter *self); void wocky_porter_send_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_porter_send_finish ( WockyPorter *porter, GAsyncResult *result, GError **error); void wocky_porter_send (WockyPorter *porter, WockyStanza *stanza); guint wocky_porter_register_handler_from_va (WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap); guint wocky_porter_register_handler_from_by_stanza (WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza); guint wocky_porter_register_handler_from (WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) G_GNUC_NULL_TERMINATED; guint wocky_porter_register_handler_from_anyone_va ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap); guint wocky_porter_register_handler_from_anyone_by_stanza ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza); guint wocky_porter_register_handler_from_anyone ( WockyPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) G_GNUC_NULL_TERMINATED; void wocky_porter_unregister_handler (WockyPorter *porter, guint id); void wocky_porter_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_porter_close_finish (WockyPorter *porter, GAsyncResult *result, GError **error); void wocky_porter_send_iq_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyStanza * wocky_porter_send_iq_finish ( WockyPorter *porter, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; void wocky_porter_acknowledge_iq ( WockyPorter *porter, WockyStanza *stanza, ...) G_GNUC_NULL_TERMINATED; void wocky_porter_send_iq_error ( WockyPorter *porter, WockyStanza *stanza, WockyXmppError error_code, const gchar *message); void wocky_porter_send_iq_gerror ( WockyPorter *porter, WockyStanza *stanza, const GError *error); void wocky_porter_force_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_porter_force_close_finish ( WockyPorter *porter, GAsyncResult *result, GError **error); G_END_DECLS #endif /* #ifndef __WOCKY_PORTER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls-connector.c0000644000175000017500000003133712051446215024274 0ustar00wjtwjt00000000000000/* * wocky-tls-connector.h - Header for WockyTLSConnector * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * @author Vivek Dasmohapatra * * 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 */ #include #include #include "wocky-tls-connector.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_TLS #include "wocky-debug-internal.h" #include "wocky-namespaces.h" #include "wocky-connector.h" #include "wocky-tls.h" #include "wocky-tls-handler.h" #include "wocky-utils.h" #include "wocky-xmpp-connection.h" struct _WockyTLSConnectorPrivate { gboolean legacy_ssl; gchar *peername; GStrv extra_identities; WockyTLSHandler *handler; WockyTLSSession *session; WockyXmppConnection *connection; WockyXmppConnection *tls_connection; GSimpleAsyncResult *secure_result; GCancellable *cancellable; }; enum { PROP_HANDLER = 1, LAST_PROPERTY, }; static void session_handshake_cb (GObject *source, GAsyncResult *res, gpointer user_data); G_DEFINE_TYPE (WockyTLSConnector, wocky_tls_connector, G_TYPE_OBJECT); static void wocky_tls_connector_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyTLSConnector *self = WOCKY_TLS_CONNECTOR (object); switch (property_id) { case PROP_HANDLER: g_value_set_object (value, self->priv->handler); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_tls_connector_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyTLSConnector *self = WOCKY_TLS_CONNECTOR (object); switch (property_id) { case PROP_HANDLER: if (g_value_get_object (value) == NULL) self->priv->handler = wocky_tls_handler_new (TRUE); else self->priv->handler = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_tls_connector_finalize (GObject *object) { WockyTLSConnector *self = WOCKY_TLS_CONNECTOR (object); g_free (self->priv->peername); g_strfreev (self->priv->extra_identities); if (self->priv->session != NULL) { g_object_unref (self->priv->session); self->priv->session = NULL; } if (self->priv->handler != NULL) { g_object_unref (self->priv->handler); self->priv->handler = NULL; } if (self->priv->tls_connection != NULL) { g_object_unref (self->priv->tls_connection); self->priv->tls_connection = NULL; } G_OBJECT_CLASS (wocky_tls_connector_parent_class)->finalize (object); } static void wocky_tls_connector_class_init (WockyTLSConnectorClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *pspec; g_type_class_add_private (klass, sizeof (WockyTLSConnectorPrivate)); oclass->get_property = wocky_tls_connector_get_property; oclass->set_property = wocky_tls_connector_set_property; oclass->finalize = wocky_tls_connector_finalize; /** * WockyTLSConnector:tls-handler: * * The #WockyTLSHandler object used for the TLS handshake. */ pspec = g_param_spec_object ("tls-handler", "TLS Handler", "Handler for the TLS handshake", WOCKY_TYPE_TLS_HANDLER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_HANDLER, pspec); } static void wocky_tls_connector_init (WockyTLSConnector *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_TLS_CONNECTOR, WockyTLSConnectorPrivate); self->priv->secure_result = NULL; } static void add_ca (gpointer data, gpointer user_data) { WockyTLSSession *session = user_data; const gchar *path = data; wocky_tls_session_add_ca (session, path); } static void add_crl (gpointer data, gpointer user_data) { WockyTLSSession *session = user_data; const gchar *path = data; wocky_tls_session_add_crl (session, path); } static void prepare_session (WockyTLSConnector *self) { GSList *cas, *crls; cas = wocky_tls_handler_get_cas (self->priv->handler); crls = wocky_tls_handler_get_crls (self->priv->handler); g_slist_foreach (cas, add_ca, self->priv->session); g_slist_foreach (crls, add_crl, self->priv->session); } static void report_error_in_idle (WockyTLSConnector *self, gint error_code, const gchar *format, ...) { GError *error = NULL; va_list args; va_start (args, format); error = g_error_new_valist (WOCKY_CONNECTOR_ERROR, error_code, format, args); va_end (args); DEBUG ("%s", error->message); g_simple_async_result_set_from_error (self->priv->secure_result, error); g_error_free (error); g_simple_async_result_complete_in_idle (self->priv->secure_result); g_object_unref (self->priv->secure_result); if (self->priv->cancellable != NULL) { g_object_unref (self->priv->cancellable); self->priv->cancellable = NULL; } } static void report_error_in_idle_gerror (WockyTLSConnector *self, const GError *error) { DEBUG ("Reporting error %s", error->message); g_simple_async_result_set_from_error (self->priv->secure_result, error); g_simple_async_result_complete_in_idle (self->priv->secure_result); g_object_unref (self->priv->secure_result); if (self->priv->cancellable != NULL) { g_object_unref (self->priv->cancellable); self->priv->cancellable = NULL; } } static void do_handshake (WockyTLSConnector *self) { GIOStream *base_stream = NULL; g_object_get (self->priv->connection, "base-stream", &base_stream, NULL); g_assert (base_stream != NULL); self->priv->session = wocky_tls_session_new (base_stream); g_object_unref (base_stream); if (self->priv->session == NULL) { report_error_in_idle (self, WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED, "%s", "SSL session failed"); return; } prepare_session (self); wocky_tls_session_handshake_async (self->priv->session, G_PRIORITY_DEFAULT, self->priv->cancellable, session_handshake_cb, self); } static void tls_handler_verify_async_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyTLSConnector *self = user_data; WockyTLSHandler *handler = WOCKY_TLS_HANDLER (source); GError *error = NULL; wocky_tls_handler_verify_finish (handler, res, &error); if (error != NULL) { /* forward the GError as we got it in this case */ report_error_in_idle_gerror (self, error); g_error_free (error); return; } g_simple_async_result_set_op_res_gpointer (self->priv->secure_result, self->priv->tls_connection, (GDestroyNotify) g_object_unref); self->priv->tls_connection = NULL; g_simple_async_result_complete_in_idle (self->priv->secure_result); g_object_unref (self->priv->secure_result); if (self->priv->cancellable != NULL) { g_object_unref (self->priv->cancellable); self->priv->cancellable = NULL; } } static void session_handshake_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GError *error = NULL; WockyTLSConnection *tls_conn; WockyTLSConnector *self = user_data; const gchar *tls_type; tls_type = self->priv->legacy_ssl ? "SSL" : "TLS"; tls_conn = wocky_tls_session_handshake_finish (self->priv->session, res, &error); if (tls_conn == NULL) { report_error_in_idle (self, WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED, "%s handshake error: %s", tls_type, error->message); g_error_free (error); return; } DEBUG ("Completed %s handshake", tls_type); self->priv->tls_connection = wocky_xmpp_connection_new ( G_IO_STREAM (tls_conn)); g_object_unref (tls_conn); wocky_tls_handler_verify_async (self->priv->handler, self->priv->session, self->priv->peername, self->priv->extra_identities, tls_handler_verify_async_cb, self); } static void starttls_recv_cb (GObject *source, GAsyncResult *result, gpointer user_data) { WockyTLSConnector *self = user_data; WockyStanza *stanza; GError *error = NULL; WockyNode *node; stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (self->priv->connection), result, &error); if (stanza == NULL) { report_error_in_idle (self, WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED, "STARTTLS reply not received: %s", error->message); g_error_free (error); goto out; } if (wocky_stanza_extract_stream_error (stanza, &error)) { /* forward the GError as we got it in this case */ report_error_in_idle_gerror (self, error); g_error_free (error); goto out; } DEBUG ("Received STARTTLS response"); node = wocky_stanza_get_top_node (stanza); if (!wocky_node_matches (node, "proceed", WOCKY_XMPP_NS_TLS)) { report_error_in_idle (self, WOCKY_CONNECTOR_ERROR_TLS_REFUSED, "%s", "STARTTLS refused by the server"); goto out; } else { GIOStream *base_stream = NULL; g_object_get (self->priv->connection, "base-stream", &base_stream, NULL); g_assert (base_stream != NULL); self->priv->session = wocky_tls_session_new (base_stream); g_object_unref (base_stream); if (self->priv->session == NULL) { report_error_in_idle (self, WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED, "%s", "Unable to create a TLS session"); goto out; } prepare_session (self); DEBUG ("Starting client TLS handshake %p", self->priv->session); wocky_tls_session_handshake_async (self->priv->session, G_PRIORITY_HIGH, self->priv->cancellable, session_handshake_cb, self); } out: if (stanza != NULL) g_object_unref (stanza); } static void starttls_sent_cb (GObject *source, GAsyncResult *result, gpointer user_data) { WockyTLSConnector *self = user_data; GError *error = NULL; if (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (self->priv->connection), result, &error)) { report_error_in_idle (self, WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED, "Failed to send STARTTLS stanza: %s", error->message); g_error_free (error); return; } DEBUG ("Sent STARTTLS stanza"); wocky_xmpp_connection_recv_stanza_async ( WOCKY_XMPP_CONNECTION (self->priv->connection), self->priv->cancellable, starttls_recv_cb, self); } static void do_starttls (WockyTLSConnector *self) { WockyStanza *starttls; starttls = wocky_stanza_new ("starttls", WOCKY_XMPP_NS_TLS); DEBUG ("Sending STARTTLS stanza"); wocky_xmpp_connection_send_stanza_async ( WOCKY_XMPP_CONNECTION (self->priv->connection), starttls, self->priv->cancellable, starttls_sent_cb, self); g_object_unref (starttls); } WockyTLSConnector * wocky_tls_connector_new (WockyTLSHandler *handler) { return g_object_new (WOCKY_TYPE_TLS_CONNECTOR, "tls-handler", handler, NULL); } void wocky_tls_connector_secure_async (WockyTLSConnector *self, WockyXmppConnection *connection, gboolean old_style_ssl, const gchar *peername, GStrv extra_identities, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *async_result; g_assert (self->priv->secure_result == NULL); g_assert (self->priv->cancellable == NULL); async_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_tls_connector_secure_async); if (cancellable != NULL) self->priv->cancellable = g_object_ref (cancellable); self->priv->connection = connection; self->priv->secure_result = async_result; self->priv->legacy_ssl = old_style_ssl; self->priv->peername = g_strdup (peername); self->priv->extra_identities = g_strdupv (extra_identities); if (old_style_ssl) do_handshake (self); else do_starttls (self); } WockyXmppConnection * wocky_tls_connector_secure_finish (WockyTLSConnector *self, GAsyncResult *result, GError **error) { wocky_implement_finish_return_copy_pointer (self, wocky_tls_connector_secure_async, g_object_ref); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-meta-porter.c0000644000175000017500000014016612051453373023745 0ustar00wjtwjt00000000000000/* * wocky-meta-porter.c - Source for WockyMetaPorter * Copyright (C) 2011 Collabora Ltd. * * 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 tubesplied 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 */ #include "wocky-meta-porter.h" #include #include #include #ifdef G_OS_WIN32 #include #include #include typedef uint32_t u_int32_t; typedef uint16_t u_int16_t; #else #include #include #endif #include "wocky-ll-connection-factory.h" #include "wocky-contact-factory.h" #include "wocky-c2s-porter.h" #include "wocky-utils.h" #include "wocky-ll-contact.h" #include "wocky-ll-connector.h" #include "wocky-loopback-stream.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PORTER #include "wocky-debug-internal.h" static void wocky_porter_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (WockyMetaPorter, wocky_meta_porter, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_PORTER, wocky_porter_iface_init)); /* properties */ enum { PROP_JID = 1, PROP_CONTACT_FACTORY, PROP_CONNECTION, PROP_RESOURCE, }; #define PORTER_JID_QUARK \ (g_quark_from_static_string ("wocky-meta-porter-c2s-jid")) /* private structure */ struct _WockyMetaPorterPrivate { gchar *jid; WockyContactFactory *contact_factory; WockyLLConnectionFactory *connection_factory; /* owned (gchar *) jid => owned (PorterData *) */ GHashTable *porters; /* guint handler id => owned (StanzaHandler *) */ GHashTable *handlers; GSocketService *listener; guint16 port; guint next_handler_id; }; typedef struct { WockyMetaPorter *self; WockyContact *contact; /* owned */ WockyPorter *porter; /* also owned, for convenience */ gchar *jid; guint refcount; guint timeout_id; } PorterData; typedef struct { WockyMetaPorter *self; WockyContact *contact; /* weak reffed WockyPorter* => handler ID */ GHashTable *porters; WockyStanzaType type; WockyStanzaSubType sub_type; guint priority; WockyPorterHandlerFunc callback; gpointer user_data; WockyStanza *stanza; } StanzaHandler; GQuark wocky_meta_porter_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ( "wocky_meta_porter_error"); return quark; } static void register_porter_handlers (WockyMetaPorter *self, WockyPorter *porter, WockyContact *contact); static void disconnect_porter_signal_handlers (WockyPorter *porter, PorterData *data); static void porter_data_free (gpointer data) { PorterData *p = data; if (p->porter != NULL) { /* We have to make sure we disconnect the handlers or ::closing * will be fired by close_async, then the callback will unref * p->porter before we have a chance to do it outselves. */ disconnect_porter_signal_handlers (p->porter, p); wocky_porter_close_async (p->porter, NULL, NULL, NULL); g_object_unref (p->porter); } if (p->timeout_id > 0) g_source_remove (p->timeout_id); g_free (p->jid); g_slice_free (PorterData, data); } static void porter_closed_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source_object); GError *error = NULL; PorterData *data = user_data; if (!wocky_porter_close_finish (porter, result, &error)) { DEBUG ("Failed to close porter to '%s': %s", data->jid, error->message); g_clear_error (&error); } else { DEBUG ("Closed porter to '%s'", data->jid); } porter_data_free (data); } static gboolean porter_timeout_cb (gpointer d) { PorterData *data = d; WockyMetaPorterPrivate *priv = data->self->priv; data->timeout_id = 0; g_hash_table_steal (priv->porters, data->contact); /* we need to unref this ourselves as we just stole it from the hash * table */ g_object_unref (data->contact); if (data->porter != NULL) wocky_porter_close_async (data->porter, NULL, porter_closed_cb, data); else porter_data_free (data); return FALSE; } static void porter_closing_cb (WockyPorter *porter, PorterData *data); static void porter_remote_closed_cb (WockyPorter *porter, PorterData *data); static void porter_remote_error_cb (WockyPorter *porter, GQuark domain, gint code, const gchar *msg, PorterData *data); static void porter_sending_cb ( WockyC2SPorter *child_porter, WockyStanza *stanza, PorterData *data); static void disconnect_porter_signal_handlers (WockyPorter *porter, PorterData *data) { g_signal_handlers_disconnect_by_func (porter, porter_remote_closed_cb, data); g_signal_handlers_disconnect_by_func (porter, porter_closing_cb, data); g_signal_handlers_disconnect_by_func (porter, porter_remote_error_cb, data); g_signal_handlers_disconnect_by_func (porter, porter_sending_cb, data); } static void porter_closing_cb (WockyPorter *porter, PorterData *data) { DEBUG ("porter to '%s' closing, remove it from our records", data->jid); /* Don't stop the porter timeout here because that means if a * connection is never opened to the contact again the PorterData * struct will stick around until the meta porter is disposed. */ disconnect_porter_signal_handlers (porter, data); if (data->porter != NULL) g_object_unref (data->porter); data->porter = NULL; } static void porter_remote_closed_cb (WockyPorter *porter, PorterData *data) { DEBUG ("porter closed by remote, remove it from our records"); porter_closing_cb (porter, data); } static void porter_remote_error_cb (WockyPorter *porter, GQuark domain, gint code, const gchar *msg, PorterData *data) { DEBUG ("remote error in porter, close it"); wocky_porter_force_close_async (porter, NULL, NULL, NULL); porter_closing_cb (porter, data); } static void porter_sending_cb ( WockyC2SPorter *child_porter, WockyStanza *stanza, PorterData *data) { g_signal_emit_by_name (data->self, "sending", stanza); } static void maybe_start_timeout (PorterData *data) { if (data->refcount == 0) { /* if we've already got a timeout going let's cancel it and get * a new one going instead of having two. */ if (data->timeout_id > 0) g_source_remove (data->timeout_id); DEBUG ("Started porter timeout..."); data->timeout_id = g_timeout_add_seconds (5, porter_timeout_cb, data); } } static WockyPorter * create_porter (WockyMetaPorter *self, WockyXmppConnection *connection, WockyContact *contact) { WockyMetaPorterPrivate *priv = self->priv; PorterData *data; data = g_hash_table_lookup (priv->porters, contact); if (data != NULL) { if (data->porter != NULL) { /* close the new one; this function is meant to have stolen * a reference to the connection so we don't need to unref * it. It will ref itself for the duration of this close * call. */ wocky_xmpp_connection_send_close_async (connection, NULL, NULL, NULL); return data->porter; } else { data->porter = wocky_c2s_porter_new (connection, priv->jid); } } else { data = g_slice_new0 (PorterData); data->self = self; data->contact = contact; /* already will be reffed as the key */ data->jid = wocky_contact_dup_jid (contact); data->porter = wocky_c2s_porter_new (connection, priv->jid); data->refcount = 0; data->timeout_id = 0; g_hash_table_insert (priv->porters, g_object_ref (contact), data); } /* we need to set this so when we get a stanza in from a porter with * no from attribute we can find the real originating contact. The * StanzaHandler struct doesn't reference the PorterData struct, so * we simply store its jid here now. */ g_object_set_qdata_full (G_OBJECT (data->porter), PORTER_JID_QUARK, g_strdup (data->jid), g_free); g_signal_connect (data->porter, "closing", G_CALLBACK (porter_closing_cb), data); g_signal_connect (data->porter, "remote-closed", G_CALLBACK (porter_remote_closed_cb), data); g_signal_connect (data->porter, "remote-error", G_CALLBACK (porter_remote_error_cb), data); g_signal_connect (data->porter, "sending", G_CALLBACK (porter_sending_cb), data); register_porter_handlers (self, data->porter, contact); wocky_porter_start (data->porter); /* maybe start the timeout */ maybe_start_timeout (data); return data->porter; } /** * wocky_meta_porter_hold: * @porter: a #WockyMetaPorter * @contact: a #WockyContact * * Increases the hold count of the porter to @contact by * one. This means that if there is a connection open to @contact then * it will not disconnected after a timeout. Note that calling this * function does not mean a connection will be opened. The hold * count on a contact survives across connections. * * To decrement the hold count of the porter to @contact, one * must call wocky_meta_porter_unhold(). */ void wocky_meta_porter_hold (WockyMetaPorter *self, WockyContact *contact) { WockyMetaPorterPrivate *priv = self->priv; PorterData *data; g_return_if_fail (WOCKY_IS_META_PORTER (self)); data = g_hash_table_lookup (priv->porters, contact); if (data == NULL) { data = g_slice_new0 (PorterData); data->self = self; data->contact = contact; data->jid = wocky_contact_dup_jid (contact); data->porter = NULL; data->refcount = 0; data->timeout_id = 0; g_hash_table_insert (priv->porters, g_object_ref (contact), data); } DEBUG ("Porter to '%s' refcount %u --> %u", data->jid, data->refcount, data->refcount + 1); data->refcount++; if (data->timeout_id > 0) { g_source_remove (data->timeout_id); data->timeout_id = 0; } } /** * wocky_meta_porter_unhold: * @porter: a #WockyMetaPorter * @contact: a #WockyContact * * Decreases the hold count of the porter to @contact by * one. This means that if there is a connection open to @contact and * the hold count is zero, a connection timeout will be * started. */ void wocky_meta_porter_unhold (WockyMetaPorter *self, WockyContact *contact) { WockyMetaPorterPrivate *priv; PorterData *data; g_return_if_fail (WOCKY_IS_META_PORTER (self)); priv = self->priv; data = g_hash_table_lookup (priv->porters, contact); if (data == NULL) return; DEBUG ("Porter to '%s' refcount %u --> %u", data->jid, data->refcount, data->refcount - 1); data->refcount--; maybe_start_timeout (data); } static void wocky_meta_porter_init (WockyMetaPorter *self) { WockyMetaPorterPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_META_PORTER, WockyMetaPorterPrivate); self->priv = priv; } /* FIXME: these two functions are a hack until we get the * normalization of v6-in-v4 addresses in GLib. See bgo#646082 */ union BigSockAddr { struct sockaddr_in s4; struct sockaddr_in6 s6; struct sockaddr_storage storage; }; static void normalize_sockaddr (union BigSockAddr *addr) { if (addr->s6.sin6_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED (&(addr->s6.sin6_addr))) { /* Normalize to ipv4 address */ u_int32_t addr_big_endian; u_int16_t port; memcpy (&addr_big_endian, addr->s6.sin6_addr.s6_addr + 12, 4); port = addr->s6.sin6_port; addr->s4.sin_family = AF_INET; addr->s4.sin_addr.s_addr = addr_big_endian; addr->s4.sin_port = port; } } static GSocketAddress * normalize_address (GSocketAddress *addr) { union BigSockAddr ss; if (g_socket_address_get_family (addr) != G_SOCKET_FAMILY_IPV6) return addr; if (!g_socket_address_to_native (addr, &(ss.storage), sizeof (ss.storage), NULL)) return addr; g_object_unref (addr); normalize_sockaddr (&ss); return g_socket_address_new_from_native (&(ss.storage), sizeof (ss.storage)); } static void new_connection_connect_cb (GObject *source, GAsyncResult *result, gpointer user_data) { WockyLLConnector *connector = WOCKY_LL_CONNECTOR (source); WockyXmppConnection *connection; GError *error = NULL; WockyMetaPorter *self = user_data; WockyMetaPorterPrivate *priv = self->priv; GList *contacts, *l; WockyLLContact *contact = NULL; gchar *from; connection = wocky_ll_connector_finish (connector, result, &from, &error); if (connection == NULL) { DEBUG ("connection error: %s", error->message); g_clear_error (&error); goto out; } if (from != NULL) { contact = wocky_contact_factory_ensure_ll_contact (priv->contact_factory, from); } if (contact == NULL) { GSocketConnection *socket_connection; GSocketAddress *socket_address; GInetAddress *addr; /* we didn't get a from attribute in the stream open */ g_object_get (connection, "base-stream", &socket_connection, NULL); socket_address = g_socket_connection_get_remote_address ( socket_connection, NULL); socket_address = normalize_address (socket_address); addr = g_inet_socket_address_get_address ( G_INET_SOCKET_ADDRESS (socket_address)); contacts = wocky_contact_factory_get_ll_contacts (priv->contact_factory); for (l = contacts; l != NULL; l = l->next) { WockyLLContact *c = l->data; if (wocky_ll_contact_has_address (c, addr)) { contact = g_object_ref (c); break; } } g_list_free (contacts); g_object_unref (socket_address); g_object_unref (socket_connection); } if (contact != NULL) { create_porter (self, connection, WOCKY_CONTACT (contact)); } else { DEBUG ("Failed to find contact for new connection, let it close"); } g_object_unref (connection); out: g_object_unref (self); } static gboolean _new_connection (GSocketService *service, GSocketConnection *socket_connection, GObject *source_object, gpointer user_data) { WockyMetaPorter *self = user_data; GSocketAddress *addr; GInetAddress *inet_address; gchar *str; GError *error = NULL; addr = g_socket_connection_get_remote_address ( socket_connection, &error); if (addr == NULL) { DEBUG ("New connection, but failed to get remote address " "so ignoring: %s", error->message); g_clear_error (&error); return FALSE; } addr = normalize_address (addr); inet_address = g_inet_socket_address_get_address ( G_INET_SOCKET_ADDRESS (addr)); str = g_inet_address_to_string (inet_address); DEBUG ("New connection from %s!", str); wocky_ll_connector_incoming_async (G_IO_STREAM (socket_connection), NULL, new_connection_connect_cb, g_object_ref (self)); g_free (str); g_object_unref (addr); return TRUE; } static void stanza_handler_porter_disposed_cb (gpointer data, GObject *porter); static void free_handler (gpointer data) { StanzaHandler *handler = data; GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, handler->porters); while (g_hash_table_iter_next (&iter, &key, &value)) { WockyPorter *porter = key; guint id = GPOINTER_TO_UINT (value); wocky_porter_unregister_handler (porter, id); g_object_weak_unref (G_OBJECT (porter), stanza_handler_porter_disposed_cb, handler); } g_hash_table_unref (handler->porters); if (handler->contact != NULL) g_object_unref (handler->contact); if (handler->stanza != NULL) g_object_unref (handler->stanza); g_slice_free (StanzaHandler, handler); } static void loopback_recv_open_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source_object); WockyMetaPorter *self = user_data; WockyMetaPorterPrivate *priv = self->priv; WockyLLContact *contact; GError *error = NULL; if (!wocky_xmpp_connection_recv_open_finish (connection, result, NULL, NULL, NULL, NULL, NULL, &error)) { DEBUG ("Failed to receive stream open from loopback stream: %s", error->message); g_clear_error (&error); g_object_unref (connection); return; } contact = wocky_contact_factory_ensure_ll_contact ( priv->contact_factory, priv->jid); /* the ref, the porter and the connection will all be freed when the * meta porter is freed */ create_porter (self, connection, WOCKY_CONTACT (contact)); wocky_meta_porter_hold (self, WOCKY_CONTACT (contact)); g_object_unref (contact); g_object_unref (connection); } static void loopback_sent_open_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source_object); WockyMetaPorter *self = user_data; GError *error = NULL; if (!wocky_xmpp_connection_send_open_finish (connection, result, &error)) { DEBUG ("Failed to send stream open to loopback stream: %s", error->message); g_clear_error (&error); g_object_unref (connection); return; } wocky_xmpp_connection_recv_open_async (connection, NULL, loopback_recv_open_cb, self); } static void create_loopback_porter (WockyMetaPorter *self) { WockyMetaPorterPrivate *priv = self->priv; GIOStream *stream; WockyXmppConnection *connection; if (priv->jid == NULL) return; stream = wocky_loopback_stream_new (); connection = wocky_xmpp_connection_new (stream); /* really simple connector */ wocky_xmpp_connection_send_open_async (connection, NULL, NULL, NULL, NULL, NULL, NULL, loopback_sent_open_cb, self); g_object_unref (stream); } static void wocky_meta_porter_constructed (GObject *obj) { WockyMetaPorter *self = WOCKY_META_PORTER (obj); WockyMetaPorterPrivate *priv = self->priv; if (G_OBJECT_CLASS (wocky_meta_porter_parent_class)->constructed) G_OBJECT_CLASS (wocky_meta_porter_parent_class)->constructed (obj); priv->listener = g_socket_service_new (); g_signal_connect (priv->listener, "incoming", G_CALLBACK (_new_connection), self); priv->next_handler_id = 1; priv->connection_factory = wocky_ll_connection_factory_new (); priv->porters = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, porter_data_free); priv->handlers = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, free_handler); /* Create the loopback porter */ if (priv->jid != NULL) create_loopback_porter (self); } static void wocky_meta_porter_finalize (GObject *object) { WockyMetaPorter *self = WOCKY_META_PORTER (object); WockyMetaPorterPrivate *priv = self->priv; g_free (priv->jid); priv->jid = NULL; if (G_OBJECT_CLASS (wocky_meta_porter_parent_class)->finalize) G_OBJECT_CLASS (wocky_meta_porter_parent_class)->finalize (object); } static void wocky_meta_porter_dispose (GObject *object) { WockyMetaPorter *self = WOCKY_META_PORTER (object); WockyMetaPorterPrivate *priv = self->priv; g_object_unref (priv->contact_factory); g_object_unref (priv->connection_factory); g_socket_service_stop (priv->listener); g_object_unref (priv->listener); g_hash_table_unref (priv->porters); g_hash_table_unref (priv->handlers); if (G_OBJECT_CLASS (wocky_meta_porter_parent_class)->dispose) G_OBJECT_CLASS (wocky_meta_porter_parent_class)->dispose (object); } static void wocky_meta_porter_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyMetaPorter *self = WOCKY_META_PORTER (object); WockyMetaPorterPrivate *priv = self->priv; switch (property_id) { case PROP_JID: g_value_set_string (value, priv->jid); break; case PROP_CONTACT_FACTORY: g_value_set_object (value, priv->contact_factory); break; case PROP_CONNECTION: /* nothing; just here to implement WockyPorter */ g_value_set_object (value, NULL); break; case PROP_RESOURCE: /* nothing; just here to implement WockyPorter */ g_value_set_string (value, NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_meta_porter_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyMetaPorter *self = WOCKY_META_PORTER (object); WockyMetaPorterPrivate *priv = self->priv; switch (property_id) { case PROP_JID: priv->jid = g_value_dup_string (value); break; case PROP_CONTACT_FACTORY: priv->contact_factory = g_value_dup_object (value); break; case PROP_CONNECTION: /* nothing; just here to implement WockyPorter */ break; case PROP_RESOURCE: /* nothing; just here to implement WockyPorter */ break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_meta_porter_class_init ( WockyMetaPorterClass *wocky_meta_porter_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_meta_porter_class); GParamSpec *param_spec; g_type_class_add_private (wocky_meta_porter_class, sizeof (WockyMetaPorterPrivate)); object_class->dispose = wocky_meta_porter_dispose; object_class->finalize = wocky_meta_porter_finalize; object_class->constructed = wocky_meta_porter_constructed; object_class->get_property = wocky_meta_porter_get_property; object_class->set_property = wocky_meta_porter_set_property; /** * WockyMetaPorter:contact-factory: * * The #WockyContactFactory object in use by this meta porter. */ param_spec = g_param_spec_object ("contact-factory", "Contact factory", "WockyContactFactory object in use", WOCKY_TYPE_CONTACT_FACTORY, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_FACTORY, param_spec); g_object_class_override_property (object_class, PROP_CONNECTION, "connection"); g_object_class_override_property (object_class, PROP_JID, "full-jid"); g_object_class_override_property (object_class, PROP_JID, "bare-jid"); g_object_class_override_property (object_class, PROP_RESOURCE, "resource"); } /** * wocky_meta_porter_new: * @jid: the JID of the local user, or %NULL * @contact_factory: a #WockyContactFactory object * * Convenience function to create a new #WockyMetaPorter object. The * JID can be set later by using wocky_meta_porter_set_jid(). * * Returns: a new #WockyMetaPorter */ WockyPorter * wocky_meta_porter_new (const gchar *jid, WockyContactFactory *contact_factory) { g_return_val_if_fail (WOCKY_IS_CONTACT_FACTORY (contact_factory), NULL); return g_object_new (WOCKY_TYPE_META_PORTER, "full-jid", jid, "contact-factory", contact_factory, NULL); } static const gchar * wocky_meta_porter_get_jid (WockyPorter *porter) { WockyMetaPorter *self; g_return_val_if_fail (WOCKY_IS_META_PORTER (porter), NULL); self = (WockyMetaPorter *) porter; return self->priv->jid; } static const gchar * wocky_meta_porter_get_resource (WockyPorter *porter) { return NULL; } typedef void (*OpenPorterIfNecessaryFunc) (WockyMetaPorter *self, WockyPorter *porter, GCancellable *cancellable, const GError *error, GSimpleAsyncResult *simple, gpointer user_data); typedef struct { WockyMetaPorter *self; WockyLLContact *contact; OpenPorterIfNecessaryFunc callback; GCancellable *cancellable; GSimpleAsyncResult *simple; gpointer user_data; } OpenPorterData; static void made_connection_connect_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyLLConnector *connector = WOCKY_LL_CONNECTOR (source_object); WockyXmppConnection *connection; GError *error = NULL; OpenPorterData *data = user_data; WockyPorter *porter; connection = wocky_ll_connector_finish (connector, result, NULL, &error); if (connection == NULL) { DEBUG ("failed to connect: %s", error->message); data->callback (data->self, NULL, NULL, error, data->simple, data->user_data); g_clear_error (&error); goto out; } DEBUG ("connected"); porter = create_porter (data->self, connection, WOCKY_CONTACT (data->contact)); data->callback (data->self, porter, data->cancellable, NULL, data->simple, data->user_data); g_object_unref (connection); out: g_object_unref (data->contact); g_slice_free (OpenPorterData, data); } static void make_connection_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyLLConnectionFactory *factory = WOCKY_LL_CONNECTION_FACTORY (source_object); WockyXmppConnection *connection; GError *error = NULL; OpenPorterData *data = user_data; WockyMetaPorterPrivate *priv = data->self->priv; gchar *jid; connection = wocky_ll_connection_factory_make_connection_finish (factory, result, &error); if (connection == NULL) { DEBUG ("making connection failed: %s", error->message); data->callback (data->self, NULL, NULL, error, data->simple, data->user_data); g_clear_error (&error); g_object_unref (data->contact); g_slice_free (OpenPorterData, data); return; } jid = wocky_contact_dup_jid (WOCKY_CONTACT (data->contact)); wocky_ll_connector_outgoing_async (connection, priv->jid, jid, data->cancellable, made_connection_connect_cb, data); g_free (jid); } /* Convenience function to call @callback with a porter and do all the * handling the creating a porter if necessary. */ static void open_porter_if_necessary (WockyMetaPorter *self, WockyLLContact *contact, GCancellable *cancellable, OpenPorterIfNecessaryFunc callback, GSimpleAsyncResult *simple, gpointer user_data) { WockyMetaPorterPrivate *priv = self->priv; PorterData *porter_data = g_hash_table_lookup (priv->porters, contact); OpenPorterData *data; if (porter_data != NULL && porter_data->porter != NULL) { callback (self, porter_data->porter, cancellable, NULL, simple, user_data); return; } data = g_slice_new0 (OpenPorterData); data->self = self; data->contact = g_object_ref (contact); data->callback = callback; data->cancellable = cancellable; data->simple = simple; data->user_data = user_data; wocky_ll_connection_factory_make_connection_async (priv->connection_factory, contact, cancellable, make_connection_cb, data); } static void meta_porter_send_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { GSimpleAsyncResult *simple = user_data; GError *error = NULL; if (!wocky_porter_send_finish (WOCKY_PORTER (source_object), result, &error)) { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); } static void meta_porter_send_got_porter_cb (WockyMetaPorter *self, WockyPorter *porter, GCancellable *cancellable, const GError *error, GSimpleAsyncResult *simple, gpointer user_data) { WockyStanza *stanza = user_data; if (error != NULL) { g_simple_async_result_set_from_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); } else { wocky_porter_send_async (porter, stanza, cancellable, meta_porter_send_cb, simple); } g_object_unref (stanza); } static void wocky_meta_porter_send_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); WockyMetaPorterPrivate *priv = self->priv; GSimpleAsyncResult *simple; WockyContact *to; simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_meta_porter_send_async); to = wocky_stanza_get_to_contact (stanza); g_return_if_fail (WOCKY_IS_LL_CONTACT (to)); /* stamp on from if there is none */ if (wocky_stanza_get_from (stanza) == NULL) { wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "from", priv->jid); } open_porter_if_necessary (self, WOCKY_LL_CONTACT (to), cancellable, meta_porter_send_got_porter_cb, simple, g_object_ref (stanza)); } static gboolean wocky_meta_porter_send_finish (WockyPorter *self, GAsyncResult *result, GError **error) { g_return_val_if_fail (WOCKY_IS_META_PORTER (self), FALSE); wocky_implement_finish_void (self, wocky_meta_porter_send_async); } static guint16 wocky_meta_porter_listen (WockyMetaPorter *self, GError **error) { WockyMetaPorterPrivate *priv = self->priv; guint16 port; /* The port 5298 is preferred to remain compatible with old versions of * iChat. Try a few close to it, and if those fail, use a random port. */ for (port = 5298; port < 5300; port++) { GError *e = NULL; if (g_socket_listener_add_inet_port (G_SOCKET_LISTENER (priv->listener), port, NULL, &e)) break; if (!g_error_matches (e, G_IO_ERROR, G_IO_ERROR_ADDRESS_IN_USE)) { g_propagate_error (error, e); return 0; } g_clear_error (&e); } if (port < 5300) return port; return g_socket_listener_add_any_inet_port (G_SOCKET_LISTENER (priv->listener), NULL, error); } static void wocky_meta_porter_start (WockyPorter *porter) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); WockyMetaPorterPrivate *priv = self->priv; GError *error = NULL; guint16 port; port = wocky_meta_porter_listen (self, &error); if (error != NULL) { DEBUG ("Failed to listen: %s", error->message); g_clear_error (&error); return; } DEBUG ("listening on port %u", port); g_socket_service_start (G_SOCKET_SERVICE (priv->listener)); priv->port = port; } static gboolean porter_handler_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { StanzaHandler *handler = user_data; WockyMetaPorter *self = handler->self; WockyMetaPorterPrivate *priv = self->priv; WockyLLContact *contact; const gchar *from; /* prefer the from attribute over ignoring it and using the porter * JID */ from = wocky_stanza_get_from (stanza); if (from == NULL) from = g_object_get_qdata (G_OBJECT (porter), PORTER_JID_QUARK); contact = wocky_contact_factory_ensure_ll_contact ( priv->contact_factory, from); wocky_stanza_set_from_contact (stanza, WOCKY_CONTACT (contact)); g_object_unref (contact); return handler->callback (WOCKY_PORTER (handler->self), stanza, handler->user_data); } static void stanza_handler_porter_disposed_cb (gpointer data, GObject *porter) { StanzaHandler *handler = data; g_hash_table_remove (handler->porters, porter); } static void register_porter_handler (StanzaHandler *handler, WockyPorter *porter) { guint id; g_assert (g_hash_table_lookup (handler->porters, porter) == NULL); /* If handler->contact is not NULL, we know that this c2s porter is a * connection to them, so we still don't need to tell it to match the sender. */ id = wocky_porter_register_handler_from_anyone_by_stanza (porter, handler->type, handler->sub_type, handler->priority, porter_handler_cb, handler, handler->stanza); g_hash_table_insert (handler->porters, porter, GUINT_TO_POINTER (id)); g_object_weak_ref (G_OBJECT (porter), stanza_handler_porter_disposed_cb, handler); } static void register_porter_handlers (WockyMetaPorter *self, WockyPorter *porter, WockyContact *contact) { WockyMetaPorterPrivate *priv = self->priv; GList *handlers, *l; handlers = g_hash_table_get_values (priv->handlers); for (l = handlers; l != NULL; l = l->next) { StanzaHandler *handler = l->data; if (contact == handler->contact || handler->contact == NULL) register_porter_handler (handler, porter); } g_list_free (handlers); } static StanzaHandler * stanza_handler_new (WockyMetaPorter *self, WockyLLContact *contact, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { StanzaHandler *out = g_slice_new0 (StanzaHandler); out->self = self; out->porters = g_hash_table_new (NULL, NULL); if (contact != NULL) out->contact = g_object_ref (contact); out->type = type; out->sub_type = sub_type; out->priority = priority; out->callback = callback; out->user_data = user_data; if (stanza != NULL) out->stanza = g_object_ref (stanza); return out; } static guint wocky_meta_porter_register_handler_from_by_stanza (WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *jid, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); WockyMetaPorterPrivate *priv = self->priv; PorterData *porter_data; guint id; StanzaHandler *handler; WockyLLContact *from; g_return_val_if_fail (jid != NULL, 0); from = wocky_contact_factory_lookup_ll_contact ( priv->contact_factory, jid); g_return_val_if_fail (WOCKY_IS_LL_CONTACT (from), 0); handler = stanza_handler_new (self, from, type, sub_type, priority, callback, user_data, stanza); id = priv->next_handler_id++; porter_data = g_hash_table_lookup (priv->porters, from); if (porter_data != NULL && porter_data->porter != NULL) register_porter_handler (handler, porter_data->porter); g_hash_table_insert (priv->handlers, GUINT_TO_POINTER (id), handler); return id; } static guint wocky_meta_porter_register_handler_from_anyone_by_stanza (WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); WockyMetaPorterPrivate *priv = self->priv; PorterData *porter_data; guint id; StanzaHandler *handler; GList *porters, *l; handler = stanza_handler_new (self, NULL, type, sub_type, priority, callback, user_data, stanza); id = priv->next_handler_id++; /* register on all porters */ porters = g_hash_table_get_values (priv->porters); for (l = porters; l != NULL; l = l->next) { porter_data = l->data; if (porter_data->porter != NULL) register_porter_handler (handler, porter_data->porter); } g_list_free (porters); g_hash_table_insert (priv->handlers, GUINT_TO_POINTER (id), handler); return id; } static void wocky_meta_porter_unregister_handler (WockyPorter *porter, guint id) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); WockyMetaPorterPrivate *priv = self->priv; g_hash_table_remove (priv->handlers, GUINT_TO_POINTER (id)); } typedef gboolean (* ClosePorterFinishFunc) (WockyPorter *, GAsyncResult *, GError **); typedef void (* ClosePorterAsyncFunc) (WockyPorter *, GCancellable *, GAsyncReadyCallback, gpointer); typedef struct { GSimpleAsyncResult *simple; guint remaining; gboolean failed; ClosePorterFinishFunc close_finish; } ClosePorterData; static void porter_close_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source_object); GError *error = NULL; ClosePorterData *data = user_data; if (!data->close_finish (porter, result, &error)) { DEBUG ("Failed to close porter: %s", error->message); g_clear_error (&error); data->failed = TRUE; } data->remaining--; if (data->remaining > 0) return; /* all porters have now replied */ if (data->failed) { g_simple_async_result_set_error (data->simple, WOCKY_META_PORTER_ERROR, WOCKY_META_PORTER_ERROR_FAILED_TO_CLOSE, "Failed to close at least one porter"); } g_simple_async_result_complete (data->simple); g_object_unref (data->simple); g_slice_free (ClosePorterData, data); } static void close_all_porters (WockyMetaPorter *self, ClosePorterAsyncFunc close_async_func, ClosePorterFinishFunc close_finish_func, gpointer source_tag, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyMetaPorterPrivate *priv = self->priv; GSimpleAsyncResult *simple; GList *porters, *l; gboolean close_called = FALSE; porters = g_hash_table_get_values (priv->porters); simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, source_tag); g_signal_emit_by_name (self, "closing"); if (porters != NULL) { ClosePorterData *data = g_slice_new0 (ClosePorterData); data->close_finish = close_finish_func; data->remaining = 0; data->simple = simple; for (l = porters; l != NULL; l = l->next) { PorterData *porter_data = l->data; /* NULL if there's a refcount but no porter */ if (porter_data->porter == NULL) continue; data->remaining++; close_called = TRUE; close_async_func (porter_data->porter, cancellable, porter_close_cb, data); } /* Actually, none of the PorterData structs had C2S porters */ if (!close_called) g_slice_free (ClosePorterData, data); } if (!close_called) { /* there were no porters to close anyway */ g_simple_async_result_complete (simple); g_object_unref (simple); } g_list_free (porters); } static void wocky_meta_porter_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); close_all_porters (self, wocky_porter_close_async, wocky_porter_close_finish, wocky_meta_porter_close_async, cancellable, callback, user_data); } static gboolean wocky_meta_porter_close_finish (WockyPorter *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_meta_porter_close_async); } typedef struct { WockyMetaPorter *self; /* already reffed by simple */ GSimpleAsyncResult *simple; WockyContact *contact; } SendIQData; static void meta_porter_send_iq_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { SendIQData *data = user_data; GSimpleAsyncResult *simple = data->simple; GError *error = NULL; WockyStanza *stanza; stanza = wocky_porter_send_iq_finish (WOCKY_PORTER (source_object), result, &error); if (stanza == NULL) { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } else { wocky_stanza_set_from_contact (stanza, data->contact); g_simple_async_result_set_op_res_gpointer (simple, stanza, g_object_unref); } g_simple_async_result_complete (simple); wocky_meta_porter_unhold (data->self, data->contact); /* unref simple here as we depend on it holding potentially the last * ref on self */ g_object_unref (data->simple); g_object_unref (data->contact); g_slice_free (SendIQData, data); } static void meta_porter_send_iq_got_porter_cb (WockyMetaPorter *self, WockyPorter *porter, GCancellable *cancellable, const GError *error, GSimpleAsyncResult *simple, gpointer user_data) { WockyStanza *stanza = user_data; WockyContact *contact; contact = wocky_stanza_get_to_contact (stanza); if (error != NULL) { g_simple_async_result_set_from_error (simple, error); g_simple_async_result_complete (simple); wocky_meta_porter_unhold (self, contact); /* unref simple here as we depend on it potentially holding the * last ref to self */ g_object_unref (simple); } else { SendIQData *data = g_slice_new0 (SendIQData); data->self = self; data->simple = simple; data->contact = g_object_ref (contact); wocky_porter_send_iq_async (porter, stanza, cancellable, meta_porter_send_iq_cb, data); } g_object_unref (stanza); } static void wocky_meta_porter_send_iq_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); WockyMetaPorterPrivate *priv = self->priv; GSimpleAsyncResult *simple; WockyContact *to; to = wocky_stanza_get_to_contact (stanza); g_return_if_fail (WOCKY_IS_LL_CONTACT (to)); simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_meta_porter_send_iq_async); wocky_meta_porter_hold (self, to); /* stamp on from if there is none */ if (wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "from") == NULL) { wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "from", priv->jid); } open_porter_if_necessary (self, WOCKY_LL_CONTACT (to), cancellable, meta_porter_send_iq_got_porter_cb, simple, g_object_ref (stanza)); } static WockyStanza * wocky_meta_porter_send_iq_finish (WockyPorter *self, GAsyncResult *result, GError **error) { wocky_implement_finish_return_copy_pointer (self, wocky_meta_porter_send_iq_async, g_object_ref); } static void wocky_meta_porter_force_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyMetaPorter *self = WOCKY_META_PORTER (porter); close_all_porters (self, wocky_porter_force_close_async, wocky_porter_force_close_finish, wocky_meta_porter_force_close_async, cancellable, callback, user_data); } static gboolean wocky_meta_porter_force_close_finish (WockyPorter *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_meta_porter_force_close_async); } /** * wocky_meta_porter_get_port: * @porter: a #WockyMetaPorter * * Returns the port @porter is listening in on for new incoming XMPP * connections, or 0 if it has not been started yet with * wocky_porter_start(). * * Returns: the port @porter is listening in on for new incoming XMPP * connections, or 0 if it has not been started. */ guint16 wocky_meta_porter_get_port (WockyMetaPorter *self) { g_return_val_if_fail (WOCKY_IS_META_PORTER (self), 0); return self->priv->port; } /** * wocky_meta_porter_set_jid: * @porter: a #WockyMetaPorter * @jid: a new JID * * Changes the local JID according to @porter. Note that this function * can only be called once, and only if %NULL was passed to * wocky_meta_porter_new() when creating @porter. Calling it again * will be a no-op. */ void wocky_meta_porter_set_jid (WockyMetaPorter *self, const gchar *jid) { WockyMetaPorterPrivate *priv; g_return_if_fail (WOCKY_IS_META_PORTER (self)); priv = self->priv; /* You cannot set the meta porter JID again */ g_return_if_fail (priv->jid == NULL); /* don't try and change existing porter's JIDs */ priv->jid = g_strdup (jid); /* now we can do this */ create_loopback_porter (self); } static void meta_porter_open_got_porter_cb (WockyMetaPorter *self, WockyPorter *porter, GCancellable *cancellable, const GError *error, GSimpleAsyncResult *simple, gpointer user_data) { WockyContact *contact = user_data; if (error != NULL) { g_simple_async_result_set_from_error (simple, error); wocky_meta_porter_unhold (self, contact); } g_simple_async_result_complete (simple); g_object_unref (contact); g_object_unref (simple); } /** * wocky_meta_porter_open_async: * @porter: a #WockyMetaPorter * @contact: the #WockyLLContact * @cancellable: an optional #GCancellable, or %NULL * @callback: a callback to be called * @user_data: data for @callback * * Make an asynchronous request to open a connection to @contact if * one is not already open. The hold count of the porter to * @contact will be incrememented and so after completion * wocky_meta_porter_unhold() should be called on contact to release * the hold. * * When the request is complete, @callback will be called and the user * should call wocky_meta_porter_open_finish() to finish the request. */ void wocky_meta_porter_open_async (WockyMetaPorter *self, WockyLLContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; g_return_if_fail (WOCKY_IS_META_PORTER (self)); g_return_if_fail (WOCKY_IS_LL_CONTACT (contact)); g_return_if_fail (callback != NULL); simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_meta_porter_open_async); wocky_meta_porter_hold (self, WOCKY_CONTACT (contact)); open_porter_if_necessary (self, contact, cancellable, meta_porter_open_got_porter_cb, simple, g_object_ref (contact)); } /** * wocky_meta_porter_open_finish: * @porter: a #WockyMetaPorter * @result: the #GAsyncResult * @error: an optional #GError location to store an error message * * Finishes an asynchronous request to open a connection if one is not * already open. See wocky_meta_porter_open_async() for more details. * * Returns: %TRUE if the operation was a success, otherwise %FALSE */ gboolean wocky_meta_porter_open_finish (WockyMetaPorter *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_meta_porter_open_async); } /** * wocky_meta_porter_borrow_connection: * @porter: a #WockyMetaPorter * @contact: the #WockyContact * * Borrow the #GSocketConnection of the porter to @contact, if one * exists, otherwise %NULL will be returned. * Note that the connection returned should be reffed using * g_object_ref() if it needs to be kept. However, it will still be * operated on by the underlying #WockyXmppConnection object so can * close spontaneously unless wocky_meta_porter_hold() is called with * @contact. * * Returns: the #GSocketConnection or %NULL if no connection is open */ GSocketConnection * wocky_meta_porter_borrow_connection (WockyMetaPorter *self, WockyLLContact *contact) { WockyMetaPorterPrivate *priv; PorterData *porter_data; GSocketConnection *socket_conn; WockyXmppConnection *xmpp_conn; g_return_val_if_fail (WOCKY_IS_META_PORTER (self), NULL); g_return_val_if_fail (WOCKY_IS_LL_CONTACT (contact), NULL); priv = self->priv; porter_data = g_hash_table_lookup (priv->porters, contact); if (porter_data == NULL || porter_data->porter == NULL) return NULL; /* splendid, the connection is already open */ g_object_get (porter_data->porter, "connection", &xmpp_conn, NULL); /* will give it a new ref */ g_object_get (xmpp_conn, "base-stream", &socket_conn, NULL); /* we take back the ref */ g_object_unref (socket_conn); g_object_unref (xmpp_conn); /* but this will still be alive */ return socket_conn; } static void wocky_porter_iface_init (gpointer g_iface, gpointer iface_data) { WockyPorterInterface *iface = g_iface; iface->get_full_jid = wocky_meta_porter_get_jid; iface->get_bare_jid = wocky_meta_porter_get_jid; /* a dummy implementation to return NULL so if someone calls it on * us it won't assert */ iface->get_resource = wocky_meta_porter_get_resource; iface->start = wocky_meta_porter_start; iface->send_async = wocky_meta_porter_send_async; iface->send_finish = wocky_meta_porter_send_finish; iface->register_handler_from_by_stanza = wocky_meta_porter_register_handler_from_by_stanza; iface->register_handler_from_anyone_by_stanza = wocky_meta_porter_register_handler_from_anyone_by_stanza; iface->unregister_handler = wocky_meta_porter_unregister_handler; iface->close_async = wocky_meta_porter_close_async; iface->close_finish = wocky_meta_porter_close_finish; iface->send_iq_async = wocky_meta_porter_send_iq_async; iface->send_iq_finish = wocky_meta_porter_send_iq_finish; iface->force_close_async = wocky_meta_porter_force_close_async; iface->force_close_finish = wocky_meta_porter_force_close_finish; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-node-private.h0000644000175000017500000000231512050202021024056 0ustar00wjtwjt00000000000000/* * wocky-node-private.h - Private header for dealing with Wocky xmpp nodes * Copyright (C) 2010 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_COMPILATION) # error "This is an internal header." #endif #ifndef __WOCKY__NODE_PRIVATE_H__ #define __WOCKY__NODE_PRIVATE_H__ #include #include G_BEGIN_DECLS WockyNode *_wocky_node_copy (WockyNode *node); G_END_DECLS #endif /* #ifndef __WOCKY_NODE__PRIVATE_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-ping.h0000644000175000017500000000431112050202021022414 0ustar00wjtwjt00000000000000/* * wocky-ping.h - Header for WockyPing * Copyright (C) 2010 Collabora Ltd. * @author Senko Rasic * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_PING_H__ #define __WOCKY_PING_H__ #include #include "wocky-types.h" #include "wocky-c2s-porter.h" G_BEGIN_DECLS typedef struct _WockyPing WockyPing; /** * WockyPingClass: * * The class of a #WockyPing. */ typedef struct _WockyPingClass WockyPingClass; typedef struct _WockyPingPrivate WockyPingPrivate; GQuark wocky_ping_error_quark (void); struct _WockyPingClass { /**/ GObjectClass parent_class; }; struct _WockyPing { /**/ GObject parent; WockyPingPrivate *priv; }; GType wocky_ping_get_type (void); #define WOCKY_TYPE_PING \ (wocky_ping_get_type ()) #define WOCKY_PING(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_PING, \ WockyPing)) #define WOCKY_PING_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_PING, \ WockyPingClass)) #define WOCKY_IS_PING(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_PING)) #define WOCKY_IS_PING_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_PING)) #define WOCKY_PING_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_PING, \ WockyPingClass)) WockyPing * wocky_ping_new (WockyC2SPorter *porter, guint interval); G_END_DECLS #endif /* #ifndef __WOCKY_PING_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-caps-cache.c0000644000175000017500000004572712050202021023461 0ustar00wjtwjt00000000000000/* * wocky-caps-cache.c - Source for WockyCapsCache * Copyright (C) 2010 Collabora Ltd. * * 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 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-caps-cache.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include "wocky-xmpp-reader.h" #include "wocky-xmpp-writer.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PRESENCE #include "wocky-debug-internal.h" #define DB_USER_VERSION 2 G_DEFINE_TYPE (WockyCapsCache, wocky_caps_cache, G_TYPE_OBJECT) static WockyCapsCache *shared_cache = NULL; struct _WockyCapsCachePrivate { gchar *path; sqlite3 *db; guint inserts; WockyXmppReader *reader; WockyXmppWriter *writer; }; enum { PROP_PATH = 1, }; static void wocky_caps_cache_constructed (GObject *object); static gboolean caps_cache_get_one_uint (WockyCapsCache *self, const gchar *sql, guint *value); static void wocky_caps_cache_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyCapsCache *self = (WockyCapsCache *) object; switch (property_id) { case PROP_PATH: g_value_set_string (value, self->priv->path); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_caps_cache_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyCapsCache *self = (WockyCapsCache *) object; switch (property_id) { case PROP_PATH: g_free (self->priv->path); self->priv->path = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_caps_cache_dispose (GObject *object) { G_OBJECT_CLASS (wocky_caps_cache_parent_class)->dispose (object); } static void wocky_caps_cache_finalize (GObject *object) { WockyCapsCache *self = WOCKY_CAPS_CACHE (object); g_free (self->priv->path); self->priv->path = NULL; if (self->priv->db != NULL) { sqlite3_close (self->priv->db); self->priv->db = NULL; } if (self->priv->reader != NULL) { g_object_unref (self->priv->reader); self->priv->reader = NULL; } if (self->priv->writer != NULL) { g_object_unref (self->priv->writer); self->priv->writer = NULL; } G_OBJECT_CLASS (wocky_caps_cache_parent_class)->finalize (object); } static void wocky_caps_cache_class_init (WockyCapsCacheClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockyCapsCachePrivate)); object_class->constructed = wocky_caps_cache_constructed; object_class->get_property = wocky_caps_cache_get_property; object_class->set_property = wocky_caps_cache_set_property; object_class->dispose = wocky_caps_cache_dispose; object_class->finalize = wocky_caps_cache_finalize; /** * WockyCapsCache:path: * * The path on disk to the SQLite database where this * #WockyCapsCache stores its information. */ g_object_class_install_property (object_class, PROP_PATH, g_param_spec_string ("path", "Path", "The path to the cache", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static gchar * get_path (void) { gchar *free_dir = NULL, *ret; const gchar *dir, *path; /* This should still work if it's the magic value ":memory:". */ path = g_getenv ("WOCKY_CAPS_CACHE"); if (path != NULL) { dir = free_dir = g_path_get_dirname (path); ret = g_strdup (path); } else { dir = g_getenv ("WOCKY_CACHE_DIR"); if (dir != NULL) { ret = g_build_path (G_DIR_SEPARATOR_S, dir, "caps-cache.db", NULL); } else { ret = g_build_path (G_DIR_SEPARATOR_S, g_get_user_cache_dir (), "wocky", "caps", "caps-cache.db", NULL); dir = free_dir = g_path_get_dirname (ret); } } /* Any errors are ignored here, on the basis that we'll find out the path is * duff when we try to open the database anyway. */ g_mkdir_with_parents (dir, 0755); g_free (free_dir); return ret; } static gboolean caps_cache_check_version (WockyCapsCache *self) { guint version; if (!caps_cache_get_one_uint (self, "PRAGMA user_version;", &version)) return FALSE; if (version == 0) { /* ______________________________________________________________________ ( Unfortunately the first incarnation of the caps cache db didn't set ) ( user_version, so we can't tell if 0 means this is a new, empty ) ( database or an old one. ) ( ) ( So... let's check if the capabilities table exists. If so, we'll ) ( pretend user_version was 1. ) ( ) ( When there's nothing left to burn, you have to set yourself on fire. ) ---------------------------------------------------------------------- o ^__^ o (oo)\_______ (__)\ )\/\ ||----w | || || */ guint dummy; if (caps_cache_get_one_uint (self, "PRAGMA table_info(capabilities)", &dummy)) { DEBUG ("capabilities table exists; this isn't a new database"); version = 1; } } switch (version) { case 0: DEBUG ("opened new, empty database at %s", self->priv->path); return TRUE; case DB_USER_VERSION: DEBUG ("opened %s, user_version %u", self->priv->path, version); return TRUE; default: DEBUG ("%s is version %u, not our version %u; let's nuke it", self->priv->path, version, DB_USER_VERSION); return FALSE; } } static gboolean caps_cache_open (WockyCapsCache *self) { gint ret; gchar *error; g_return_val_if_fail (self->priv->db == NULL, FALSE); ret = sqlite3_open (self->priv->path, &self->priv->db); if (ret != SQLITE_OK) { DEBUG ("opening database %s failed: %s", self->priv->path, sqlite3_errmsg (self->priv->db)); goto err; } if (!caps_cache_check_version (self)) goto err; ret = sqlite3_exec (self->priv->db, "PRAGMA user_version = " G_STRINGIFY (DB_USER_VERSION) ";" "PRAGMA journal_mode = MEMORY;" "PRAGMA synchronous = OFF", NULL, NULL, &error); if (ret != SQLITE_OK) { DEBUG ("failed to set user_version, turn off fsync() and " "turn off on-disk journalling: %s", error); sqlite3_free (error); goto err; } ret = sqlite3_exec (self->priv->db, "CREATE TABLE IF NOT EXISTS capabilities (\n" " node text PRIMARY KEY,\n" " disco_reply text,\n" " timestamp int)", NULL, NULL, &error); if (ret != SQLITE_OK) { DEBUG ("failed to ensure table exists: %s", error); sqlite3_free (error); goto err; } return TRUE; err: sqlite3_close (self->priv->db); self->priv->db = NULL; return FALSE; } static void nuke_it_and_try_again (WockyCapsCache *self) { int ret; g_return_if_fail (self->priv->path != NULL); g_return_if_fail (self->priv->db == NULL); ret = unlink (self->priv->path); if (ret != 0) DEBUG ("removing database failed: %s", g_strerror (errno)); else caps_cache_open (self); } static void close_nuke_and_reopen_database (WockyCapsCache *self) { g_return_if_fail (self->priv->db != NULL); DEBUG ("Database seems to be corrupt; blowing it away and reinitializing"); sqlite3_close (self->priv->db); self->priv->db = NULL; nuke_it_and_try_again (self); } static void wocky_caps_cache_constructed (GObject *object) { WockyCapsCache *self = WOCKY_CAPS_CACHE (object); if (!caps_cache_open (self)) { /* Couldn't open it, or it's got a different user_version. */ nuke_it_and_try_again (self); } if (self->priv->db == NULL) { DEBUG ("couldn't open db; giving up"); return; } self->priv->reader = wocky_xmpp_reader_new_no_stream (); self->priv->writer = wocky_xmpp_writer_new_no_stream (); } static void wocky_caps_cache_init (WockyCapsCache *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ( self, WOCKY_TYPE_CAPS_CACHE, WockyCapsCachePrivate); } /** * wocky_caps_cache_new: * @path: full path to where the cache SQLite database should be stored * * Convenience function to create a new #WockyCapsCache. * * Returns: a new #WockyCapsCache. */ WockyCapsCache * wocky_caps_cache_new (const gchar *path) { return g_object_new (WOCKY_TYPE_CAPS_CACHE, "path", path, NULL); } /** * wocky_caps_cache_dup_shared: * * Returns a new or existing #WockyCapsCache object. * * The returned #WockyCapsCache is cached; the same #WockyCapsCache * object will be returned by this function repeatedly in the same * process. At the end of the process, the caller should call * wocky_caps_cache_free_shared() to shared the shared #WockyCapsCache * object. * * Returns: a new, or cached, #WockyCapsCache. */ WockyCapsCache * wocky_caps_cache_dup_shared (void) { if (shared_cache == NULL) { gchar *path; path = get_path (); shared_cache = wocky_caps_cache_new (path); g_free (path); } g_object_ref (shared_cache); return shared_cache; } /** * wocky_caps_cache_free_shared: * * Free the shared #WockyCapsCache instance which was created by * calling wocky_caps_cache_dup_shared(), or do nothing if said * function was not called. */ void wocky_caps_cache_free_shared (void) { if (shared_cache != NULL) { g_object_unref (shared_cache); shared_cache = NULL; } } static gboolean caps_cache_prepare (WockyCapsCache *self, const gchar *sql, sqlite3_stmt **stmt) { gint ret; g_return_val_if_fail (self->priv->db != NULL, FALSE); ret = sqlite3_prepare_v2 (self->priv->db, sql, -1, stmt, NULL); if (ret != SQLITE_OK) { g_warning ("preparing statement '%s' failed: %s", sql, sqlite3_errmsg (self->priv->db)); return FALSE; } g_assert (stmt != NULL); return TRUE; } /* Finalizes @stmt if an error happens. */ static gboolean caps_cache_bind_int (WockyCapsCache *self, sqlite3_stmt *stmt, gint param, gint value) { gint ret = sqlite3_bind_int (stmt, param, value); if (ret != SQLITE_OK) { g_warning ("parameter binding failed: %s", sqlite3_errmsg (self->priv->db)); sqlite3_finalize (stmt); return FALSE; } return TRUE; } /* Finalizes @stmt if an error happens. * * Note: the parameter is bound statically, so it mustn't be freed before the * statment is finalized. */ static gboolean caps_cache_bind_text (WockyCapsCache *self, sqlite3_stmt *stmt, gint param, gint len, const gchar *value) { gint ret = sqlite3_bind_text (stmt, param, value, len, SQLITE_STATIC); if (ret != SQLITE_OK) { g_warning ("parameter binding failed: %s", sqlite3_errmsg (self->priv->db)); sqlite3_finalize (stmt); return FALSE; } return TRUE; } /* * caps_cache_get_one_uint: * @self: the caps cache * @sql: a query expected to yield one row with one integer colum * @value: location at which to store that single unsigned integer * * Returns: %TRUE if @value was successfully retrieved; %FALSE otherwise. */ static gboolean caps_cache_get_one_uint (WockyCapsCache *self, const gchar *sql, guint *value) { sqlite3_stmt *stmt; int ret; if (!caps_cache_prepare (self, sql, &stmt)) return FALSE; ret = sqlite3_step (stmt); switch (ret) { case SQLITE_ROW: *value = sqlite3_column_int (stmt, 0); sqlite3_finalize (stmt); return TRUE; case SQLITE_DONE: DEBUG ("'%s' returned no results", sql); break; default: DEBUG ("executing '%s' failed: %s", sql, sqlite3_errmsg (self->priv->db)); } sqlite3_finalize (stmt); return FALSE; } /* Update cache entry timestmp. */ static void caps_cache_touch (WockyCapsCache *self, const gchar *node) { gint ret = SQLITE_OK; sqlite3_stmt *stmt; if (!caps_cache_prepare (self, "UPDATE capabilities SET timestamp=? WHERE node=?", &stmt)) return; if (!caps_cache_bind_int (self, stmt, 1, time (NULL))) return; if (!caps_cache_bind_text (self, stmt, 2, -1, node)) return; ret = sqlite3_step (stmt); if (ret != SQLITE_DONE) { DEBUG ("statement execution failed: %s", sqlite3_errmsg (self->priv->db)); } sqlite3_finalize (stmt); if (ret == SQLITE_CORRUPT) close_nuke_and_reopen_database (self); } /** * wocky_caps_cache_lookup: * @self: a #WockyCapsCache * @node: the node to look up in the cache * * Look up @node in the caps cache @self. The caller is responsible * for unreffing the returned #WockyNodeTree. * * Returns: a #WockyNodeTree if @node was found in the cache, or %NULL * if a match was not found */ WockyNodeTree * wocky_caps_cache_lookup (WockyCapsCache *self, const gchar *node) { gint ret; sqlite3_stmt *stmt; const guchar *value; int bytes; WockyNodeTree *query_node; if (!self->priv->db) /* DB open failed. */ return NULL; if (!caps_cache_prepare (self, "SELECT disco_reply FROM capabilities WHERE node=?", &stmt)) return NULL; if (!caps_cache_bind_text (self, stmt, 1, -1, node)) return NULL; ret = sqlite3_step (stmt); if (ret == SQLITE_DONE) { /* No result. */ DEBUG ("caps cache miss: %s", node); sqlite3_finalize (stmt); return NULL; } if (ret != SQLITE_ROW) { DEBUG ("statement execution failed: %s", sqlite3_errmsg (self->priv->db)); sqlite3_finalize (stmt); return NULL; } DEBUG ("caps cache hit: %s", node); value = sqlite3_column_text (stmt, 0); bytes = sqlite3_column_bytes (stmt, 0); wocky_xmpp_reader_push (self->priv->reader, value, bytes); query_node = (WockyNodeTree *) wocky_xmpp_reader_pop_stanza (self->priv->reader); sqlite3_finalize (stmt); if (query_node == NULL) { GError *error = wocky_xmpp_reader_get_error (self->priv->reader); g_warning ("could not parse query_node of %s: %s", node, (error != NULL ? error->message : "no error; incomplete xml?")); if (error != NULL) g_error_free (error); /* Destroy the town in order to save it. */ close_nuke_and_reopen_database (self); } else { caps_cache_touch (self, node); } wocky_xmpp_reader_reset (self->priv->reader); return query_node; } static void caps_cache_insert (WockyCapsCache *self, const gchar *node, WockyNodeTree *query_node) { const guint8 *val; gsize len; gint ret = SQLITE_OK; sqlite3_stmt *stmt; if (!caps_cache_prepare (self, "INSERT INTO capabilities (node, disco_reply, timestamp) " "VALUES (?, ?, ?)", &stmt)) return; if (!caps_cache_bind_text (self, stmt, 1, -1, node)) return; wocky_xmpp_writer_write_node_tree (self->priv->writer, query_node, &val, &len); if (!caps_cache_bind_text (self, stmt, 2, len, (const gchar *) val)) return; if (!caps_cache_bind_int (self, stmt, 3, time (NULL))) return; ret = sqlite3_step (stmt); if (ret == SQLITE_CONSTRAINT) /* Presumably the error is because the key already exists. Ignore it. */ goto OUT; if (ret != SQLITE_DONE) { DEBUG ("statement execution failed: %s", sqlite3_errmsg (self->priv->db)); } OUT: sqlite3_finalize (stmt); if (ret == SQLITE_CORRUPT) close_nuke_and_reopen_database (self); } static gboolean caps_cache_count_entries (WockyCapsCache *self, guint *count) { if (!self->priv->db) return FALSE; return caps_cache_get_one_uint (self, "SELECT COUNT(*) FROM capabilities", count); } /* If the number of entries is above @high_threshold, remove entries older * than @max_age while the cache is bigger than @low_threshold. */ static void caps_cache_gc (WockyCapsCache *self, guint high_threshold, guint low_threshold) { gint ret; guint count; sqlite3_stmt *stmt; if (!caps_cache_count_entries (self, &count)) return; if (count <= high_threshold) return; /* This emulates DELETE ... ORDER ... LIMIT because some Sqlites (e.g. * Debian) ship without SQLITE_ENABLE_UPDATE_DELETE_LIMIT unabled. */ if (!caps_cache_prepare (self, "DELETE FROM capabilities WHERE oid IN (" " SELECT oid FROM capabilities" " ORDER BY timestamp ASC, oid ASC" " LIMIT ?)", &stmt)) return; if (!caps_cache_bind_int (self, stmt, 1, count - low_threshold)) return; ret = sqlite3_step (stmt); if (ret == SQLITE_DONE) DEBUG ("cache reduced from %d to %d items", count, count - sqlite3_changes (self->priv->db)); else DEBUG ("statement execution failed: %s", sqlite3_errmsg (self->priv->db)); sqlite3_finalize (stmt); if (ret == SQLITE_CORRUPT) close_nuke_and_reopen_database (self); } static guint get_size (void) { static gboolean ready = FALSE; static guint size = 1000; if (G_UNLIKELY (!ready)) { const gchar *str = g_getenv ("WOCKY_CAPS_CACHE_SIZE"); if (str != NULL) { /* Ignoring return code; size will retain default value on failure. */ sscanf (str, "%u", &size); } ready = TRUE; /* DEBUG ("caps cache size = %d", size); */ } return size; } /** * wocky_caps_cache_insert: * @self: a #WockyCapsCache * @node: the capability node * @query_node: the query #WockyNodeTree associated with @node * * Adds a new item to the caps cache. @node is associated with * @query_node so that subsequent calls to wocky_caps_cache_lookup() * with the same @node value will return @query_node. */ void wocky_caps_cache_insert (WockyCapsCache *self, const gchar *node, WockyNodeTree *query_node) { guint size = get_size (); if (!self->priv->db) /* DB open failed. */ return; DEBUG ("caps cache insert: %s", node); caps_cache_insert (self, node, query_node); /* Remove old entries after every 50th insert. */ if (self->priv->inserts % 50 == 0) caps_cache_gc (self, size, MAX (1, 0.95 * size)); self->priv->inserts++; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-connection.h0000644000175000017500000001412312050202021024602 0ustar00wjtwjt00000000000000/* * wocky-xmpp-connection.h - Header for WockyXmppConnection * Copyright (C) 2006-2009 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_XMPP_CONNECTION_H__ #define __WOCKY_XMPP_CONNECTION_H__ #include #include #include "wocky-stanza.h" G_BEGIN_DECLS typedef struct _WockyXmppConnection WockyXmppConnection; /** * WockyXmppConnectionClass: * * The class of a #WockyXmppConnection. */ typedef struct _WockyXmppConnectionClass WockyXmppConnectionClass; typedef struct _WockyXmppConnectionPrivate WockyXmppConnectionPrivate; /** * WockyXmppConnectionError: * @WOCKY_XMPP_CONNECTION_ERROR_EOS : Connection got closed before receiving * an XMPP stream close. * @WOCKY_XMPP_CONNECTION_ERROR_CLOSED : Other side closed the xmpp stream. * @WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN : Trying to send or receive while the * connection isn't open. * @WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED : Trying to send or receive * while the connection is closed. * @WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN: Trying to send or receive * the connection opening when it's already open * * The #WockyXmppConnection specific errors that can occur while * reading a stream. */ typedef enum { WOCKY_XMPP_CONNECTION_ERROR_EOS, WOCKY_XMPP_CONNECTION_ERROR_CLOSED, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN, } WockyXmppConnectionError; GQuark wocky_xmpp_connection_error_quark (void); /** * WOCKY_XMPP_CONNECTION_ERROR: * * Get access to the error quark of the xmpp connection. */ #define WOCKY_XMPP_CONNECTION_ERROR (wocky_xmpp_connection_error_quark ()) struct _WockyXmppConnectionClass { /**/ GObjectClass parent_class; }; struct _WockyXmppConnection { /**/ GObject parent; WockyXmppConnectionPrivate *priv; }; GType wocky_xmpp_connection_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_XMPP_CONNECTION \ (wocky_xmpp_connection_get_type ()) #define WOCKY_XMPP_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_XMPP_CONNECTION, \ WockyXmppConnection)) #define WOCKY_XMPP_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_XMPP_CONNECTION, \ WockyXmppConnectionClass)) #define WOCKY_IS_XMPP_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_XMPP_CONNECTION)) #define WOCKY_IS_XMPP_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_XMPP_CONNECTION)) #define WOCKY_XMPP_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_XMPP_CONNECTION, \ WockyXmppConnectionClass)) WockyXmppConnection *wocky_xmpp_connection_new (GIOStream *stream); void wocky_xmpp_connection_send_open_async (WockyXmppConnection *connection, const gchar *to, const gchar *from, const gchar *version, const gchar *lang, const gchar *id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_xmpp_connection_send_open_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error); void wocky_xmpp_connection_recv_open_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_xmpp_connection_recv_open_finish ( WockyXmppConnection *connection, GAsyncResult *result, gchar **to, gchar **from, gchar **version, gchar **lang, gchar **id, GError **error); void wocky_xmpp_connection_send_stanza_async (WockyXmppConnection *connection, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_xmpp_connection_send_stanza_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error); void wocky_xmpp_connection_recv_stanza_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyStanza *wocky_xmpp_connection_recv_stanza_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error); void wocky_xmpp_connection_send_close_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_xmpp_connection_send_close_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error); void wocky_xmpp_connection_force_close_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_xmpp_connection_force_close_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error); void wocky_xmpp_connection_send_whitespace_ping_async (WockyXmppConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_xmpp_connection_send_whitespace_ping_finish ( WockyXmppConnection *connection, GAsyncResult *result, GError **error); void wocky_xmpp_connection_reset (WockyXmppConnection *connection); gchar * wocky_xmpp_connection_new_id (WockyXmppConnection *self); G_END_DECLS #endif /* #ifndef __WOCKY_XMPP_CONNECTION_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-session.c0000644000175000017500000001636211720473445023175 0ustar00wjtwjt00000000000000/* * wocky-session.c - Source for WockySession * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ /** * SECTION: wocky-session * @title: WockySession * @short_description: * @include: wocky/wocky-session.h * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-session.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "wocky-signals-marshal.h" #include "wocky-utils.h" #include "wocky-c2s-porter.h" #include "wocky-meta-porter.h" G_DEFINE_TYPE (WockySession, wocky_session, G_TYPE_OBJECT) /* properties */ enum { PROP_CONNECTION = 1, PROP_PORTER, PROP_CONTACT_FACTORY, PROP_FULL_JID, }; /* signal enum */ enum { LAST_SIGNAL, }; /* static guint signals[LAST_SIGNAL] = {0}; */ /* private structure */ struct _WockySessionPrivate { gboolean dispose_has_run; gchar *full_jid; WockyXmppConnection *connection; WockyPorter *porter; WockyContactFactory *contact_factory; }; static void wocky_session_init (WockySession *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_SESSION, WockySessionPrivate); self->priv->contact_factory = wocky_contact_factory_new (); } static void wocky_session_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: priv->connection = g_value_dup_object (value); break; case PROP_FULL_JID: priv->full_jid = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_session_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_PORTER: g_value_set_object (value, priv->porter); break; case PROP_CONTACT_FACTORY: g_value_set_object (value, priv->contact_factory); break; case PROP_FULL_JID: g_value_set_string (value, priv->full_jid); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_session_constructed (GObject *object) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; if (priv->connection != NULL) priv->porter = wocky_c2s_porter_new (priv->connection, priv->full_jid); else priv->porter = wocky_meta_porter_new (priv->full_jid, priv->contact_factory); } static void wocky_session_dispose (GObject *object) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->connection != NULL) { g_object_unref (priv->connection); priv->connection = NULL; } g_object_unref (priv->porter); g_object_unref (priv->contact_factory); if (G_OBJECT_CLASS (wocky_session_parent_class)->dispose) G_OBJECT_CLASS (wocky_session_parent_class)->dispose (object); } static void wocky_session_finalize (GObject *object) { WockySession *self = WOCKY_SESSION (object); g_free (self->priv->full_jid); G_OBJECT_CLASS (wocky_session_parent_class)->finalize (object); } static void wocky_session_class_init (WockySessionClass *wocky_session_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_session_class); GParamSpec *spec; g_type_class_add_private (wocky_session_class, sizeof (WockySessionPrivate)); object_class->constructed = wocky_session_constructed; object_class->set_property = wocky_session_set_property; object_class->get_property = wocky_session_get_property; object_class->dispose = wocky_session_dispose; object_class->finalize = wocky_session_finalize; spec = g_param_spec_object ("connection", "Connection", "The WockyXmppConnection associated with this session", WOCKY_TYPE_XMPP_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, spec); spec = g_param_spec_object ("porter", "Porter", "The WockyPorter associated with this session", WOCKY_TYPE_PORTER, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PORTER, spec); spec = g_param_spec_object ("contact-factory", "Contact factory", "The WockyContactFactory associated with this session", WOCKY_TYPE_CONTACT_FACTORY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_FACTORY, spec); spec = g_param_spec_string ("full-jid", "Full JID", "The user's JID in this session", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FULL_JID, spec); } WockySession * wocky_session_new_with_connection (WockyXmppConnection *conn, const gchar *full_jid) { g_return_val_if_fail (WOCKY_IS_XMPP_CONNECTION (conn), NULL); g_return_val_if_fail (full_jid != NULL, NULL); return g_object_new (WOCKY_TYPE_SESSION, "connection", conn, "full-jid", full_jid, NULL); } WockySession * wocky_session_new_ll (const gchar *full_jid) { return g_object_new (WOCKY_TYPE_SESSION, "full-jid", full_jid, NULL); } void wocky_session_start (WockySession *self) { WockySessionPrivate *priv = self->priv; wocky_porter_start (priv->porter); } WockyPorter * wocky_session_get_porter (WockySession *self) { WockySessionPrivate *priv = self->priv; return priv->porter; } WockyContactFactory * wocky_session_get_contact_factory (WockySession *self) { WockySessionPrivate *priv = self->priv; return priv->contact_factory; } void wocky_session_set_jid (WockySession *self, const gchar *jid) { WockySessionPrivate *priv = self->priv; g_free (priv->full_jid); priv->full_jid = g_strdup (jid); if (WOCKY_IS_META_PORTER (priv->porter)) { wocky_meta_porter_set_jid (WOCKY_META_PORTER (priv->porter), priv->full_jid); } } const gchar * wocky_session_get_jid (WockySession *self) { WockySessionPrivate *priv = self->priv; return priv->full_jid; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls-connector.h0000644000175000017500000000553612050202021024263 0ustar00wjtwjt00000000000000/* * wocky-tls-connector.h - Header for WockyTLSConnector * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_TLS_CONNECTOR_H__ #define __WOCKY_TLS_CONNECTOR_H__ #include #include "wocky-tls-handler.h" #include "wocky-xmpp-connection.h" G_BEGIN_DECLS typedef struct _WockyTLSConnector WockyTLSConnector; /** * WockyTLSConnectorClass: * * The class of a #WockyTLSConnector. */ typedef struct _WockyTLSConnectorClass WockyTLSConnectorClass; typedef struct _WockyTLSConnectorPrivate WockyTLSConnectorPrivate; struct _WockyTLSConnectorClass { /**/ GObjectClass parent_class; }; struct _WockyTLSConnector { /**/ GObject parent; WockyTLSConnectorPrivate *priv; }; GType wocky_tls_connector_get_type (void); #define WOCKY_TYPE_TLS_CONNECTOR \ (wocky_tls_connector_get_type ()) #define WOCKY_TLS_CONNECTOR(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_TLS_CONNECTOR, \ WockyTLSConnector)) #define WOCKY_TLS_CONNECTOR_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_TLS_CONNECTOR, \ WockyTLSConnectorClass)) #define WOCKY_IS_TLS_CONNECTOR(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_TLS_CONNECTOR)) #define WOCKY_IS_TLS_CONNECTOR_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_TLS_CONNECTOR)) #define WOCKY_TLS_CONNECTOR_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_TLS_CONNECTOR, \ WockyTLSConnectorClass)) WockyTLSConnector * wocky_tls_connector_new (WockyTLSHandler *handler); void wocky_tls_connector_secure_async (WockyTLSConnector *self, WockyXmppConnection *connection, gboolean old_style_ssl, const gchar *peername, GStrv extra_identities, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyXmppConnection * wocky_tls_connector_secure_finish (WockyTLSConnector *self, GAsyncResult *res, GError **error); G_END_DECLS #endif /* #ifndef __WOCKY_TLS_CONNECTOR_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/Makefile.am0000644000175000017500000001637612050202021022226 0ustar00wjtwjt00000000000000include $(top_srcdir)/tools/flymake.mk if ENABLE_SHARED_SUFFIX lib_LTLIBRARIES = libwocky.la libwocky_la_LDFLAGS = \ -no-undefined \ -release $(SHARED_SUFFIX) \ $(NULL) else noinst_LTLIBRARIES = libwocky.la endif EXTRA_DIST = built_headers = \ wocky-auth-registry-enumtypes.h \ wocky-connector-enumtypes.h \ wocky-data-form-enumtypes.h \ wocky-muc-enumtypes.h \ wocky-pubsub-node-enumtypes.h \ wocky-pubsub-service-enumtypes.h \ wocky-signals-marshal.h \ wocky-tls-enumtypes.h \ wocky-xmpp-error-enumtypes.h \ wocky-xmpp-reader-enumtypes.h built_sources = \ wocky-auth-registry-enumtypes.c \ wocky-connector-enumtypes.c \ wocky-data-form-enumtypes.c \ wocky-muc-enumtypes.c \ wocky-pubsub-node-enumtypes.c \ wocky-pubsub-service-enumtypes.c \ wocky-signals-marshal.c \ wocky-signals-marshal.list \ wocky-tls-enumtypes.c \ wocky-xmpp-error-enumtypes.c \ wocky-xmpp-reader-enumtypes.c BUILT_SOURCES = $(built_headers) $(built_sources) OPENSSL_SRC = \ wocky-openssl.c \ wocky-openssl-dh512.c \ wocky-openssl-dh1024.c \ wocky-openssl-dh2048.c \ wocky-openssl-dh4096.c GNUTLS_SRC = wocky-tls.c PROXY_SRC = \ wocky-http-proxy.h \ wocky-http-proxy.c handwritten_headers = \ wocky.h \ wocky-auth-handler.h \ wocky-auth-registry.h \ wocky-bare-contact.h \ wocky-c2s-porter.h \ wocky-caps-cache.h \ wocky-ll-connection-factory.h \ wocky-caps-hash.h \ wocky-connector.h \ wocky-contact.h \ wocky-contact-factory.h \ wocky-data-form.h \ wocky-debug.h \ wocky-disco-identity.h \ wocky-jabber-auth.h \ wocky-jabber-auth-digest.h \ wocky-jabber-auth-password.h \ wocky-ll-connector.h \ wocky-ll-contact.h \ wocky-loopback-stream.h \ wocky-meta-porter.h \ wocky-muc.h \ wocky-namespaces.h \ wocky-node.h \ wocky-node-tree.h \ wocky-pep-service.h \ wocky-ping.h \ wocky-porter.h \ wocky-pubsub-helpers.h \ wocky-pubsub-node.h \ wocky-pubsub-node-protected.h \ wocky-pubsub-service.h \ wocky-pubsub-service-protected.h \ wocky-resource-contact.h \ wocky-roster.h \ wocky-sasl-auth.h \ wocky-sasl-utils.h \ wocky-sasl-digest-md5.h \ wocky-sasl-scram.h \ wocky-sasl-plain.h \ wocky-session.h \ wocky-stanza.h \ wocky-tls.h \ wocky-tls-handler.h \ wocky-tls-connector.h \ wocky-types.h \ wocky-utils.h \ wocky-xep-0115-capabilities.h \ wocky-xmpp-connection.h \ wocky-xmpp-error.h \ wocky-xmpp-reader.h \ wocky-xmpp-writer.h handwritten_sources = \ wocky.c \ wocky-auth-handler.c \ wocky-auth-registry.c \ wocky-bare-contact.c \ wocky-c2s-porter.c \ wocky-caps-cache.c \ wocky-ll-connection-factory.c \ wocky-caps-hash.c \ wocky-connector.c \ wocky-contact.c \ wocky-contact-factory.c \ wocky-data-form.c \ wocky-debug.c \ wocky-debug-internal.h \ wocky-disco-identity.c \ wocky-heartbeat-source.c \ wocky-heartbeat-source.h \ wocky-jabber-auth.c \ wocky-jabber-auth-digest.c \ wocky-jabber-auth-password.c \ wocky-ll-connector.c \ wocky-ll-contact.c \ wocky-loopback-stream.c \ wocky-meta-porter.c \ wocky-muc.c \ wocky-node.c \ wocky-node-private.h \ wocky-node-tree.c \ wocky-pep-service.c \ wocky-ping.c \ wocky-porter.c \ wocky-pubsub-helpers.c \ wocky-pubsub-node.c \ wocky-pubsub-node-internal.h \ wocky-pubsub-service.c \ wocky-resource-contact.c \ wocky-roster.c \ wocky-sasl-auth.c \ wocky-sasl-digest-md5.c \ wocky-sasl-scram.c \ wocky-sasl-utils.c \ wocky-sasl-plain.c \ wocky-session.c \ wocky-stanza.c \ wocky-utils.c \ wocky-tls-common.c \ wocky-tls-handler.c \ wocky-tls-connector.c \ wocky-xep-0115-capabilities.c \ wocky-xmpp-connection.c \ wocky-xmpp-error.c \ wocky-xmpp-reader.c \ wocky-xmpp-writer.c if USING_OPENSSL handwritten_sources += $(OPENSSL_SRC) EXTRA_DIST += $(GNUTLS_SRC) else handwritten_sources += $(GNUTLS_SRC) EXTRA_DIST += $(OPENSSL_SRC) endif if HAVE_GIO_PROXY handwritten_sources += $(PROXY_SRC) else EXTRA_DIST += $(PROXY_SRC) endif libwocky_la_SOURCES = $(handwritten_sources) $(built_sources) \ $(handwritten_headers) $(built_headers) if INSTALL_HEADERS libwocky_la_HEADERS = $(handwritten_headers) $(built_headers) libwocky_ladir = $(HEADER_DIR)/wocky endif # Coding style checks check_c_sources = \ $(filter-out wocky-openssl%, \ $(filter-out wocky-tls.%, \ $(handwritten_sources) $(handwritten_headers) \ ) \ ) include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style CLEANFILES=$(built_sources) $(built_headers) dist-hook: $(shell for x in $(CLEANFILES); do rm -f $(distdir)/$$x ; done) wocky-signals-marshal.list: $(handwritten_sources) Makefile.am $(AM_V_GEN)( cd $(srcdir) && \ sed -n -e 's/.*_wocky_signals_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \ $(handwritten_sources) ) \ | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp @if cmp -s $@.tmp $@; then \ rm $@.tmp; \ else \ mv $@.tmp $@; \ fi %-signals-marshal.h: %-signals-marshal.list Makefile.am $(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$*)_signals_marshal $< > $@ %-signals-marshal.c: %-signals-marshal.list Makefile.am $(AM_V_GEN){ echo '#include "$*-signals-marshal.h"' && \ glib-genmarshal --body --prefix=_$(subst -,_,$*)_signals_marshal $< ; \ } > $@ AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) \ @GLIB_CFLAGS@ @LIBXML2_CFLAGS@ @SQLITE_CFLAGS@ @TLS_CFLAGS@ \ @LIBIPHB_CFLAGS@ \ -DG_LOG_DOMAIN=\"wocky\" \ -DWOCKY_COMPILATION libwocky_la_LIBADD = \ $(GCOV_LIBS) \ @GLIB_LIBS@ \ @LIBXML2_LIBS@ \ @SQLITE_LIBS@ \ @TLS_LIBS@ \ @LIBIPHB_LIBS@ \ $(NULL) # rules for making the glib enum objects # The shell variable $long is something like WOCKY_XMPP_ERROR for # wocky-xmpp-error-enumtypes.h, and $short is WOCKY. $(filter %-enumtypes.h,$(built_headers)): %-enumtypes.h: %.h Makefile.in $(AM_V_GEN)set -e; \ long=`echo $(notdir $*) | tr [:lower:]- [:upper:]_`; \ short=$${long%%_*}; \ guard="__$${long}_ENUM_TYPES_H__"; \ glib-mkenums \ --fhead "#ifndef $${guard}\n#define $${guard}\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define $${short}_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --ftail "G_END_DECLS\n\n#endif" \ $< > $@ $(filter %-enumtypes.c,$(built_sources)): %-enumtypes.c: %.h Makefile.in $(AM_V_GEN)glib-mkenums \ --fhead "#include <$*.h>\n#include <$*-enumtypes.h>" \ --fprod "\n/* enumerations from \"@filename@\" */" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ $< > $@ Android.mk: Makefile.am $(built_sources) $(built_headers) androgenizer -:PROJECT wocky -:SHARED wocky -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(handwritten_sources) $(built_sources) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(AM_LDFLAGS) $(libwocky_la_LIBADD) \ > $@ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-jabber-auth-digest.c0000644000175000017500000001111712051446215025135 0ustar00wjtwjt00000000000000 #include "wocky-jabber-auth-digest.h" #include "wocky-auth-registry.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" static void auth_handler_iface_init (gpointer g_iface); G_DEFINE_TYPE_WITH_CODE (WockyJabberAuthDigest, wocky_jabber_auth_digest, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_AUTH_HANDLER, auth_handler_iface_init)) enum { PROP_SESSION_ID = 1, PROP_PASSWORD, }; struct _WockyJabberAuthDigestPrivate { gchar *session_id; gchar *password; }; static void wocky_jabber_auth_digest_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (object); WockyJabberAuthDigestPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_value_set_string (value, priv->session_id); break; case PROP_PASSWORD: g_value_set_string (value, priv->password); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_jabber_auth_digest_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (object); WockyJabberAuthDigestPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_free (priv->session_id); priv->session_id = g_value_dup_string (value); break; case PROP_PASSWORD: g_free (priv->password); priv->password = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_jabber_auth_digest_dispose (GObject *object) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (object); WockyJabberAuthDigestPrivate *priv = self->priv; g_free (priv->session_id); g_free (priv->password); G_OBJECT_CLASS (wocky_jabber_auth_digest_parent_class)->dispose (object); } static void wocky_jabber_auth_digest_class_init (WockyJabberAuthDigestClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockyJabberAuthDigestPrivate)); object_class->get_property = wocky_jabber_auth_digest_get_property; object_class->set_property = wocky_jabber_auth_digest_set_property; object_class->dispose = wocky_jabber_auth_digest_dispose; g_object_class_install_property (object_class, PROP_SESSION_ID, g_param_spec_string ("session-id", "session-id", "The session_id to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_PASSWORD, g_param_spec_string ("password", "password", "The password to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); } static gboolean digest_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error); static void auth_handler_iface_init (gpointer g_iface) { WockyAuthHandlerIface *iface = g_iface; iface->mechanism = WOCKY_AUTH_MECH_JABBER_DIGEST; iface->plain = FALSE; iface->initial_response_func = digest_initial_response; } static void wocky_jabber_auth_digest_init (WockyJabberAuthDigest *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ( self, WOCKY_TYPE_JABBER_AUTH_DIGEST, WockyJabberAuthDigestPrivate); } WockyJabberAuthDigest * wocky_jabber_auth_digest_new (const gchar *session_id, const gchar *password) { return g_object_new (WOCKY_TYPE_JABBER_AUTH_DIGEST, "session-id", session_id, "password", password, NULL); } static GString * digest_generate_initial_response (const gchar *session_id, const gchar *password) { gchar *hsrc = g_strconcat (session_id, password, NULL); gchar *sha1 = g_compute_checksum_for_string (G_CHECKSUM_SHA1, hsrc, -1); GString *response = g_string_new (sha1); g_free (hsrc); g_free (sha1); return response; } static gboolean digest_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (handler); WockyJabberAuthDigestPrivate *priv = self->priv; if (priv->password == NULL || priv->session_id == NULL) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_CREDENTIALS, "No session-id or password provided"); return FALSE; } DEBUG ("Got session-id and password"); *initial_data = digest_generate_initial_response (priv->session_id, priv->password); return TRUE; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-bare-contact.h0000644000175000017500000000715612050202021024033 0ustar00wjtwjt00000000000000/* * wocky-bare-contact.h - Header for WockyBareContact * Copyright (C) 2009 Collabora Ltd. * @author Jonny Lamb * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_BARE_CONTACT_H__ #define __WOCKY_BARE_CONTACT_H__ #include #include "wocky-types.h" #include "wocky-contact.h" #include "wocky-roster.h" G_BEGIN_DECLS /** * WockyBareContactClass: * * The class of a #WockyBareContact. */ typedef struct _WockyBareContactClass WockyBareContactClass; typedef struct _WockyBareContactPrivate WockyBareContactPrivate; struct _WockyBareContactClass { /**/ WockyContactClass parent_class; }; struct _WockyBareContact { /**/ WockyContact parent; WockyBareContactPrivate *priv; }; GType wocky_bare_contact_get_type (void); #define WOCKY_TYPE_BARE_CONTACT \ (wocky_bare_contact_get_type ()) #define WOCKY_BARE_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_BARE_CONTACT, \ WockyBareContact)) #define WOCKY_BARE_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_BARE_CONTACT, \ WockyBareContactClass)) #define WOCKY_IS_BARE_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_BARE_CONTACT)) #define WOCKY_IS_BARE_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_BARE_CONTACT)) #define WOCKY_BARE_CONTACT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_BARE_CONTACT, \ WockyBareContactClass)) WockyBareContact * wocky_bare_contact_new (const gchar *jid); const gchar *wocky_bare_contact_get_jid (WockyBareContact *contact); const gchar *wocky_bare_contact_get_name (WockyBareContact *contact); void wocky_bare_contact_set_name (WockyBareContact *contact, const gchar *name); WockyRosterSubscriptionFlags wocky_bare_contact_get_subscription ( WockyBareContact *contact); void wocky_bare_contact_set_subscription (WockyBareContact *contact, WockyRosterSubscriptionFlags subscription); const gchar * const *wocky_bare_contact_get_groups (WockyBareContact *contact); void wocky_bare_contact_set_groups (WockyBareContact *contact, gchar **groups); gboolean wocky_bare_contact_equal (WockyBareContact *a, WockyBareContact *b); void wocky_bare_contact_add_group (WockyBareContact *contact, const gchar *group); gboolean wocky_bare_contact_in_group (WockyBareContact *contact, const gchar *group); void wocky_bare_contact_remove_group (WockyBareContact *contact, const gchar *group); WockyBareContact * wocky_bare_contact_copy (WockyBareContact *contact); void wocky_bare_contact_debug_print (WockyBareContact *contact); void wocky_bare_contact_add_resource (WockyBareContact *contact, WockyResourceContact *resource); GSList * wocky_bare_contact_get_resources (WockyBareContact *contact); G_END_DECLS #endif /* #ifndef __WOCKY_BARE_CONTACT_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky.c0000644000175000017500000000332212051446215021475 0ustar00wjtwjt00000000000000/* * wocky.c - General functions * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ #include #include "wocky.h" #include "wocky-node.h" #include "wocky-xmpp-error.h" /** * wocky_init: * * Initializes the Wocky library. * * This function should be called before calling any other Wocky functions. */ void wocky_init (void) { xmlInitParser (); wocky_node_init (); wocky_xmpp_error_init (); } /** * wocky_deinit: * * Clean up any resources created by Wocky in wocky_init(). * * It is normally not needed to call this function in a normal application * as the resources will automatically be freed when the program terminates. * This function is therefore mostly used by testsuites and other memory * profiling tools. * * After this call Wocky (including this method) should not be used anymore. */ void wocky_deinit (void) { xmlCleanupParser (); wocky_node_deinit (); wocky_xmpp_error_deinit (); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-bare-contact.c0000644000175000017500000004305012050202021024017 0ustar00wjtwjt00000000000000/* * wocky-bare-contact.c - Source for WockyBareContact * Copyright (C) 2009 Collabora Ltd. * @author Jonny Lamb * * 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 */ /** * SECTION: wocky-bare-contact * @title: WockyBareContact * @short_description: Wrapper around a roster item. * @include: wocky/wocky-bare-contact.h * * Stores information regarding a roster item and provides a higher level API * for altering its details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-bare-contact.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_ROSTER #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyBareContact, wocky_bare_contact, WOCKY_TYPE_CONTACT) /* properties */ enum { PROP_JID = 1, PROP_NAME, PROP_SUBSCRIPTION, PROP_GROUPS, }; /* signal enum */ enum { LAST_SIGNAL, }; /* static guint signals[LAST_SIGNAL] = {0}; */ /* private structure */ struct _WockyBareContactPrivate { gboolean dispose_has_run; gchar *jid; gchar *name; WockyRosterSubscriptionFlags subscription; gchar **groups; /* list of weak reffed (WockyResourceContact *) * Each WockyResourceContact has a ref on its WockyBareContact so we don't * have to keep a ref on it. */ GSList *resources; }; static void wocky_bare_contact_init (WockyBareContact *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_BARE_CONTACT, WockyBareContactPrivate); self->priv->resources = NULL; } static void wocky_bare_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; switch (property_id) { case PROP_JID: priv->jid = g_value_dup_string (value); break; case PROP_NAME: wocky_bare_contact_set_name (WOCKY_BARE_CONTACT (object), g_value_get_string (value)); break; case PROP_SUBSCRIPTION: priv->subscription = g_value_get_uint (value); break; case PROP_GROUPS: priv->groups = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_bare_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; switch (property_id) { case PROP_JID: g_value_set_string (value, priv->jid); break; case PROP_NAME: g_value_set_string (value, priv->name); break; case PROP_SUBSCRIPTION: g_value_set_uint (value, priv->subscription); break; case PROP_GROUPS: g_value_set_boxed (value, priv->groups); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_bare_contact_constructed (GObject *object) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; g_assert (priv->jid != NULL); } static void resource_disposed_cb (gpointer user_data, GObject *resource) { WockyBareContact *self = WOCKY_BARE_CONTACT (user_data); WockyBareContactPrivate *priv = self->priv; priv->resources = g_slist_remove (priv->resources, resource); } static void wocky_bare_contact_dispose (GObject *object) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; GSList *l; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; for (l = priv->resources; l != NULL; l = g_slist_next (l)) { g_object_weak_unref (G_OBJECT (l->data), resource_disposed_cb, self); } if (G_OBJECT_CLASS (wocky_bare_contact_parent_class)->dispose) G_OBJECT_CLASS (wocky_bare_contact_parent_class)->dispose (object); } static void wocky_bare_contact_finalize (GObject *object) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; if (priv->jid != NULL) g_free (priv->jid); if (priv->name != NULL) g_free (priv->name); if (priv->groups != NULL) g_strfreev (priv->groups); g_slist_free (priv->resources); G_OBJECT_CLASS (wocky_bare_contact_parent_class)->finalize (object); } static gchar * bare_contact_dup_jid (WockyContact *contact) { return g_strdup (wocky_bare_contact_get_jid (WOCKY_BARE_CONTACT (contact))); } static void wocky_bare_contact_class_init (WockyBareContactClass *wocky_bare_contact_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_bare_contact_class); WockyContactClass *contact_class = WOCKY_CONTACT_CLASS (wocky_bare_contact_class); GParamSpec *spec; g_type_class_add_private (wocky_bare_contact_class, sizeof (WockyBareContactPrivate)); object_class->constructed = wocky_bare_contact_constructed; object_class->set_property = wocky_bare_contact_set_property; object_class->get_property = wocky_bare_contact_get_property; object_class->dispose = wocky_bare_contact_dispose; object_class->finalize = wocky_bare_contact_finalize; contact_class->dup_jid = bare_contact_dup_jid; /** * WockyBareContact:jid: * * The contact's bare JID, according to the roster. */ spec = g_param_spec_string ("jid", "Contact JID", "Contact JID", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_JID, spec); /** * WockyBareContact:name: * * The contact's name, according to the roster. */ spec = g_param_spec_string ("name", "Contact Name", "Contact Name", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NAME, spec); /** * WockyBareContact:subscription: * * The subscription type of the contact, according to the roster. */ spec = g_param_spec_uint ("subscription", "Contact Subscription", "Contact Subscription", 0, LAST_WOCKY_ROSTER_SUBSCRIPTION_TYPE, WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUBSCRIPTION, spec); /** * WockyBareContact:groups: * * A list of the contact's groups, according to the roster. */ spec = g_param_spec_boxed ("groups", "Contact Groups", "Contact Groups", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_GROUPS, spec); } /** * wocky_bare_contact_new: * @jid: the JID of the contact to create * * Creates a new #WockyBareContact for a given JID. * * Returns: a newly constructed #WockyBareContact */ WockyBareContact * wocky_bare_contact_new (const gchar *jid) { return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", jid, NULL); } /** * wocky_bare_contact_get_jid: * @contact: a #WockyBareContact instance * * Returns the JID of the contact wrapped by @contact. * * Returns: @contact's JID. */ const gchar * wocky_bare_contact_get_jid (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), NULL); priv = contact->priv; return priv->jid; } /** * wocky_bare_contact_get_name: * @contact: #WockyBareContact instance * * Returns the name of the contact wrapped by @contact. * * Returns: @contact's name */ const gchar * wocky_bare_contact_get_name (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), NULL); priv = contact->priv; return priv->name; } /* FIXME: document that wocky_bare_contact_set_* shouldn't be used by users */ /** * wocky_bare_contact_set_name: * @contact: a #WockyBareContact instance * @name: the name to set @contact * * Sets @contact's name to @name. * */ void wocky_bare_contact_set_name (WockyBareContact *contact, const gchar *name) { WockyBareContactPrivate *priv; g_return_if_fail (WOCKY_IS_BARE_CONTACT (contact)); priv = contact->priv; if (!wocky_strdiff (priv->name, name)) return; g_free (priv->name); priv->name = g_strdup (name); g_object_notify (G_OBJECT (contact), "name"); } /** * wocky_bare_contact_get_subscription: * @contact: a #WockyBareContact instance * * Gets the subscription type @contact has. * * Returns: @contact's subscription. */ WockyRosterSubscriptionFlags wocky_bare_contact_get_subscription (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE); priv = contact->priv; return priv->subscription; } /** * wocky_bare_contact_set_subscription: * @contact: a #WockyBareContact instance * @subscription: the new subscription type * * Sets the subscription of @contact. * */ void wocky_bare_contact_set_subscription (WockyBareContact *contact, WockyRosterSubscriptionFlags subscription) { WockyBareContactPrivate *priv; g_return_if_fail (WOCKY_IS_BARE_CONTACT (contact)); priv = contact->priv; if (priv->subscription == subscription) return; priv->subscription = subscription; g_object_notify (G_OBJECT (contact), "subscription"); } /** * wocky_bare_contact_get_groups: * @contact: a #WockyBareContact instance * * Returns the list of the groups of @contact. * * Returns: a list of @contact's groups */ const gchar * const * wocky_bare_contact_get_groups (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), NULL); priv = contact->priv; return (const gchar * const *) priv->groups; } static gint cmp_str (gchar **a, gchar **b) { return strcmp (*a, *b); } static GPtrArray * sort_groups (GStrv groups) { GPtrArray *arr; guint i; arr = g_ptr_array_sized_new (g_strv_length (groups)); for (i = 0; groups[i] != NULL; i++) { g_ptr_array_add (arr, groups[i]); } g_ptr_array_sort (arr, (GCompareFunc) cmp_str); return arr; } static gboolean groups_equal (const gchar * const * groups_a, const gchar * const * groups_b) { GPtrArray *arr_a, *arr_b; guint i; gboolean result = TRUE; if (groups_a == NULL && groups_b == NULL) return TRUE; if (groups_a == NULL || groups_b == NULL) return FALSE; if (g_strv_length ((GStrv) groups_a) != g_strv_length ((GStrv) groups_b)) return FALSE; /* Sort both groups array and then compare elements one by one */ arr_a = sort_groups ((GStrv) groups_a); arr_b = sort_groups ((GStrv) groups_b); for (i = 0; i != arr_a->len && result; i++) { const gchar *a = g_ptr_array_index (arr_a, i); const gchar *b = g_ptr_array_index (arr_b, i); if (wocky_strdiff (a, b)) result = FALSE; } g_ptr_array_unref (arr_a); g_ptr_array_unref (arr_b); return result; } /** * wocky_bare_contact_set_groups: * @contact: a #WockyBareContact instance * @groups: a list of groups * * Sets @contact's groups. * */ void wocky_bare_contact_set_groups (WockyBareContact *contact, gchar **groups) { WockyBareContactPrivate *priv; g_return_if_fail (WOCKY_IS_BARE_CONTACT (contact)); priv = contact->priv; if (groups_equal ((const gchar * const *) groups, (const gchar * const *) priv->groups)) return; if (priv->groups != NULL) g_strfreev (priv->groups); priv->groups = g_strdupv (groups); g_object_notify (G_OBJECT (contact), "groups"); } /** * wocky_bare_contact_equal: * @a: a #WockyBareContact instance * @b: a #WockyBareContact instance to compare with @a * * Compares whether two #WockyBareContact instances refer to the same * roster item. * * Returns: #TRUE if the two contacts match. */ gboolean wocky_bare_contact_equal (WockyBareContact *a, WockyBareContact *b) { const gchar * const * groups_a; const gchar * const * groups_b; if (a == NULL || b == NULL) return FALSE; if (wocky_strdiff (wocky_bare_contact_get_jid (a), wocky_bare_contact_get_jid (b))) return FALSE; if (wocky_strdiff (wocky_bare_contact_get_name (a), wocky_bare_contact_get_name (b))) return FALSE; if (wocky_bare_contact_get_subscription (a) != wocky_bare_contact_get_subscription (b)) return FALSE; groups_a = wocky_bare_contact_get_groups (a); groups_b = wocky_bare_contact_get_groups (b); return groups_equal (groups_a, groups_b); } /** * wocky_bare_contact_add_group: * @contact: a #WockyBareContact instance * @group: a group * * Adds @group to contact's groups. */ void wocky_bare_contact_add_group (WockyBareContact *self, const gchar *group) { WockyBareContactPrivate *priv = self->priv; GPtrArray *arr; gboolean group_already_present = FALSE; if (priv->groups != NULL) { guint len, i; len = g_strv_length (priv->groups); arr = g_ptr_array_sized_new (len + 2); for (i = 0; priv->groups[i] != NULL; i++) { g_ptr_array_add (arr, g_strdup (priv->groups[i])); if (!wocky_strdiff (priv->groups[i], group)) /* Don't add the group twice */ group_already_present = TRUE; } g_strfreev (priv->groups); } else { arr = g_ptr_array_sized_new (2); } if (!group_already_present) g_ptr_array_add (arr, g_strdup (group)); /* Add trailing NULL */ g_ptr_array_add (arr, NULL); priv->groups = (GStrv) g_ptr_array_free (arr, FALSE); } /** * wocky_bare_contact_in_group: * @contact: a #WockyBareContact instance * @group: a group * * Determines whether the given contact is in @group. * * Returns: #TRUE if the contact is in the given group. */ gboolean wocky_bare_contact_in_group (WockyBareContact *self, const gchar *group) { WockyBareContactPrivate *priv = self->priv; guint i; if (priv->groups == NULL) return FALSE; for (i = 0; priv->groups[i] != NULL; i++) { if (!wocky_strdiff (priv->groups[i], group)) return TRUE; } return FALSE; } /** * wocky_bare_contact_remove_group: * @contact: a #WockyBareContact instance * @group: a group * * Removes @group from the contact's groups. */ void wocky_bare_contact_remove_group (WockyBareContact *self, const gchar *group) { WockyBareContactPrivate *priv = self->priv; GPtrArray *arr; guint len, i; if (priv->groups == NULL) return; len = g_strv_length (priv->groups); arr = g_ptr_array_sized_new (len); for (i = 0; priv->groups[i] != NULL; i++) { if (!wocky_strdiff (priv->groups[i], group)) continue; g_ptr_array_add (arr, g_strdup (priv->groups[i])); } g_strfreev (priv->groups); /* Add trailing NULL */ g_ptr_array_add (arr, NULL); priv->groups = (GStrv) g_ptr_array_free (arr, FALSE); } /** * wocky_bare_contact_copy: * @contact: a #WockyBareContact instance * * Convenience function to obtain a copy of the given #WockyBareContact. * * Returns: a newly created #WockyBareContact which is a copy of the given * one. */ WockyBareContact * wocky_bare_contact_copy (WockyBareContact *contact) { return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", wocky_bare_contact_get_jid (contact), "name", wocky_bare_contact_get_name (contact), "subscription", wocky_bare_contact_get_subscription (contact), "groups", wocky_bare_contact_get_groups (contact), NULL); } /** * wocky_bare_contact_debug_print: * @contact: a #WockyBareContact instance * * Prints debug information for the given #WockyBareContact. */ void wocky_bare_contact_debug_print (WockyBareContact *self) { WockyBareContactPrivate *priv = self->priv; guint i; DEBUG ("Contact: %s Name: %s Subscription: %s Groups:", priv->jid, priv->name, wocky_roster_subscription_to_string (priv->subscription)); for (i = 0; priv->groups[i] != NULL; i++) DEBUG (" - %s", priv->groups[i]); } /** * wocky_bare_contact_add_resource: * @contact: a #WockyBareContact instance * @resource: a #WockyResourceContact instance * * Adds @resource to the contact's resources. * The #WockyBareContact instance doesn't assume a reference to @resource. */ void wocky_bare_contact_add_resource (WockyBareContact *self, WockyResourceContact *resource) { WockyBareContactPrivate *priv = self->priv; g_object_weak_ref (G_OBJECT (resource), resource_disposed_cb, self); priv->resources = g_slist_append (priv->resources, resource); } /** * wocky_bare_contact_get_resources: * @contact: a #WockyBareContact instance * * Gets a #GSList of all the contact's resources. * You should call #g_slist_free on the list when done with it. * * Returns: a #GSList of #WockyResourceContact objects. */ GSList * wocky_bare_contact_get_resources (WockyBareContact *self) { WockyBareContactPrivate *priv = self->priv; return g_slist_copy (priv->resources); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-uninstalled.pc.in0000644000175000017500000000060611720473445024613 0ustar00wjtwjt00000000000000prefix= exec_prefix= abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ Name: Wocky (uninstalled copy) Description: XMPP library Version: @VERSION@ Requires: pkg-config >= 0.21 Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0 >= 2.26 Libs: ${abs_top_builddir}/wocky/libwocky.la Cflags: -I${abs_top_srcdir} -I${abs_top_builddir} -I${abs_top_builddir}/wocky telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-jabber-auth-digest.h0000644000175000017500000000301712050202021025122 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_JABBER_AUTH_DIGEST_H #define _WOCKY_JABBER_AUTH_DIGEST_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_JABBER_AUTH_DIGEST wocky_jabber_auth_digest_get_type() #define WOCKY_JABBER_AUTH_DIGEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_JABBER_AUTH_DIGEST, \ WockyJabberAuthDigest)) #define WOCKY_JABBER_AUTH_DIGEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_JABBER_AUTH_DIGEST, \ WockyJabberAuthDigestClass)) #define WOCKY_IS_JABBER_AUTH_DIGEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_JABBER_AUTH_DIGEST)) #define WOCKY_IS_JABBER_AUTH_DIGEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_JABBER_AUTH_DIGEST)) #define WOCKY_JABBER_AUTH_DIGEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_JABBER_AUTH_DIGEST, \ WockyJabberAuthDigestClass)) typedef struct _WockyJabberAuthDigestPrivate WockyJabberAuthDigestPrivate; typedef struct { /**/ GObject parent; WockyJabberAuthDigestPrivate *priv; } WockyJabberAuthDigest; typedef struct { /**/ GObjectClass parent_class; } WockyJabberAuthDigestClass; GType wocky_jabber_auth_digest_get_type (void); WockyJabberAuthDigest *wocky_jabber_auth_digest_new ( const gchar *server, const gchar *password); G_END_DECLS #endif /* defined _WOCKY_JABBER_AUTH_DIGEST_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-debug.c0000644000175000017500000000667712051446215022601 0ustar00wjtwjt00000000000000 #include #include #include "wocky-debug-internal.h" #ifdef ENABLE_DEBUG static WockyDebugFlags flags = 0; static gboolean initialized = FALSE; static GDebugKey keys[] = { { "transport", WOCKY_DEBUG_TRANSPORT }, { "net", WOCKY_DEBUG_NET }, { "xmpp", WOCKY_DEBUG_XMPP }, { "xmpp-reader", WOCKY_DEBUG_XMPP_READER }, { "xmpp-writer", WOCKY_DEBUG_XMPP_WRITER }, { "auth", WOCKY_DEBUG_AUTH }, { "ssl", WOCKY_DEBUG_SSL }, { "rmulticast", WOCKY_DEBUG_RMULTICAST }, { "rmulticast-sender", WOCKY_DEBUG_RMULTICAST_SENDER }, { "muc-connection", WOCKY_DEBUG_MUC_CONNECTION }, { "bytestream", WOCKY_DEBUG_BYTESTREAM }, { "ft", WOCKY_DEBUG_FILE_TRANSFER }, { "porter", WOCKY_DEBUG_PORTER }, { "connector", WOCKY_DEBUG_CONNECTOR }, { "roster", WOCKY_DEBUG_ROSTER }, { "tls", WOCKY_DEBUG_TLS }, { "pubsub", WOCKY_DEBUG_PUBSUB }, { "dataform", WOCKY_DEBUG_DATA_FORM }, { "ping", WOCKY_DEBUG_PING }, { "heartbeat", WOCKY_DEBUG_HEARTBEAT }, { "presence", WOCKY_DEBUG_PRESENCE }, { "connection-factory",WOCKY_DEBUG_CONNECTION_FACTORY}, { 0, }, }; void wocky_debug_set_flags_from_env () { guint nkeys; const gchar *flags_string; for (nkeys = 0; keys[nkeys].value; nkeys++); flags_string = g_getenv ("WOCKY_DEBUG"); if (flags_string) wocky_debug_set_flags (g_parse_debug_string (flags_string, keys, nkeys)); initialized = TRUE; } void wocky_debug_set_flags (WockyDebugFlags new_flags) { flags |= new_flags; initialized = TRUE; } gboolean wocky_debug_flag_is_set (WockyDebugFlags flag) { return flag & flags; } void wocky_debug (WockyDebugFlags flag, const gchar *format, ...) { va_list args; va_start (args, format); wocky_debug_valist (flag, format, args); va_end (args); } void wocky_debug_valist (WockyDebugFlags flag, const gchar *format, va_list args) { if (G_UNLIKELY(!initialized)) wocky_debug_set_flags_from_env (); if (flag & flags) g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args); } static void wocky_debug_node_tree_va (WockyDebugFlags flag, WockyNodeTree *tree, const gchar *format, va_list args) { if (G_UNLIKELY(!initialized)) wocky_debug_set_flags_from_env (); if (flag & flags) { gchar *msg, *node_str; msg = g_strdup_vprintf (format, args); node_str = wocky_node_to_string ( wocky_node_tree_get_top_node (tree)); g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s\n%s", msg, node_str); g_free (msg); g_free (node_str); } } void wocky_debug_node_tree (WockyDebugFlags flag, WockyNodeTree *tree, const gchar *format, ...) { va_list args; va_start (args, format); wocky_debug_node_tree_va (flag, tree, format, args); va_end (args); } void wocky_debug_stanza (WockyDebugFlags flag, WockyStanza *stanza, const gchar *format, ...) { va_list args; va_start (args, format); wocky_debug_node_tree_va (flag, (WockyNodeTree *) stanza, format, args); va_end (args); } #else /* !ENABLE_DEBUG */ void wocky_debug_set_flags (WockyDebugFlags flags) { } #endif telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-disco-identity.c0000644000175000017500000001310512050202021024403 0ustar00wjtwjt00000000000000/* * wocky-disco-identity.c - Source for WockyDiscoIdentity * Copyright (C) 2010 Collabora Ltd. * * 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 */ /** * SECTION: wocky-disco-identity * @title: WockyDiscoIdentity * @short_description: Structure holding XMPP disco identity information. * * Contains information regarding the identity information in disco * replies, as described in XEP-0030. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-disco-identity.h" #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PRESENCE #include "wocky-debug-internal.h" G_DEFINE_BOXED_TYPE (WockyDiscoIdentity, wocky_disco_identity, wocky_disco_identity_copy, wocky_disco_identity_free) /** * wocky_disco_identity_new: * @category: disco category * @type: disco type * @lang: disco language * @name: disco name * * * * Returns: a new #WockyDiscoIdentity which should be freed using * wocky_disco_identity_free(). */ WockyDiscoIdentity * wocky_disco_identity_new (const gchar *category, const gchar *type, const gchar *lang, const gchar *name) { WockyDiscoIdentity *ret; g_return_val_if_fail (category != NULL, NULL); g_return_val_if_fail (type != NULL, NULL); ret = g_slice_new (WockyDiscoIdentity); ret->category = g_strdup (category); ret->type = g_strdup (type); ret->lang = g_strdup (lang); ret->name = g_strdup (name); return ret; } /** * wocky_disco_identity_copy: * @source: the #WockyDiscoIdentity to copy * * Creates a new #WockyDiscoIdentity structure with the data given by * @source. The copy also copies the internal data so @source can be * freed after this function is called. * * Returns: a new #WockyDiscoIdentity which is a deep copy of @source */ WockyDiscoIdentity * wocky_disco_identity_copy (const WockyDiscoIdentity *source) { if (source == NULL) return NULL; return wocky_disco_identity_new (source->category, source->type, source->lang, source->name); } /** * wocky_disco_identity_free: * @identity: a #WockyDiscoIdentity * * Frees the memory used by @identity. */ void wocky_disco_identity_free (WockyDiscoIdentity *identity) { if (identity == NULL) return; g_free (identity->category); g_free (identity->type); g_free (identity->lang); g_free (identity->name); g_slice_free (WockyDiscoIdentity, identity); } /** * wocky_disco_identity_array_new: * * Creates a new array of #WockyDiscoIdentity structures. * * Returns: A newly instantiated * array. wocky_disco_identity_array_free() should beq used * to free the memory allocated by this array. * See: wocky_disco_identity_array_free() */ GPtrArray * wocky_disco_identity_array_new (void) { return g_ptr_array_new_with_free_func ( (GDestroyNotify) wocky_disco_identity_free); } /** * wocky_disco_identity_array_copy: * @source: The source array to be copied. * * Copies an array of #WockyDiscoIdentity objects. The returned array contains * new copies of the contents of the source array. * * Returns: A newly instantiated array with new copies of the contents of the * source array. * See: wocky_disco_identity_array_new() */ GPtrArray * wocky_disco_identity_array_copy (const GPtrArray *source) { GPtrArray *ret; guint i; g_return_val_if_fail (source != NULL, NULL); ret = g_ptr_array_sized_new (source->len); g_ptr_array_set_free_func (ret, (GDestroyNotify) wocky_disco_identity_free); for (i = 0; i < source->len; ++i) { g_ptr_array_add (ret, wocky_disco_identity_copy (g_ptr_array_index (source, i))); } return ret; } /** * wocky_disco_identity_array_free: * @arr: Array to be freed. * * Frees an array of #WockyDiscoIdentity objects created with * wocky_disco_identity_array_new() or returned by * wocky_disco_identity_array_copy(). * * Note that if this method is called with an array created with * g_ptr_array_new(), the caller should also free the array contents. * * See: wocky_disco_identity_array_new(), wocky_disco_identity_array_copy() */ void wocky_disco_identity_array_free (GPtrArray *arr) { if (arr == NULL) return; g_ptr_array_unref (arr); } /** * wocky_disco_identity_cmp: * @left: a #WockyDiscoIdentity * @right: a #WockyDiscoIdentity * * Compares @left and @right. It returns an integer less than, equal * to, or greater than zero if @left is found, respectively, to be * less than, to match, or be greater than %right. * * This function can be casted to a %GCompareFunc to sort a list of * #WockyDiscoIdentity structures. * * Returns: the result of comparing @left and @right */ gint wocky_disco_identity_cmp (WockyDiscoIdentity *left, WockyDiscoIdentity *right) { gint ret; if ((ret = strcmp (left->category, right->category)) != 0) return ret; if ((ret = strcmp (left->type, right->type)) != 0) return ret; if ((ret = strcmp (left->lang, right->lang)) != 0) return ret; return strcmp (left->name, right->name); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-sasl-plain.h0000644000175000017500000000244012050202021023523 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_SASL_PLAIN_H #define _WOCKY_SASL_PLAIN_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_SASL_PLAIN wocky_sasl_plain_get_type() #define WOCKY_SASL_PLAIN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_SASL_PLAIN, WockySaslPlain)) #define WOCKY_SASL_PLAIN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_SASL_PLAIN, \ WockySaslPlainClass)) #define WOCKY_IS_SASL_PLAIN(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_SASL_PLAIN)) #define WOCKY_IS_SASL_PLAIN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_SASL_PLAIN)) #define WOCKY_SASL_PLAIN_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_SASL_PLAIN, \ WockySaslPlainClass)) typedef struct _WockySaslPlainPrivate WockySaslPlainPrivate; typedef struct { GObject parent; WockySaslPlainPrivate *priv; } WockySaslPlain; typedef struct { GObjectClass parent_class; } WockySaslPlainClass; GType wocky_sasl_plain_get_type (void); WockySaslPlain *wocky_sasl_plain_new ( const gchar *username, const gchar *password); G_END_DECLS #endif /* defined _WOCKY_SASL_PLAIN_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-stanza.h0000644000175000017500000001603312051446215023003 0ustar00wjtwjt00000000000000/* * wocky-stanza.h - Header for WockyStanza * Copyright (C) 2006-2010 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_STANZA_H__ #define __WOCKY_STANZA_H__ #include #include #include "wocky-node-tree.h" #include "wocky-xmpp-error.h" #include "wocky-contact.h" G_BEGIN_DECLS typedef struct _WockyStanza WockyStanza; /** * WockyStanzaClass: * * The class of a #WockyStanza. */ typedef struct _WockyStanzaClass WockyStanzaClass; typedef struct _WockyStanzaPrivate WockyStanzaPrivate; struct _WockyStanzaClass { /**/ WockyNodeTreeClass parent_class; }; struct _WockyStanza { /**/ WockyNodeTree parent; WockyStanzaPrivate *priv; }; GType wocky_stanza_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_STANZA \ (wocky_stanza_get_type ()) #define WOCKY_STANZA(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_STANZA, \ WockyStanza)) #define WOCKY_STANZA_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_STANZA, WockyStanzaClass)) #define WOCKY_IS_STANZA(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_STANZA)) #define WOCKY_IS_STANZA_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_STANZA)) #define WOCKY_STANZA_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_STANZA, WockyStanzaClass)) /** * WockyStanzaType: * @WOCKY_STANZA_TYPE_NONE: no stanza type * @WOCKY_STANZA_TYPE_MESSAGE: <message/> stanza * @WOCKY_STANZA_TYPE_PRESENCE: <presence/> stanza * @WOCKY_STANZA_TYPE_IQ: <iq/> stanza * @WOCKY_STANZA_TYPE_STREAM: <stream/> stanza * @WOCKY_STANZA_TYPE_STREAM_FEATURES: <stream:features/> stanza * @WOCKY_STANZA_TYPE_AUTH: <auth/> stanza * @WOCKY_STANZA_TYPE_CHALLENGE: <challenge/> stanza * @WOCKY_STANZA_TYPE_RESPONSE: <response/> stanza * @WOCKY_STANZA_TYPE_SUCCESS: <success/> stanza * @WOCKY_STANZA_TYPE_FAILURE: <failure/> stanza * @WOCKY_STANZA_TYPE_STREAM_ERROR: <stream:error/> stanza * @WOCKY_STANZA_TYPE_UNKNOWN: unknown stanza type * * XMPP stanza types. */ typedef enum { WOCKY_STANZA_TYPE_NONE, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_TYPE_PRESENCE, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_TYPE_STREAM, WOCKY_STANZA_TYPE_STREAM_FEATURES, WOCKY_STANZA_TYPE_AUTH, WOCKY_STANZA_TYPE_CHALLENGE, WOCKY_STANZA_TYPE_RESPONSE, WOCKY_STANZA_TYPE_SUCCESS, WOCKY_STANZA_TYPE_FAILURE, WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_TYPE_UNKNOWN, /*< private >*/ NUM_WOCKY_STANZA_TYPE } WockyStanzaType; /** * WockyStanzaSubType: * @WOCKY_STANZA_SUB_TYPE_NONE: no sub type * @WOCKY_STANZA_SUB_TYPE_AVAILABLE: "available" stanza sub type * @WOCKY_STANZA_SUB_TYPE_NORMAL: "normal" stanza sub type * @WOCKY_STANZA_SUB_TYPE_CHAT: "chat" stanza sub type * @WOCKY_STANZA_SUB_TYPE_GROUPCHAT: "groupchat" stanza sub type * @WOCKY_STANZA_SUB_TYPE_HEADLINE: "headline" stanza sub type * @WOCKY_STANZA_SUB_TYPE_UNAVAILABLE: "unavailable" stanza sub type * @WOCKY_STANZA_SUB_TYPE_PROBE: "probe" stanza sub type * @WOCKY_STANZA_SUB_TYPE_SUBSCRIBE: "subscribe" stanza sub type * @WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBE: "unsubscribe" stanza sub type * @WOCKY_STANZA_SUB_TYPE_SUBSCRIBED: "subscribed" stanza sub type * @WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBED: "unsubscribed" stanza sub type * @WOCKY_STANZA_SUB_TYPE_GET: "get" stanza sub type * @WOCKY_STANZA_SUB_TYPE_SET: "set" stanza sub type * @WOCKY_STANZA_SUB_TYPE_RESULT: "result" stanza sub type * @WOCKY_STANZA_SUB_TYPE_ERROR: "error" stanza sub type * @WOCKY_STANZA_SUB_TYPE_UNKNOWN: unknown stanza sub type * * XMPP stanza sub types. */ typedef enum { WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_STANZA_SUB_TYPE_AVAILABLE, WOCKY_STANZA_SUB_TYPE_NORMAL, WOCKY_STANZA_SUB_TYPE_CHAT, WOCKY_STANZA_SUB_TYPE_GROUPCHAT, WOCKY_STANZA_SUB_TYPE_HEADLINE, WOCKY_STANZA_SUB_TYPE_UNAVAILABLE, WOCKY_STANZA_SUB_TYPE_PROBE, WOCKY_STANZA_SUB_TYPE_SUBSCRIBE, WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBE, WOCKY_STANZA_SUB_TYPE_SUBSCRIBED, WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBED, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_STANZA_SUB_TYPE_RESULT, WOCKY_STANZA_SUB_TYPE_ERROR, WOCKY_STANZA_SUB_TYPE_UNKNOWN, /*< private >*/ NUM_WOCKY_STANZA_SUB_TYPE } WockyStanzaSubType; WockyStanza * wocky_stanza_new (const gchar *name, const gchar *ns); WockyStanza * wocky_stanza_copy (WockyStanza *old); WockyNode *wocky_stanza_get_top_node (WockyStanza *self); WockyStanza * wocky_stanza_build (WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, const gchar *to, ...) G_GNUC_NULL_TERMINATED; WockyStanza * wocky_stanza_build_to_contact (WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, WockyContact *to, ...) G_GNUC_NULL_TERMINATED; void wocky_stanza_get_type_info (WockyStanza *stanza, WockyStanzaType *type, WockyStanzaSubType *sub_type); const gchar *wocky_stanza_get_from (WockyStanza *self); const gchar *wocky_stanza_get_to (WockyStanza *self); WockyStanza * wocky_stanza_build_va (WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, const gchar *to, va_list ap); WockyStanza * wocky_stanza_build_iq_result (WockyStanza *iq, ...) G_GNUC_NULL_TERMINATED; WockyStanza *wocky_stanza_build_iq_result_va ( WockyStanza *iq, va_list ap); WockyStanza * wocky_stanza_build_iq_error (WockyStanza *iq, ...) G_GNUC_NULL_TERMINATED; WockyStanza *wocky_stanza_build_iq_error_va ( WockyStanza *iq, va_list ap); gboolean wocky_stanza_extract_errors (WockyStanza *stanza, WockyXmppErrorType *type, GError **core, GError **specialized, WockyNode **specialized_node); gboolean wocky_stanza_extract_stream_error (WockyStanza *stanza, GError **stream_error); WockyContact * wocky_stanza_get_to_contact (WockyStanza *self); WockyContact * wocky_stanza_get_from_contact (WockyStanza *self); void wocky_stanza_set_to_contact (WockyStanza *self, WockyContact *contact); void wocky_stanza_set_from_contact (WockyStanza *self, WockyContact *contact); G_END_DECLS #endif /* #ifndef __WOCKY_STANZA_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-ll-connector.h0000644000175000017500000000570412050202021024065 0ustar00wjtwjt00000000000000/* * wocky-ll-connector.h - Header for WockyLLConnector * Copyright (C) 2011 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_LL_CONNECTOR_H__ #define __WOCKY_LL_CONNECTOR_H__ #include #include #include "wocky-xmpp-connection.h" G_BEGIN_DECLS typedef struct _WockyLLConnector WockyLLConnector; typedef struct _WockyLLConnectorClass WockyLLConnectorClass; typedef struct _WockyLLConnectorPrivate WockyLLConnectorPrivate; typedef enum { WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_SEND_STANZA, WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_RECEIVE_STANZA, } WockyLLConnectorError; GQuark wocky_ll_connector_error_quark (void); #define WOCKY_LL_CONNECTOR_ERROR (wocky_ll_connector_error_quark ()) struct _WockyLLConnectorClass { GObjectClass parent_class; }; struct _WockyLLConnector { GObject parent; WockyLLConnectorPrivate *priv; }; GType wocky_ll_connector_get_type (void); #define WOCKY_TYPE_LL_CONNECTOR \ (wocky_ll_connector_get_type ()) #define WOCKY_LL_CONNECTOR(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_LL_CONNECTOR, \ WockyLLConnector)) #define WOCKY_LL_CONNECTOR_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_LL_CONNECTOR, \ WockyLLConnectorClass)) #define WOCKY_IS_LL_CONNECTOR(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_LL_CONNECTOR)) #define WOCKY_IS_LL_CONNECTOR_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_LL_CONNECTOR)) #define WOCKY_LL_CONNECTOR_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_LL_CONNECTOR, \ WockyLLConnectorClass)) void wocky_ll_connector_incoming_async ( GIOStream *stream, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); void wocky_ll_connector_outgoing_async ( WockyXmppConnection *connection, const gchar *local_jid, const gchar *remote_jid, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyXmppConnection * wocky_ll_connector_finish ( WockyLLConnector *connector, GAsyncResult *result, gchar **from, GError **error); G_END_DECLS #endif /* #ifndef __WOCKY_LL_CONNECTOR_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-openssl-dh2048.c0000644000175000017500000000335512051446215024073 0ustar00wjtwjt00000000000000#ifndef HEADER_DH_H #include #endif DH *get_dh2048(void); DH *get_dh2048(void) { static unsigned char dh2048_p[]={ 0xF6,0x42,0x57,0xB7,0x08,0x7F,0x08,0x17,0x72,0xA2,0xBA,0xD6, 0xA9,0x42,0xF3,0x05,0xE8,0xF9,0x53,0x11,0x39,0x4F,0xB6,0xF1, 0x6E,0xB9,0x4B,0x38,0x20,0xDA,0x01,0xA7,0x56,0xA3,0x14,0xE9, 0x8F,0x40,0x55,0xF3,0xD0,0x07,0xC6,0xCB,0x43,0xA9,0x94,0xAD, 0xF7,0x4C,0x64,0x86,0x49,0xF8,0x0C,0x83,0xBD,0x65,0xE9,0x17, 0xD4,0xA1,0xD3,0x50,0xF8,0xF5,0x59,0x5F,0xDC,0x76,0x52,0x4F, 0x3D,0x3D,0x8D,0xDB,0xCE,0x99,0xE1,0x57,0x92,0x59,0xCD,0xFD, 0xB8,0xAE,0x74,0x4F,0xC5,0xFC,0x76,0xBC,0x83,0xC5,0x47,0x30, 0x61,0xCE,0x7C,0xC9,0x66,0xFF,0x15,0xF9,0xBB,0xFD,0x91,0x5E, 0xC7,0x01,0xAA,0xD3,0x5B,0x9E,0x8D,0xA0,0xA5,0x72,0x3A,0xD4, 0x1A,0xF0,0xBF,0x46,0x00,0x58,0x2B,0xE5,0xF4,0x88,0xFD,0x58, 0x4E,0x49,0xDB,0xCD,0x20,0xB4,0x9D,0xE4,0x91,0x07,0x36,0x6B, 0x33,0x6C,0x38,0x0D,0x45,0x1D,0x0F,0x7C,0x88,0xB3,0x1C,0x7C, 0x5B,0x2D,0x8E,0xF6,0xF3,0xC9,0x23,0xC0,0x43,0xF0,0xA5,0x5B, 0x18,0x8D,0x8E,0xBB,0x55,0x8C,0xB8,0x5D,0x38,0xD3,0x34,0xFD, 0x7C,0x17,0x57,0x43,0xA3,0x1D,0x18,0x6C,0xDE,0x33,0x21,0x2C, 0xB5,0x2A,0xFF,0x3C,0xE1,0xB1,0x29,0x40,0x18,0x11,0x8D,0x7C, 0x84,0xA7,0x0A,0x72,0xD6,0x86,0xC4,0x03,0x19,0xC8,0x07,0x29, 0x7A,0xCA,0x95,0x0C,0xD9,0x96,0x9F,0xAB,0xD0,0x0A,0x50,0x9B, 0x02,0x46,0xD3,0x08,0x3D,0x66,0xA4,0x5D,0x41,0x9F,0x9C,0x7C, 0xBD,0x89,0x4B,0x22,0x19,0x26,0xBA,0xAB,0xA2,0x5E,0xC3,0x55, 0xE9,0x32,0x0B,0x3B, }; static unsigned char dh2048_g[]={ 0x02, }; DH *dh; if ((dh=DH_new()) == NULL) return(NULL); dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); if ((dh->p == NULL) || (dh->g == NULL)) { DH_free(dh); return(NULL); } return(dh); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-auth-registry.c0000644000175000017500000003577512051446215024323 0ustar00wjtwjt00000000000000/* wocky-auth-registry.c */ #include "wocky-auth-registry.h" #include "wocky-auth-handler.h" #include "wocky-sasl-scram.h" #include "wocky-sasl-digest-md5.h" #include "wocky-sasl-plain.h" #include "wocky-jabber-auth-password.h" #include "wocky-jabber-auth-digest.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyAuthRegistry, wocky_auth_registry, G_TYPE_OBJECT) /* private structure */ struct _WockyAuthRegistryPrivate { gboolean dispose_has_run; WockyAuthHandler *handler; GSList *handlers; }; static void wocky_auth_registry_start_auth_async_func (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data); static gboolean wocky_auth_registry_start_auth_finish_func ( WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error); static void wocky_auth_registry_challenge_async_func (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data); static gboolean wocky_auth_registry_challenge_finish_func ( WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error); static void wocky_auth_registry_success_async_func (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data); static gboolean wocky_auth_registry_success_finish_func ( WockyAuthRegistry *self, GAsyncResult *result, GError **error); GQuark wocky_auth_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("wocky_auth_error"); return quark; } static void wocky_auth_registry_constructed (GObject *object) { } static void wocky_auth_registry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_auth_registry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_auth_registry_dispose (GObject *object) { WockyAuthRegistry *self = WOCKY_AUTH_REGISTRY (object); WockyAuthRegistryPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (priv->handler != NULL) { g_object_unref (priv->handler); } if (priv->handlers != NULL) { g_slist_foreach (priv->handlers, (GFunc) g_object_unref, NULL); g_slist_free (priv->handlers); } G_OBJECT_CLASS (wocky_auth_registry_parent_class)->dispose (object); } static void wocky_auth_registry_finalize (GObject *object) { G_OBJECT_CLASS (wocky_auth_registry_parent_class)->finalize (object); } static void wocky_auth_registry_class_init (WockyAuthRegistryClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockyAuthRegistryPrivate)); object_class->constructed = wocky_auth_registry_constructed; object_class->get_property = wocky_auth_registry_get_property; object_class->set_property = wocky_auth_registry_set_property; object_class->dispose = wocky_auth_registry_dispose; object_class->finalize = wocky_auth_registry_finalize; klass->start_auth_async_func = wocky_auth_registry_start_auth_async_func; klass->start_auth_finish_func = wocky_auth_registry_start_auth_finish_func; klass->challenge_async_func = wocky_auth_registry_challenge_async_func; klass->challenge_finish_func = wocky_auth_registry_challenge_finish_func; klass->success_async_func = wocky_auth_registry_success_async_func; klass->success_finish_func = wocky_auth_registry_success_finish_func; klass->failure_func = NULL; } static void wocky_auth_registry_init (WockyAuthRegistry *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_AUTH_REGISTRY, WockyAuthRegistryPrivate); } WockyAuthRegistry * wocky_auth_registry_new (void) { return g_object_new (WOCKY_TYPE_AUTH_REGISTRY, NULL); } static gboolean wocky_auth_registry_has_mechanism (const GSList *list, const gchar *mech) { GSList *t; t = g_slist_find_custom ((GSList *) list, mech, (GCompareFunc) g_strcmp0); return (t != NULL); } WockyAuthRegistryStartData * wocky_auth_registry_start_data_new (const gchar *mechanism, const GString *initial_response) { WockyAuthRegistryStartData *start_data = g_slice_new0 ( WockyAuthRegistryStartData); start_data->mechanism = g_strdup (mechanism); start_data->initial_response = wocky_g_string_dup (initial_response); return start_data; } WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup (WockyAuthRegistryStartData *start_data) { return wocky_auth_registry_start_data_new ( start_data->mechanism, start_data->initial_response); } void wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data) { g_free (start_data->mechanism); if (start_data->initial_response != NULL) g_string_free (start_data->initial_response, TRUE); g_slice_free (WockyAuthRegistryStartData, start_data); } static gboolean wocky_auth_registry_select_handler (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, WockyAuthHandler **out_handler) { WockyAuthRegistryPrivate *priv = self->priv; GSList *k; for (k = priv->handlers; k != NULL; k = k->next) { WockyAuthHandler *handler = k->data; const gchar *handler_mech = wocky_auth_handler_get_mechanism (handler); if (wocky_auth_handler_is_plain (handler) && !allow_plain) continue; if (wocky_auth_registry_has_mechanism (mechanisms, handler_mech)) { if (out_handler != NULL) *out_handler = g_object_ref (handler); return TRUE; } } if (wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1)) { if (out_handler != NULL) { /* XXX: check for username and password here? */ DEBUG ("Choosing SCRAM-SHA-1 as auth mechanism"); *out_handler = WOCKY_AUTH_HANDLER (wocky_sasl_scram_new ( server, username, password)); } return TRUE; } if (wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_SASL_DIGEST_MD5)) { if (out_handler != NULL) { /* XXX: check for username and password here? */ *out_handler = WOCKY_AUTH_HANDLER (wocky_sasl_digest_md5_new ( server, username, password)); } return TRUE; } if (wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_JABBER_DIGEST)) { if (out_handler != NULL) { *out_handler = WOCKY_AUTH_HANDLER (wocky_jabber_auth_digest_new ( session_id, password)); } return TRUE; } if (allow_plain && wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_SASL_PLAIN)) { if (out_handler != NULL) { /* XXX: check for username and password here? */ DEBUG ("Choosing PLAIN as auth mechanism"); *out_handler = WOCKY_AUTH_HANDLER (wocky_sasl_plain_new ( username, password)); } return TRUE; } if (allow_plain && wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_JABBER_PASSWORD)) { if (out_handler != NULL) { *out_handler = WOCKY_AUTH_HANDLER (wocky_jabber_auth_password_new ( password)); } return TRUE; } if (out_handler) *out_handler = NULL; return FALSE; } static void wocky_auth_registry_start_auth_async_func (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryPrivate *priv = self->priv; GSimpleAsyncResult *result; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_auth_registry_start_auth_async); g_assert (priv->handler == NULL); if (!wocky_auth_registry_select_handler (self, mechanisms, allow_plain, username, password, server, session_id, &priv->handler)) { g_simple_async_result_set_error (result, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, "No supported mechanisms found"); } else { GString *initial_data; GError *error = NULL; if (!wocky_auth_handler_get_initial_response (priv->handler, &initial_data, &error)) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { WockyAuthRegistryStartData *start_data = wocky_auth_registry_start_data_new ( wocky_auth_handler_get_mechanism (priv->handler), initial_data); g_simple_async_result_set_op_res_gpointer (result, start_data, (GDestroyNotify) wocky_auth_registry_start_data_free); wocky_g_string_free (initial_data); } } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void wocky_auth_registry_start_auth_async (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); cls->start_auth_async_func (self, mechanisms, allow_plain, is_secure_channel, username, password, server, session_id, callback, user_data); } gboolean wocky_auth_registry_start_auth_finish (WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); return cls->start_auth_finish_func (self, result, start_data, error); } static gboolean wocky_auth_registry_start_auth_finish_func (WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_auth_registry_start_auth_async, wocky_auth_registry_start_data_dup, start_data); } static void wocky_auth_registry_challenge_async_func (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryPrivate *priv = self->priv; GString *response = NULL; GError *error = NULL; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_auth_registry_challenge_async); g_assert (priv->handler != NULL); if (!wocky_auth_handler_handle_auth_data (priv->handler, challenge_data, &response, &error)) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gpointer (result, response, (GDestroyNotify) wocky_g_string_free); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void wocky_auth_registry_challenge_async (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); cls->challenge_async_func (self, challenge_data, callback, user_data); } gboolean wocky_auth_registry_challenge_finish (WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); return cls->challenge_finish_func (self, result, response, error); } static gboolean wocky_auth_registry_challenge_finish_func (WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_auth_registry_challenge_async, wocky_g_string_dup, response); } static void wocky_auth_registry_success_async_func (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryPrivate *priv = self->priv; GError *error = NULL; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_auth_registry_success_async); g_assert (priv->handler != NULL); if (!wocky_auth_handler_handle_success (priv->handler, &error)) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void wocky_auth_registry_success_async (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); cls->success_async_func (self, callback, user_data); } gboolean wocky_auth_registry_success_finish (WockyAuthRegistry *self, GAsyncResult *result, GError **error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); return cls->success_finish_func (self, result, error); } static gboolean wocky_auth_registry_success_finish_func (WockyAuthRegistry *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_auth_registry_success_async); } void wocky_auth_registry_failure (WockyAuthRegistry *self, GError *error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); if (cls->failure_func != NULL) cls->failure_func (self, error); } void wocky_auth_registry_add_handler (WockyAuthRegistry *self, WockyAuthHandler *handler) { WockyAuthRegistryPrivate *priv = self->priv; g_object_ref (handler); priv->handlers = g_slist_append (priv->handlers, handler); } /** * wocky_auth_registry_supports_one_of: * @self: a #WockyAuthRegistry * @allow_plain: Whether auth in plain text is allowed * @mechanisms: a #GSList of gchar* of auth mechanisms * * Checks whether at least one of @mechanisms is supported by Wocky. At present, * Wocky itself only implements password-based authentication mechanisms. * * Returns: %TRUE if one of the @mechanisms is supported by wocky, * %FALSE otherwise. */ gboolean wocky_auth_registry_supports_one_of (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain) { return wocky_auth_registry_select_handler (self, mechanisms, allow_plain, NULL, NULL, NULL, NULL, NULL); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-caps-hash.h0000644000175000017500000000253312050202021023332 0ustar00wjtwjt00000000000000/* * wocky-caps-hash.h - Headers for computing verification string hash (XEP-0115 v1.5) * Copyright (C) 2008-2011 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_CAPS_HASH_H__ #define __WOCKY_CAPS_HASH_H__ #include "wocky-node.h" gchar * wocky_caps_hash_compute_from_node ( WockyNode *node) G_GNUC_WARN_UNUSED_RESULT; gchar * wocky_caps_hash_compute_from_lists ( GPtrArray *features, GPtrArray *identities, GPtrArray *dataforms) G_GNUC_WARN_UNUSED_RESULT; #endif /* #ifndef __WOCKY_CAPS_HASH_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-pep-service.h0000644000175000017500000000600212050202021023700 0ustar00wjtwjt00000000000000/* * wocky-pep-service.h - Header of WockyPepService * Copyright © 2009, 2012 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_PEP_SERVICE_H__ #define __WOCKY_PEP_SERVICE_H__ #include #include #include "wocky-stanza.h" #include "wocky-session.h" G_BEGIN_DECLS /** * WockyPepService: * * Object to aid with looking up PEP nodes and listening for changes. */ typedef struct _WockyPepService WockyPepService; /** * WockyPepServiceClass: * * The class of a #WockyPepService. */ typedef struct _WockyPepServiceClass WockyPepServiceClass; typedef struct _WockyPepServicePrivate WockyPepServicePrivate; struct _WockyPepServiceClass { /**/ GObjectClass parent_class; }; struct _WockyPepService { /**/ GObject parent; WockyPepServicePrivate *priv; }; GType wocky_pep_service_get_type (void); #define WOCKY_TYPE_PEP_SERVICE \ (wocky_pep_service_get_type ()) #define WOCKY_PEP_SERVICE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_PEP_SERVICE, \ WockyPepService)) #define WOCKY_PEP_SERVICE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_PEP_SERVICE, \ WockyPepServiceClass)) #define WOCKY_IS_PEP_SERVICE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_PEP_SERVICE)) #define WOCKY_IS_PEP_SERVICE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_PEP_SERVICE)) #define WOCKY_PEP_SERVICE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_PEP_SERVICE, \ WockyPepServiceClass)) WockyPepService * wocky_pep_service_new (const gchar *node, gboolean subscribe) G_GNUC_WARN_UNUSED_RESULT; void wocky_pep_service_start (WockyPepService *self, WockySession *session); void wocky_pep_service_get_async (WockyPepService *self, WockyBareContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyStanza * wocky_pep_service_get_finish (WockyPepService *self, GAsyncResult *result, WockyNode **item, GError **error) G_GNUC_WARN_UNUSED_RESULT; WockyStanza * wocky_pep_service_make_publish_stanza (WockyPepService *self, WockyNode **item) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS #endif /* __WOCKY_PEP_SERVICE_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-auth-registry.h0000644000175000017500000002544112050202021024275 0ustar00wjtwjt00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif /* wocky-auth-registry.h */ #ifndef _WOCKY_AUTH_REGISTRY_H #define _WOCKY_AUTH_REGISTRY_H #include #include #include "wocky-auth-handler.h" #include "wocky-auth-registry-enumtypes.h" G_BEGIN_DECLS GQuark wocky_auth_error_quark (void); #define WOCKY_AUTH_ERROR \ wocky_auth_error_quark () /** * WockyAuthError: * @WOCKY_AUTH_ERROR_INIT_FAILED: Failed to initialize our auth * support * @WOCKY_AUTH_ERROR_NOT_SUPPORTED: Server doesn't support this * authentication method * @WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS: Server doesn't support * any mechanisms that we support * @WOCKY_AUTH_ERROR_NETWORK: Couldn't send our stanzas to the server * @WOCKY_AUTH_ERROR_INVALID_REPLY: Server sent an invalid reply * @WOCKY_AUTH_ERROR_NO_CREDENTIALS: Failure to provide user * credentials * @WOCKY_AUTH_ERROR_FAILURE: Server sent a failure * @WOCKY_AUTH_ERROR_CONNRESET: disconnected * @WOCKY_AUTH_ERROR_STREAM: XMPP stream error while authing * @WOCKY_AUTH_ERROR_RESOURCE_CONFLICT: Resource conflict (relevant in * in jabber auth) * @WOCKY_AUTH_ERROR_NOT_AUTHORIZED: Provided credentials are not * valid * * #WockyAuthRegistry specific errors. */ typedef enum { WOCKY_AUTH_ERROR_INIT_FAILED, WOCKY_AUTH_ERROR_NOT_SUPPORTED, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, WOCKY_AUTH_ERROR_NETWORK, WOCKY_AUTH_ERROR_INVALID_REPLY, WOCKY_AUTH_ERROR_NO_CREDENTIALS, WOCKY_AUTH_ERROR_FAILURE, WOCKY_AUTH_ERROR_CONNRESET, WOCKY_AUTH_ERROR_STREAM, WOCKY_AUTH_ERROR_RESOURCE_CONFLICT, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, } WockyAuthError; #define WOCKY_AUTH_MECH_JABBER_DIGEST "X-WOCKY-JABBER-DIGEST" #define WOCKY_AUTH_MECH_JABBER_PASSWORD "X-WOCKY-JABBER-PASSWORD" #define WOCKY_AUTH_MECH_SASL_DIGEST_MD5 "DIGEST-MD5" #define WOCKY_AUTH_MECH_SASL_PLAIN "PLAIN" #define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1 "SCRAM-SHA-1" /** * WockyAuthRegistryStartData: * @mechanism: the name of the mechanism * @initial_response: the data in the response * * A structure to hold the mechanism and response data. */ typedef struct { gchar *mechanism; GString *initial_response; } WockyAuthRegistryStartData; #define WOCKY_TYPE_AUTH_REGISTRY wocky_auth_registry_get_type() #define WOCKY_AUTH_REGISTRY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ WOCKY_TYPE_AUTH_REGISTRY, WockyAuthRegistry)) #define WOCKY_AUTH_REGISTRY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ WOCKY_TYPE_AUTH_REGISTRY, WockyAuthRegistryClass)) #define WOCKY_IS_AUTH_REGISTRY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ WOCKY_TYPE_AUTH_REGISTRY)) #define WOCKY_IS_AUTH_REGISTRY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ WOCKY_TYPE_AUTH_REGISTRY)) #define WOCKY_AUTH_REGISTRY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ WOCKY_TYPE_AUTH_REGISTRY, WockyAuthRegistryClass)) typedef struct _WockyAuthRegistry WockyAuthRegistry; /** * WockyAuthRegistryClass: * @start_auth_async_func: a function to call to start an asynchronous * start auth operation; see wocky_auth_registry_start_auth_async() for * more details. * @start_auth_finish_func: a function to call to finish an * asynchronous start auth operation; see * wocky_auth_registry_start_auth_finish() for more details. * @challenge_async_func: a function to call to start an asynchronous * challenge operation; see wocky_auth_registry_challenge_async() for * more details. * @challenge_finish_func: a function to call to finish an asynchronous * challenge operation; see wocky_auth_registry_challenge_finish() for * more details. * @success_async_func: a function to call to start an asynchronous * success operation; see wocky_auth_registry_success_async() for * more details. * @success_finish_func: a function to call to finish an asynchronous * success operation; see wocky_auth_registry_success_finish() for * more details. * @failure_func: a function to call on failure; see * wocky_auth_registry_failure() for more details. * * The class of a #WockyAuthRegistry. */ typedef struct _WockyAuthRegistryClass WockyAuthRegistryClass; typedef struct _WockyAuthRegistryPrivate WockyAuthRegistryPrivate; /** * WockyAuthRegistryStartAuthAsyncFunc: * @self: a #WockyAuthRegistry object * @mechanisms: a list of avahilable mechanisms * @allow_plain: %TRUE if PLAIN is allowed, otherwise %FALSE * @is_secure_channel: %TRUE if channel is secure, otherwise %FALSE * @username: the username * @password: the password * @server: the server * @session_id: the session ID * @callback: a callback to be called when finished * @user_data: data to pass to @callback * * Starts a async authentication: chooses mechanism and gets initial data. * The default function chooses a #WockyAuthHandler by which mechanism it * supports and gets the initial data from the chosen handler. */ typedef void (*WockyAuthRegistryStartAuthAsyncFunc) (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data); /** * WockyAuthRegistryStartAuthFinishFunc: * @self: a #WockyAuthRegistry object * @result: a #GAsyncResult object * @start_data: a location to fill with a #WockyAuthRegistryStartData structure * @error: a location to fill with a #GError if an error is hit, or %NULL * * Called to finish the #GAsyncResult task for authentication * start. By default, it extracts a #WockyAuthRegistryStartData * pointer from a given #GSimpleAsyncResult and copies it to the out * param. * * Returns: %TRUE on success, otherwise %FALSE */ typedef gboolean (*WockyAuthRegistryStartAuthFinishFunc) ( WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error); /** * WockyAuthRegistryChallengeAsyncFunc: * @self: a #WockyAuthRegistry object * @challenge_data: the challenge data string * @callback: a callback to call when finished * @user_data: data to pass to @callback * * Recieves a challenge and asynchronously provides a reply. By * default the challenge is passed on to the chosen #WockyAuthHandler. */ typedef void (*WockyAuthRegistryChallengeAsyncFunc) (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data); /** * WockyAuthRegistryChallengeFinishFunc: * @self: a #WockyAuthRegistry object * @result: a #GAsyncResult object * @response: a location to be filled with the response string * @error: a location to fill with a #GError if an error is hit, or %NULL * * Finishes a #GAsyncResult from * #WockyAuthRegistryChallengeAsyncFunc. By default it extracts a * #GString response from the given #GSimpleAsyncResult and copies it * to the out param. * * Returns: %TRUE on success, otherwise %FALSE */ typedef gboolean (*WockyAuthRegistryChallengeFinishFunc) ( WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error); /** * WockyAuthRegistrySuccessAsyncFunc: * @self: a #WockyAuthRegistry object * @callback: a callback to be called when finished * @user_data: data to pass to @callback * * Notifies the registry of authentication success, and allows a last ditch * attempt at aborting the authentication at the client's discretion. */ typedef void (*WockyAuthRegistrySuccessAsyncFunc) (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data); /** * WockyAuthRegistrySuccessFinishFunc: * @self: a #WockyAuthRegistry object * @result: a #GAsyncResult object * @error: a location to fill with a #GError if an error is hit, or %NULL * * Finishes a #GAsyncResult from * #WockyAuthRegistrySuccessAsyncFunc. It checks for any errors set on * the given #GSimpleAsyncResult, copies the #GError to an out param * and returns %FALSE if there was an error. * * Returns: %TRUE on success, otherwise %FALSE */ typedef gboolean (*WockyAuthRegistrySuccessFinishFunc) ( WockyAuthRegistry *self, GAsyncResult *result, GError **error); /** * WockyAuthRegistryFailureFunc: * @self: a #WockyAuthRegistry object * @error: a #GError describing the failure * * Notifies the client of a server-side error. By default this is not * implemented. * */ typedef void (*WockyAuthRegistryFailureFunc) (WockyAuthRegistry *self, GError *error); struct _WockyAuthRegistry { /**/ GObject parent; WockyAuthRegistryPrivate *priv; }; struct _WockyAuthRegistryClass { /**/ GObjectClass parent_class; /**/ WockyAuthRegistryStartAuthAsyncFunc start_auth_async_func; WockyAuthRegistryStartAuthFinishFunc start_auth_finish_func; WockyAuthRegistryChallengeAsyncFunc challenge_async_func; WockyAuthRegistryChallengeFinishFunc challenge_finish_func; WockyAuthRegistrySuccessAsyncFunc success_async_func; WockyAuthRegistrySuccessFinishFunc success_finish_func; WockyAuthRegistryFailureFunc failure_func; }; GType wocky_auth_registry_get_type (void) G_GNUC_CONST; WockyAuthRegistry *wocky_auth_registry_new (void); void wocky_auth_registry_start_auth_async (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_auth_registry_start_auth_finish (WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error); void wocky_auth_registry_challenge_async (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_auth_registry_challenge_finish (WockyAuthRegistry *self, GAsyncResult *res, GString **response, GError **error); void wocky_auth_registry_success_async (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_auth_registry_success_finish (WockyAuthRegistry *self, GAsyncResult *res, GError **error); void wocky_auth_registry_add_handler (WockyAuthRegistry *self, WockyAuthHandler *handler); void wocky_auth_registry_start_data_free ( WockyAuthRegistryStartData *start_data); WockyAuthRegistryStartData * wocky_auth_registry_start_data_new ( const gchar *mechanism, const GString *initial_response); WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup ( WockyAuthRegistryStartData *start_data); void wocky_auth_registry_failure (WockyAuthRegistry *self, GError *error); gboolean wocky_auth_registry_supports_one_of (WockyAuthRegistry *self, const GSList *mechanisms, gboolean allow_plain); G_END_DECLS #endif /* _WOCKY_AUTH_REGISTRY_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-node-tree.h0000644000175000017500000000511612050202021023345 0ustar00wjtwjt00000000000000/* * wocky-node-tree.h - Header for WockyNodeTree * Copyright (C) 2006-2010 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_NODE_TREE_H__ #define __WOCKY_NODE_TREE_H__ #include #include #include "wocky-node.h" #include "wocky-types.h" #include "wocky-xmpp-error.h" G_BEGIN_DECLS /** * WockyNodeTreeClass: * * The class of a #WockyNodeTree. */ typedef struct _WockyNodeTreeClass WockyNodeTreeClass; typedef struct _WockyNodeTreePrivate WockyNodeTreePrivate; struct _WockyNodeTreeClass { /**/ GObjectClass parent_class; }; struct _WockyNodeTree { /**/ GObject parent; WockyNodeTreePrivate *priv; }; GType wocky_node_tree_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_NODE_TREE \ (wocky_node_tree_get_type ()) #define WOCKY_NODE_TREE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_NODE_TREE, \ WockyNodeTree)) #define WOCKY_NODE_TREE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_NODE_TREE, \ WockyNodeTreeClass)) #define WOCKY_IS_NODE_TREE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_NODE_TREE)) #define WOCKY_IS_NODE_TREE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_NODE_TREE)) #define WOCKY_NODE_TREE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_NODE_TREE, \ WockyNodeTreeClass)) WockyNodeTree *wocky_node_tree_new (const gchar *name, const gchar *ns, ...) G_GNUC_NULL_TERMINATED; WockyNodeTree *wocky_node_tree_new_va (const gchar *name, const char *ns, va_list va); WockyNodeTree *wocky_node_tree_new_from_node (WockyNode *node); WockyNode *wocky_node_tree_get_top_node (WockyNodeTree *self); G_END_DECLS #endif /* #ifndef __WOCKY_NODE_TREE_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-loopback-stream.h0000644000175000017500000000446612050202021024555 0ustar00wjtwjt00000000000000/* * wocky-loopback-stream.h - Header for WockyLoopbackStream * Copyright (C) 2009-2011 Collabora Ltd. * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_LOOPBACK_STREAM_H__ #define __WOCKY_LOOPBACK_STREAM_H__ #include #include G_BEGIN_DECLS typedef struct _WockyLoopbackStream WockyLoopbackStream; typedef struct _WockyLoopbackStreamClass WockyLoopbackStreamClass; typedef struct _WockyLoopbackStreamPrivate WockyLoopbackStreamPrivate; struct _WockyLoopbackStreamClass { GIOStreamClass parent_class; }; struct _WockyLoopbackStream { GIOStream parent; WockyLoopbackStreamPrivate *priv; }; GType wocky_loopback_stream_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_LOOPBACK_STREAM \ (wocky_loopback_stream_get_type ()) #define WOCKY_LOOPBACK_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_LOOPBACK_STREAM, \ WockyLoopbackStream)) #define WOCKY_LOOPBACK_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_LOOPBACK_STREAM, \ WockyLoopbackStreamClass)) #define WOCKY_IS_LOOPBACK_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_LOOPBACK_STREAM)) #define WOCKY_IS_LOOPBACK_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_LOOPBACK_STREAM)) #define WOCKY_LOOPBACK_STREAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_LOOPBACK_STREAM, \ WockyLoopbackStreamClass)) GIOStream * wocky_loopback_stream_new (void); G_END_DECLS #endif /* #ifndef __WOCKY_LOOPBACK_STREAM_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-roster.c0000644000175000017500000011374412051446215023023 0ustar00wjtwjt00000000000000/* * wocky-roster.c - Source for WockyRoster * Copyright (C) 2009 Collabora Ltd. * @author Jonny Lamb * * 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 */ /** * SECTION: wocky-roster * @title: WockyRoster * @short_description: TODO * * TODO */ #include #include #include "wocky-roster.h" #include "wocky-bare-contact.h" #include "wocky-c2s-porter.h" #include "wocky-namespaces.h" #include "wocky-stanza.h" #include "wocky-utils.h" #include "wocky-signals-marshal.h" #include "wocky-contact-factory.h" #include "wocky-porter.h" #include "wocky-session.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_ROSTER #include "wocky-debug-internal.h" #define GOOGLE_ROSTER_VERSION "2" G_DEFINE_TYPE (WockyRoster, wocky_roster, G_TYPE_OBJECT) typedef struct { WockyRoster *self; /* The result of the already-sent operation */ /* List of GSimpleAsyncResult to which an IQ has been sent to the server and * that will be completed once we receive the reply of this IQ. */ GSList *flying_operations; gchar *jid; /* The future name of the contact, or NULL to not change it */ gchar *new_name; /* (const gchar *) => TRUE * Each key is a group to add to the contact */ GHashTable *groups_to_add; /* owned (gchar *) => TRUE * Each key is a group to remove from the contact */ GHashTable *groups_to_remove; /* TRUE if a 'add' operation is waiting */ gboolean add_contact; /* TRUE if a 'remove' operation is waiting */ gboolean remove_contact; /* List of GSimpleAsyncResult that will be completed once the changes stored * in this PendingOperation structure will have be completed */ GSList *waiting_operations; } PendingOperation; static PendingOperation * pending_operation_new (WockyRoster *self, GSimpleAsyncResult *result, const gchar *jid) { PendingOperation *pending = g_slice_new0 (PendingOperation); g_assert (self != NULL); g_assert (result != NULL); g_assert (jid != NULL); pending->self = g_object_ref (self); pending->flying_operations = g_slist_append (pending->flying_operations, result); pending->jid = g_strdup (jid); pending->groups_to_add = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); pending->groups_to_remove = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); return pending; } static void pending_operation_free (PendingOperation *pending) { g_object_unref (pending->self); g_free (pending->new_name); g_free (pending->jid); g_slist_foreach (pending->flying_operations, (GFunc) g_object_unref, NULL); g_slist_free (pending->flying_operations); g_slist_foreach (pending->waiting_operations, (GFunc) g_object_unref, NULL); g_slist_free (pending->waiting_operations); g_hash_table_unref (pending->groups_to_add); g_hash_table_unref (pending->groups_to_remove); g_slice_free (PendingOperation, pending); } static void pending_operation_set_new_name (PendingOperation *pending, const gchar *name) { g_free (pending->new_name); pending->new_name = g_strdup (name); } static void pending_operation_set_groups (PendingOperation *pending, GStrv groups) { guint i; g_hash_table_remove_all (pending->groups_to_add); g_hash_table_remove_all (pending->groups_to_remove); for (i = 0; groups[i] != NULL; i++) g_hash_table_insert (pending->groups_to_add, g_strdup (groups[i]), GUINT_TO_POINTER (TRUE)); } static void pending_operation_add_group (PendingOperation *pending, const gchar *group) { g_hash_table_insert (pending->groups_to_add, g_strdup (group), GUINT_TO_POINTER (TRUE)); g_hash_table_remove (pending->groups_to_remove, group); } static void pending_operation_remove_group (PendingOperation *pending, const gchar *group) { g_hash_table_insert (pending->groups_to_remove, g_strdup (group), GUINT_TO_POINTER (TRUE)); g_hash_table_remove (pending->groups_to_add, group); } static void pending_operation_set_add (PendingOperation *pending) { pending->add_contact = TRUE; pending->remove_contact = FALSE; } static void pending_operation_set_remove (PendingOperation *pending) { pending->add_contact = FALSE; pending->remove_contact = TRUE; } static void pending_operation_add_waiting_operation (PendingOperation *pending, GSimpleAsyncResult *result) { pending->waiting_operations = g_slist_append (pending->waiting_operations, result); } static gboolean pending_operation_has_changes (PendingOperation *pending) { if (pending->new_name != NULL) return TRUE; if (g_hash_table_size (pending->groups_to_add) > 0) return TRUE; if (g_hash_table_size (pending->groups_to_remove) > 0) return TRUE; if (pending->add_contact) return TRUE; if (pending->remove_contact) return TRUE; return FALSE; } /* Called when the flying operations have been completed and the IQ to complete * the waiting operations has been sent. */ static void pending_operation_reset (PendingOperation *pending) { /* Free old flying operations */ g_slist_foreach (pending->flying_operations, (GFunc) g_object_unref, NULL); g_slist_free (pending->flying_operations); /* Previously waiting operations are now flying */ pending->flying_operations = pending->waiting_operations; pending->waiting_operations = NULL; } /* properties */ enum { PROP_SESSION = 1, }; /* signal enum */ enum { ADDED, REMOVED, LAST_SIGNAL, }; static guint signals[LAST_SIGNAL] = {0}; /* private structure */ struct _WockyRosterPrivate { WockySession *session; WockyPorter *porter; WockyContactFactory *contact_factory; /* owned (gchar *) => reffed (WockyBareContact *) */ GHashTable *items; guint iq_cb; /* owned (gchar *) => owned (PendingOperation *) * When an edit attempt is "in-flight", we store a PendingOperation * in * this hash table which will be used to store required edits until the one * we already sent is acknowledged. This prevents some race conditions. */ GHashTable *pending_operations; GSimpleAsyncResult *fetch_result; gboolean dispose_has_run; }; /** * wocky_roster_error_quark * * Get the error quark used by the roster. * * Returns: the quark for roster errors. */ GQuark wocky_roster_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-roster-error"); return quark; } static void change_roster_iq_cb (GObject *source_object, GAsyncResult *send_iq_res, gpointer user_data); static void wocky_roster_init (WockyRoster *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_ROSTER, WockyRosterPrivate); } static void wocky_roster_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyRoster *self = WOCKY_ROSTER (object); WockyRosterPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION: /* Don't keep a ref on the session at the session keeps a ref on the * roster */ priv->session = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_roster_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyRoster *self = WOCKY_ROSTER (object); WockyRosterPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION: g_value_set_object (value, priv->session); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } const gchar * wocky_roster_subscription_to_string (WockyRosterSubscriptionFlags subscription) { switch (subscription) { case WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE: return "none"; case WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO: return "to"; case WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM: return "from"; case WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH: return "both"; default: g_assert_not_reached (); return NULL; } } static void remove_item (WockyRoster *self, const gchar *jid) { WockyRosterPrivate *priv = self->priv; WockyBareContact *contact; contact = g_hash_table_lookup (priv->items, jid); if (contact == NULL) { DEBUG ("%s is not in the roster; can't remove it", jid); return; } /* Removing the contact from the hash table will unref it. Keep it a ref * while firing the 'removed' signal. */ g_object_ref (contact); g_hash_table_remove (priv->items, jid); g_signal_emit (self, signals[REMOVED], 0, contact); g_object_unref (contact); } static gboolean roster_update (WockyRoster *self, WockyStanza *stanza, gboolean fire_signals, GError **error) { WockyRosterPrivate *priv = self->priv; WockyNode *query_node; GSList *j; /* Check stanza contains query node. */ query_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (stanza), "query", WOCKY_XMPP_NS_ROSTER); if (query_node == NULL) { g_set_error_literal (error, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_INVALID_STANZA, "IQ does not have query node"); return FALSE; } /* Iterate through item nodes. */ for (j = query_node->children; j; j = j->next) { const gchar *jid; WockyNode *n = (WockyNode *) j->data; WockyBareContact *contact = NULL; const gchar *subscription; WockyRosterSubscriptionFlags subscription_type; GPtrArray *groups_arr; GStrv groups = { NULL }; GSList *l; if (wocky_strdiff (n->name, "item")) { DEBUG ("Node %s is not item, skipping", n->name); continue; } jid = wocky_node_get_attribute (n, "jid"); if (jid == NULL) { DEBUG ("Node %s has no jid attribute, skipping", n->name); continue; } if (strchr (jid, '/') != NULL) { DEBUG ("Item node has resource in jid, skipping"); continue; } /* Parse item. */ subscription = wocky_node_get_attribute (n, "subscription"); if (!wocky_strdiff (subscription, "to")) subscription_type = WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO; else if (!wocky_strdiff (subscription, "from")) subscription_type = WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM; else if (!wocky_strdiff (subscription, "both")) subscription_type = WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH; else if (!wocky_strdiff (subscription, "none")) subscription_type = WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE; else if (!wocky_strdiff (subscription, "remove")) { remove_item (self, jid); continue; } else { DEBUG ("Unknown subscription: %s; ignoring", subscription); continue; } groups_arr = g_ptr_array_new (); /* Look for "group" nodes */ for (l = n->children; l != NULL; l = g_slist_next (l)) { WockyNode *node = (WockyNode *) l->data; if (wocky_strdiff (node->name, "group")) continue; g_ptr_array_add (groups_arr, g_strdup (node->content)); } /* Add trailing NULL */ g_ptr_array_add (groups_arr, NULL); groups = (GStrv) g_ptr_array_free (groups_arr, FALSE); contact = g_hash_table_lookup (priv->items, jid); if (contact != NULL) { /* Contact already exists; update. */ wocky_bare_contact_set_name (contact, wocky_node_get_attribute (n, "name")); wocky_bare_contact_set_subscription (contact, subscription_type); wocky_bare_contact_set_groups (contact, groups); } else { /* Create a new contact. */ contact = wocky_contact_factory_ensure_bare_contact ( priv->contact_factory, jid); g_object_set (contact, "name", wocky_node_get_attribute (n, "name"), "subscription", subscription_type, "groups", groups, NULL); g_hash_table_insert (priv->items, g_strdup (jid), contact); DEBUG ("New contact added:"); wocky_bare_contact_debug_print (contact); if (fire_signals) g_signal_emit (self, signals[ADDED], 0, contact); } g_strfreev (groups); } return TRUE; } static gboolean roster_iq_handler_set_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyRoster *self = WOCKY_ROSTER (user_data); GError *error = NULL; WockyStanza *reply; if (!roster_update (self, stanza, TRUE, &error)) { DEBUG ("Failed to update roster: %s", error ? error->message : "no message"); g_error_free (error); reply = wocky_stanza_build_iq_error (stanza, NULL); } else { /* ack */ reply = wocky_stanza_build_iq_result (stanza, NULL); } if (reply != NULL) { wocky_porter_send (porter, reply); g_object_unref (reply); } return TRUE; } static void wocky_roster_constructed (GObject *object) { WockyRoster *self = WOCKY_ROSTER (object); WockyRosterPrivate *priv = self->priv; priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->pending_operations = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) pending_operation_free); g_assert (priv->session != NULL); priv->porter = wocky_session_get_porter (priv->session); g_assert (priv->porter != NULL); g_object_ref (priv->porter); priv->iq_cb = wocky_c2s_porter_register_handler_from_server ( WOCKY_C2S_PORTER (priv->porter), WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, roster_iq_handler_set_cb, self, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); priv->contact_factory = wocky_session_get_contact_factory (priv->session); g_assert (priv->contact_factory != NULL); g_object_ref (priv->contact_factory); } static void wocky_roster_dispose (GObject *object) { WockyRoster *self = WOCKY_ROSTER (object); WockyRosterPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->iq_cb != 0) { wocky_porter_unregister_handler (priv->porter, priv->iq_cb); priv->iq_cb = 0; } g_object_unref (priv->porter); g_object_unref (priv->contact_factory); if (G_OBJECT_CLASS (wocky_roster_parent_class)->dispose) G_OBJECT_CLASS (wocky_roster_parent_class)->dispose (object); } static void wocky_roster_finalize (GObject *object) { WockyRoster *self = WOCKY_ROSTER (object); WockyRosterPrivate *priv = self->priv; g_hash_table_unref (priv->items); g_hash_table_unref (priv->pending_operations); G_OBJECT_CLASS (wocky_roster_parent_class)->finalize (object); } static void wocky_roster_class_init (WockyRosterClass *wocky_roster_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_roster_class); GParamSpec *spec; g_type_class_add_private (wocky_roster_class, sizeof (WockyRosterPrivate)); object_class->constructed = wocky_roster_constructed; object_class->set_property = wocky_roster_set_property; object_class->get_property = wocky_roster_get_property; object_class->dispose = wocky_roster_dispose; object_class->finalize = wocky_roster_finalize; spec = g_param_spec_object ("session", "Wocky session", "the wocky session used by this roster", WOCKY_TYPE_SESSION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SESSION, spec); signals[ADDED] = g_signal_new ("added", G_OBJECT_CLASS_TYPE (wocky_roster_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[REMOVED] = g_signal_new ("removed", G_OBJECT_CLASS_TYPE (wocky_roster_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); } WockyRoster * wocky_roster_new (WockySession *session) { g_return_val_if_fail (WOCKY_IS_SESSION (session), NULL); return g_object_new (WOCKY_TYPE_ROSTER, "session", session, NULL); } static void roster_fetch_roster_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { GError *error = NULL; WockyStanza *iq; WockyRoster *self = WOCKY_ROSTER (user_data); WockyRosterPrivate *priv = self->priv; iq = wocky_porter_send_iq_finish (WOCKY_PORTER (source_object), res, &error); if (iq == NULL) goto out; if (!roster_update (self, iq, FALSE, &error)) goto out; out: if (error != NULL) { g_simple_async_result_set_from_error (priv->fetch_result, error); g_error_free (error); } if (iq != NULL) g_object_unref (iq); g_simple_async_result_complete (priv->fetch_result); g_object_unref (priv->fetch_result); priv->fetch_result = NULL; } void wocky_roster_fetch_roster_async (WockyRoster *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyRosterPrivate *priv; WockyStanza *iq; g_return_if_fail (WOCKY_IS_ROSTER (self)); priv = self->priv; if (priv->fetch_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another fetch operation is pending"); return; } iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, NULL, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); priv->fetch_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_roster_fetch_roster_async); wocky_porter_send_iq_async (priv->porter, iq, cancellable, roster_fetch_roster_cb, self); g_object_unref (iq); } gboolean wocky_roster_fetch_roster_finish (WockyRoster *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_roster_fetch_roster_async), FALSE); return TRUE; } WockyBareContact * wocky_roster_get_contact (WockyRoster *self, const gchar *jid) { WockyRosterPrivate *priv = self->priv; return g_hash_table_lookup (priv->items, jid); } GSList * wocky_roster_get_all_contacts (WockyRoster *self) { WockyRosterPrivate *priv = self->priv; GSList *result = NULL; GHashTableIter iter; gpointer value; g_hash_table_iter_init (&iter, priv->items); while (g_hash_table_iter_next (&iter, NULL, &value)) { result = g_slist_prepend (result, g_object_ref (value)); } return result; } /* Build an IQ set stanza containing the current state of the contact. * If not NULL, item_node will contain a pointer on the "item" node */ static WockyStanza * build_iq_for_contact (WockyBareContact *contact, WockyNode **item_node) { WockyStanza *iq; WockyNode *item = NULL; const gchar *jid, *name; const gchar * const *groups; guint i; WockyRosterSubscriptionFlags subscription; jid = wocky_bare_contact_get_jid (contact); g_return_val_if_fail (jid != NULL, NULL); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, '(', "item", '*', &item, '@', "jid", jid, ')', ')', NULL); g_assert (item != NULL); name = wocky_bare_contact_get_name (contact); if (name != NULL) { wocky_node_set_attribute (item, "name", name); } subscription = wocky_bare_contact_get_subscription (contact); if (subscription != WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE) { wocky_node_set_attribute (item, "subscription", wocky_roster_subscription_to_string (subscription)); } groups = wocky_bare_contact_get_groups (contact); for (i = 0; groups != NULL && groups[i] != NULL; i++) { WockyNode *group; group = wocky_node_add_child (item, "group"); wocky_node_set_content (group, groups[i]); } if (item_node != NULL) *item_node = item; return iq; } static WockyStanza * build_remove_contact_iq (WockyBareContact *contact) { return wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, '(', "item", '@', "jid", wocky_bare_contact_get_jid (contact), '@', "subscription", "remove", ')', ')', NULL); } static WockyStanza * build_iq_for_pending (WockyRoster *self, PendingOperation *pending) { WockyRosterPrivate *priv = self->priv; WockyBareContact *contact, *tmp; WockyStanza *iq; GHashTableIter iter; gpointer group; contact = g_hash_table_lookup (priv->items, pending->jid); if (!pending_operation_has_changes (pending)) { /* Nothing to change */ return NULL; } /* There is no sense to try to add and remove a contact at the same time */ g_assert (!pending->add_contact || !pending->remove_contact); if (contact == NULL) { if (pending->remove_contact) { DEBUG ("Contact %s was already removed", pending->jid); return NULL; } else if (!pending->add_contact) { GSList *l; DEBUG ("contact is not in the roster any more"); for (l = pending->waiting_operations; l != NULL; l = g_slist_next (l)) { GSimpleAsyncResult *result = (GSimpleAsyncResult *) l->data; g_simple_async_result_set_error (result, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER, "Contact %s is not in the roster any more", pending->jid); } return NULL; } tmp = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", pending->jid, NULL); } else { if (pending->remove_contact) { DEBUG ("Remove contact %s", pending->jid); return build_remove_contact_iq (contact); } tmp = wocky_bare_contact_copy (contact); } if (pending->new_name != NULL) wocky_bare_contact_set_name (tmp, pending->new_name); g_hash_table_iter_init (&iter, pending->groups_to_add); while (g_hash_table_iter_next (&iter, &group, NULL)) { wocky_bare_contact_add_group (tmp, (const gchar *) group); } g_hash_table_iter_init (&iter, pending->groups_to_remove); while (g_hash_table_iter_next (&iter, &group, NULL)) { wocky_bare_contact_remove_group (tmp, (const gchar *) group); } if (wocky_bare_contact_equal (contact, tmp)) { DEBUG ("No change needed"); g_object_unref (tmp); return NULL; } iq = build_iq_for_contact (tmp, NULL); g_object_unref (tmp); return iq; } static void waiting_operations_completed (WockyRoster *self, PendingOperation *pending) { GSList *l; for (l = pending->waiting_operations; l != NULL; l = g_slist_next (l)) { GSimpleAsyncResult *result = (GSimpleAsyncResult *) l->data; g_simple_async_result_complete (result); } } static void flying_operation_completed (PendingOperation *pending, GError *error) { WockyRoster *self = pending->self; WockyRosterPrivate *priv = self->priv; WockyStanza *iq; GSList *l; /* Flying operations are completed */ for (l = pending->flying_operations; l != NULL; l = g_slist_next (l)) { GSimpleAsyncResult *result = (GSimpleAsyncResult *) l->data; if (error != NULL) g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete (result); } if (g_slist_length (pending->waiting_operations) == 0) { /* No waiting operation, we are done */ DEBUG ("No waiting operations"); g_hash_table_remove (priv->pending_operations, pending->jid); return; } iq = build_iq_for_pending (self, pending); if (iq == NULL) { /* No need to send an IQ; complete waiting operations right now */ DEBUG ("No need to send an IQ; complete waiting operations"); waiting_operations_completed (self, pending); g_hash_table_remove (priv->pending_operations, pending->jid); return; } pending_operation_reset (pending); wocky_porter_send_iq_async (priv->porter, iq, NULL, change_roster_iq_cb, pending); g_object_unref (iq); } static void change_roster_iq_cb (GObject *source_object, GAsyncResult *send_iq_res, gpointer user_data) { PendingOperation *pending = (PendingOperation *) user_data; WockyStanza *reply; GError *error = NULL; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source_object), send_iq_res, &error); if (reply == NULL) goto out; wocky_stanza_extract_errors (reply, NULL, &error, NULL, NULL); /* According to the XMPP RFC, the server has to send a roster upgrade to * each client (including the one which requested the change) before * replying to the 'set' stanza. We upgraded our list of contacts when this * notification has been received. * We can't really check that this upgrade has been actually receive as we * could receive other notifications from the server due to other clients * actions. So we just have to trust the server on this. */ out: if (reply != NULL) g_object_unref (reply); flying_operation_completed (pending, error); if (error != NULL) g_error_free (error); } static PendingOperation * get_pending_operation (WockyRoster *self, const gchar *jid) { WockyRosterPrivate *priv = self->priv; DEBUG ("Look for pending operation with contact %s", jid); return g_hash_table_lookup (priv->pending_operations, jid); } /* Creates a new PendingOperation structure and associates it with the given * jid. This function is used when starting a edit operation while there is no * flying operation with this contact atm. The PendingOperation won't contain * any information as this operation is going to be sent right away and so * doesn't have to be queued. */ static PendingOperation * add_pending_operation (WockyRoster *self, const gchar *jid, GSimpleAsyncResult *result) { WockyRosterPrivate *priv = self->priv; PendingOperation *pending = pending_operation_new (self, result, jid); DEBUG ("Add pending operation for %s", jid); g_hash_table_insert (priv->pending_operations, g_strdup (jid), pending); return pending; } void wocky_roster_add_contact_async (WockyRoster *self, const gchar *jid, const gchar *name, const gchar * const * groups, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyRosterPrivate *priv = self->priv; WockyStanza *iq; GSimpleAsyncResult *result; WockyBareContact *contact, *existing_contact; PendingOperation *pending; g_return_if_fail (jid != NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_roster_add_contact_async); pending = get_pending_operation (self, jid); if (pending != NULL) { DEBUG ("Another operation is pending for contact %s; queuing this one", jid); pending_operation_set_new_name (pending, name); pending_operation_set_groups (pending, (GStrv) groups); pending_operation_add_waiting_operation (pending, result); pending_operation_set_add (pending); return; } contact = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", jid, NULL); if (name != NULL) wocky_bare_contact_set_name (contact, name); if (groups != NULL) wocky_bare_contact_set_groups (contact, (gchar **) groups); existing_contact = g_hash_table_lookup (priv->items, jid); if (existing_contact != NULL) { /* contact is already in the roster. Check if we need to change him. */ if (wocky_bare_contact_equal (contact, existing_contact)) { DEBUG ("Contact %s is already present in the roster; " "no need to change him", jid); g_simple_async_result_complete_in_idle (result); g_object_unref (contact); g_object_unref (result); return; } } iq = build_iq_for_contact (contact, NULL); pending = add_pending_operation (self, jid, result); wocky_porter_send_iq_async (priv->porter, iq, cancellable, change_roster_iq_cb, pending); /* A new contact object will be created and added when we'll receive the * server push notification. */ g_object_unref (contact); g_object_unref (iq); } gboolean wocky_roster_add_contact_finish (WockyRoster *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_roster_add_contact_async), FALSE); return TRUE; } static gboolean is_contact (gpointer key, gpointer value, gpointer contact) { return value == contact; } static gboolean contact_in_roster (WockyRoster *self, WockyBareContact *contact) { WockyRosterPrivate *priv = self->priv; return g_hash_table_find (priv->items, is_contact, contact) != NULL; } void wocky_roster_remove_contact_async (WockyRoster *self, WockyBareContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyRosterPrivate *priv = self->priv; WockyStanza *iq; GSimpleAsyncResult *result; PendingOperation *pending; const gchar *jid; g_return_if_fail (contact != NULL); jid = wocky_bare_contact_get_jid (contact); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_roster_remove_contact_async); pending = get_pending_operation (self, jid); if (pending != NULL) { DEBUG ("Another operation is pending for contact %s; queuing this one", jid); pending_operation_set_remove (pending); pending_operation_add_waiting_operation (pending, result); return; } if (!contact_in_roster (self, contact)) { DEBUG ("Contact %s is not in the roster", wocky_bare_contact_get_jid ( contact)); g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } pending = add_pending_operation (self, jid, result); iq = build_remove_contact_iq (contact); wocky_porter_send_iq_async (priv->porter, iq, cancellable, change_roster_iq_cb, pending); g_object_unref (iq); } gboolean wocky_roster_remove_contact_finish (WockyRoster *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_roster_remove_contact_async), FALSE); return TRUE; } void wocky_roster_change_contact_name_async (WockyRoster *self, WockyBareContact *contact, const gchar *name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyRosterPrivate *priv = self->priv; WockyStanza *iq; WockyNode *item; GSimpleAsyncResult *result; PendingOperation *pending; const gchar *jid; g_return_if_fail (contact != NULL); jid = wocky_bare_contact_get_jid (contact); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_roster_change_contact_name_async); pending = get_pending_operation (self, jid); if (pending != NULL) { DEBUG ("Another operation is pending for contact %s; queuing this one", jid); pending_operation_set_new_name (pending, name); pending_operation_add_waiting_operation (pending, result); return; } if (!contact_in_roster (self, contact)) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER, "Contact %s is not in the roster", wocky_bare_contact_get_jid (contact)); g_object_unref (result); return; } if (!wocky_strdiff (wocky_bare_contact_get_name (contact), name)) { DEBUG ("No need to change name; complete immediately"); g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } pending = add_pending_operation (self, jid, result); iq = build_iq_for_contact (contact, &item); /* set new name */ wocky_node_set_attribute (item, "name", name); wocky_porter_send_iq_async (priv->porter, iq, cancellable, change_roster_iq_cb, pending); g_object_unref (iq); } gboolean wocky_roster_change_contact_name_finish (WockyRoster *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_roster_change_contact_name_async), FALSE); return TRUE; } void wocky_roster_contact_add_group_async (WockyRoster *self, WockyBareContact *contact, const gchar *group, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyRosterPrivate *priv = self->priv; WockyStanza *iq; WockyNode *item, *group_node; GSimpleAsyncResult *result; PendingOperation *pending; const gchar *jid; g_return_if_fail (contact != NULL); jid = wocky_bare_contact_get_jid (contact); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_roster_contact_add_group_async); pending = get_pending_operation (self, jid); if (pending != NULL) { DEBUG ("Another operation is pending for contact %s; queuing this one", jid); pending_operation_add_group (pending, group); pending_operation_add_waiting_operation (pending, result); return; } if (!contact_in_roster (self, contact)) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER, "Contact %s is not in the roster", jid); g_object_unref (result); return; } if (wocky_bare_contact_in_group (contact, group)) { DEBUG ("Contact %s in already in group %s; complete immediately", wocky_bare_contact_get_jid (contact), group); g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } pending = add_pending_operation (self, jid, result); iq = build_iq_for_contact (contact, &item); /* add new group */ group_node = wocky_node_add_child (item, "group"); wocky_node_set_content (group_node, group); wocky_porter_send_iq_async (priv->porter, iq, cancellable, change_roster_iq_cb, pending); g_object_unref (iq); } gboolean wocky_roster_contact_add_group_finish (WockyRoster *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_roster_contact_add_group_async), FALSE); return TRUE; } void wocky_roster_contact_remove_group_async (WockyRoster *self, WockyBareContact *contact, const gchar *group, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyRosterPrivate *priv = self->priv; WockyStanza *iq; WockyNode *item; GSimpleAsyncResult *result; GSList *l; PendingOperation *pending; const gchar *jid; g_return_if_fail (contact != NULL); jid = wocky_bare_contact_get_jid (contact); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_roster_contact_remove_group_async); pending = get_pending_operation (self, jid); if (pending != NULL) { DEBUG ("Another operation is pending for contact %s; queuing this one", jid); pending_operation_remove_group (pending, group); pending_operation_add_waiting_operation (pending, result); return; } if (!contact_in_roster (self, contact)) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER, "Contact %s is not in the roster", jid); g_object_unref (result); return; } if (!wocky_bare_contact_in_group (contact, group)) { DEBUG ("Contact %s is not in group %s; complete immediately", jid, group); g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } pending = add_pending_operation (self, jid, result); iq = build_iq_for_contact (contact, &item); /* remove the group */ /* FIXME: should we add a wocky_node_remove_child () ? */ for (l = item->children; l != NULL; l = g_slist_next (l)) { WockyNode *group_node = (WockyNode *) l->data; if (wocky_strdiff (group_node->name, "group")) continue; if (!wocky_strdiff (group_node->content, group)) { wocky_node_free (group_node); item->children = g_slist_delete_link (item->children, l); break; } } wocky_porter_send_iq_async (priv->porter, iq, cancellable, change_roster_iq_cb, pending); g_object_unref (iq); } gboolean wocky_roster_contact_remove_group_finish (WockyRoster *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_roster_contact_remove_group_async), FALSE); return TRUE; } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-writer.c0000644000175000017500000003417712051446215024005 0ustar00wjtwjt00000000000000/* * wocky-xmpp-writer.c - Source for WockyXmppWriter * Copyright (C) 2006-2009 Collabora Ltd. * @author Sjoerd Simons * * 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 */ /** * SECTION: wocky-xmpp-writer * @title: WockyXmppWriter * @short_description: Xmpp stanza to XML serializer * * The #WockyXmppWriter serializes #WockyStanzas and xmpp stream opening * and closing to raw XML. The various functions provide a pointer to an * internal buffer, which remains valid until the next call to the writer. */ #include #include #include #include #include "wocky-xmpp-writer.h" G_DEFINE_TYPE (WockyXmppWriter, wocky_xmpp_writer, G_TYPE_OBJECT) #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_XMPP_WRITER #include "wocky-debug-internal.h" /* properties */ enum { PROP_STREAMING_MODE = 1, }; /* private structure */ struct _WockyXmppWriterPrivate { gboolean dispose_has_run; xmlTextWriterPtr xmlwriter; GQuark current_ns; GQuark stream_ns; gboolean stream_mode; xmlBufferPtr buffer; }; static void wocky_xmpp_writer_init (WockyXmppWriter *self) { WockyXmppWriterPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_XMPP_WRITER, WockyXmppWriterPrivate); priv = self->priv; priv->current_ns = 0; priv->stream_ns = 0; priv->buffer = xmlBufferCreate (); priv->xmlwriter = xmlNewTextWriterMemory (priv->buffer, 0); priv->stream_mode = TRUE; /* xmlTextWriterSetIndent (priv->xmlwriter, 1); */ } static void wocky_xmpp_writer_dispose (GObject *object); static void wocky_xmpp_writer_finalize (GObject *object); static void wocky_xmpp_write_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void wocky_xmpp_write_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void wocky_xmpp_writer_class_init (WockyXmppWriterClass *wocky_xmpp_writer_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_xmpp_writer_class); GParamSpec *param_spec; g_type_class_add_private (wocky_xmpp_writer_class, sizeof (WockyXmppWriterPrivate)); object_class->dispose = wocky_xmpp_writer_dispose; object_class->finalize = wocky_xmpp_writer_finalize; object_class->set_property = wocky_xmpp_write_set_property; object_class->get_property = wocky_xmpp_write_get_property; param_spec = g_param_spec_boolean ("streaming-mode", "streaming-mode", "Whether the xml to be written is one big stream or separate documents", TRUE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STREAMING_MODE, param_spec); } void wocky_xmpp_writer_dispose (GObject *object) { WockyXmppWriter *self = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_xmpp_writer_parent_class)->dispose) G_OBJECT_CLASS (wocky_xmpp_writer_parent_class)->dispose (object); } void wocky_xmpp_writer_finalize (GObject *object) { WockyXmppWriter *self = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = self->priv; /* free any data held directly by the object here */ xmlFreeTextWriter (priv->xmlwriter); xmlBufferFree (priv->buffer); G_OBJECT_CLASS (wocky_xmpp_writer_parent_class)->finalize (object); } static void wocky_xmpp_write_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyXmppWriter *writer = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = writer->priv; switch (property_id) { case PROP_STREAMING_MODE: priv->stream_mode = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_xmpp_write_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyXmppWriter *writer = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = writer->priv; switch (property_id) { case PROP_STREAMING_MODE: g_value_set_boolean (value, priv->stream_mode); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /** * wocky_xmpp_writer_new * * Convenience function to create a new #WockyXmppWriter. * * Returns: a new #WockyXmppWriter */ WockyXmppWriter * wocky_xmpp_writer_new (void) { return g_object_new (WOCKY_TYPE_XMPP_WRITER, NULL); } /** * wocky_xmpp_writer_new_no_stream * * Convenience function to create a new #WockyXmppWriter that has streaming * mode disabled. * * Returns: a new #WockyXmppWriter in non-streaming mode */ WockyXmppWriter * wocky_xmpp_writer_new_no_stream (void) { return g_object_new (WOCKY_TYPE_XMPP_WRITER, "streaming-mode", FALSE, NULL); } /** * wocky_xmpp_writer_stream_open: * @writer: a WockyXmppWriter * @to: the target of the stream opening (usually the xmpp server name) * @from: the sender of the stream opening (usually the jid of the client) * @version: XMPP version * @lang: default XMPP stream language * @id: XMPP Stream ID, if any, or NULL * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Create the XML opening header of an XMPP stream. The result is available in * the @data buffer. The buffer is only valid until the next call to a function * the writer. * * This function can only be called in streaming mode. */ void wocky_xmpp_writer_stream_open (WockyXmppWriter *writer, const gchar *to, const gchar *from, const gchar *version, const gchar *lang, const gchar *id, const guint8 **data, gsize *length) { WockyXmppWriterPrivate *priv = writer->priv; g_assert (priv->stream_mode); xmlBufferEmpty (priv->buffer); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *) "\n" \ "xmlwriter, (xmlChar *)" to=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) to); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (from != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" from=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) from); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (version != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" version=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) version); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (lang != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" xml:lang=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) lang); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (id != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" id=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) id); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *) ">\n"); xmlTextWriterFlush (priv->xmlwriter); *data = (const guint8 *)priv->buffer->content; *length = priv->buffer->use; /* Set the magic known namespaces */ priv->current_ns = g_quark_from_string ("jabber:client"); priv->stream_ns = g_quark_from_string ("http://etherx.jabber.org/streams"); DEBUG ("Writing stream opening: %.*s", (int) *length, *data); } /** * wocky_xmpp_writer_stream_close: * @writer: a WockyXmppWriter * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Create the XML closing footer of an XMPP stream . The result is available * in the @data buffer. The buffer is only valid until the next call to a * function * * This function can only be called in streaming mode. */ void wocky_xmpp_writer_stream_close (WockyXmppWriter *writer, const guint8 **data, gsize *length) { WockyXmppWriterPrivate *priv = writer->priv; static const guint8 *close = (const guint8 *)"\n"; g_assert (priv->stream_mode); *data = close; *length = strlen ((gchar *) close); DEBUG ("Writing stream close: %.*s", (int) *length, *data); } static void _xml_write_node (WockyXmppWriter *writer, WockyNode *node); static gboolean _write_attr (const gchar *key, const gchar *value, const gchar *prefix, const gchar *ns, gpointer user_data) { WockyXmppWriter *self = WOCKY_XMPP_WRITER (user_data); WockyXmppWriterPrivate *priv = self->priv; GQuark attrns = 0; if (ns != NULL) { attrns = g_quark_from_string (ns); } if (attrns == 0 || attrns == priv->current_ns) { xmlTextWriterWriteAttribute (priv->xmlwriter, (const xmlChar *)key, (const xmlChar *)value); } else if (attrns == priv->stream_ns) { xmlTextWriterWriteAttributeNS (priv->xmlwriter, (const xmlChar *)"stream", (const xmlChar *)key, (const xmlChar *)NULL, (const xmlChar *)value); } else { xmlTextWriterWriteAttributeNS (priv->xmlwriter, (const xmlChar *)prefix, (const xmlChar *)key, (const xmlChar *)ns, (const xmlChar *)value); } return TRUE; } static gboolean _write_child (WockyNode *node, gpointer user_data) { _xml_write_node (WOCKY_XMPP_WRITER (user_data), node); return TRUE; } static void _xml_write_node (WockyXmppWriter *writer, WockyNode *node) { const gchar *l; GQuark oldns; WockyXmppWriterPrivate *priv = writer->priv; oldns = priv->current_ns; if (node->ns == 0 || oldns == node->ns) { /* Another element in the current namespace */ xmlTextWriterStartElement (priv->xmlwriter, (const xmlChar*) node->name); } else if (node->ns == priv->stream_ns) { xmlTextWriterStartElementNS(priv->xmlwriter, (const xmlChar *) "stream", (const xmlChar *) node->name, NULL); } else { priv->current_ns = node->ns; xmlTextWriterStartElementNS (priv->xmlwriter, NULL, (const xmlChar *) node->name, (const xmlChar *) wocky_node_get_ns (node)); } wocky_node_each_attribute (node, _write_attr, writer); l = wocky_node_get_language (node); if (l != NULL) { xmlTextWriterWriteAttributeNS(priv->xmlwriter, (const xmlChar *)"xml", (const xmlChar *)"lang", NULL, (const xmlChar *)l); } wocky_node_each_child (node, _write_child, writer); if (node->content != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (const xmlChar*)node->content); } xmlTextWriterEndElement (priv->xmlwriter); priv->current_ns = oldns; } static void _write_node_tree (WockyXmppWriter *writer, WockyNodeTree *tree, const guint8 **data, gsize *length) { WockyXmppWriterPrivate *priv = writer->priv; xmlBufferEmpty (priv->buffer); DEBUG_NODE_TREE (tree, "Serializing tree:"); if (!priv->stream_mode) { xmlTextWriterStartDocument (priv->xmlwriter, "1.0", "utf-8", NULL); } _xml_write_node (writer, wocky_node_tree_get_top_node (tree)); if (!priv->stream_mode) { xmlTextWriterEndDocument (priv->xmlwriter); } xmlTextWriterFlush (priv->xmlwriter); *data = (const guint8 *)priv->buffer->content; *length = priv->buffer->use; #ifdef ENABLE_DEBUG wocky_debug (WOCKY_DEBUG_NET, "Writing xml: %.*s", (int)*length, *data); #endif } /** * wocky_xmpp_writer_write_stanza: * @writer: a WockyXmppWriter * @stanza: the stanza to serialize * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Serialize the @stanza to XML. The result is available in the * @data buffer. The buffer is only valid until the next call to a function */ void wocky_xmpp_writer_write_stanza (WockyXmppWriter *writer, WockyStanza *stanza, const guint8 **data, gsize *length) { _write_node_tree (writer, WOCKY_NODE_TREE (stanza), data, length); } /** * wocky_xmpp_writer_write_node_tree: * @writer: a WockyXmppWriter * @tree: the node tree to serialize * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Serialize the @tree to XML. The result is available in the * @data buffer. The buffer is only valid until the next call to a function. * This function may only be called in non-streaming mode. */ void wocky_xmpp_writer_write_node_tree (WockyXmppWriter *writer, WockyNodeTree *tree, const guint8 **data, gsize *length) { *data = NULL; *length = 0; g_return_if_fail (!writer->priv->stream_mode); _write_node_tree (writer, tree, data, length); } /** * wocky_xmpp_writer_flush: * @writer: a WockyXmppWriter * * Flushes and frees the internal data buffer */ void wocky_xmpp_writer_flush (WockyXmppWriter *writer) { WockyXmppWriterPrivate *priv = writer->priv; xmlBufferFree (priv->buffer); priv->buffer = xmlBufferCreate (); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-openssl-dh1024.c0000644000175000017500000000211412051446215024054 0ustar00wjtwjt00000000000000#ifndef HEADER_DH_H #include #endif DH *get_dh1024(void); DH *get_dh1024(void) { static unsigned char dh1024_p[]={ 0xF4,0x88,0xFD,0x58,0x4E,0x49,0xDB,0xCD,0x20,0xB4,0x9D,0xE4, 0x91,0x07,0x36,0x6B,0x33,0x6C,0x38,0x0D,0x45,0x1D,0x0F,0x7C, 0x88,0xB3,0x1C,0x7C,0x5B,0x2D,0x8E,0xF6,0xF3,0xC9,0x23,0xC0, 0x43,0xF0,0xA5,0x5B,0x18,0x8D,0x8E,0xBB,0x55,0x8C,0xB8,0x5D, 0x38,0xD3,0x34,0xFD,0x7C,0x17,0x57,0x43,0xA3,0x1D,0x18,0x6C, 0xDE,0x33,0x21,0x2C,0xB5,0x2A,0xFF,0x3C,0xE1,0xB1,0x29,0x40, 0x18,0x11,0x8D,0x7C,0x84,0xA7,0x0A,0x72,0xD6,0x86,0xC4,0x03, 0x19,0xC8,0x07,0x29,0x7A,0xCA,0x95,0x0C,0xD9,0x96,0x9F,0xAB, 0xD0,0x0A,0x50,0x9B,0x02,0x46,0xD3,0x08,0x3D,0x66,0xA4,0x5D, 0x41,0x9F,0x9C,0x7C,0xBD,0x89,0x4B,0x22,0x19,0x26,0xBA,0xAB, 0xA2,0x5E,0xC3,0x55,0xE9,0x2F,0x78,0xC7, }; static unsigned char dh1024_g[]={ 0x02, }; DH *dh; if ((dh=DH_new()) == NULL) return(NULL); dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL); dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL); if ((dh->p == NULL) || (dh->g == NULL)) { DH_free(dh); return(NULL); } return(dh); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-tls.c0000644000175000017500000015315412051446215022306 0ustar00wjtwjt00000000000000/* * Wocky TLS integration - GNUTLS implementation * (just named -tls for historical reasons) * * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima * Copyright © 2008-2009 Codethink Limited * Copyright © 2009 Collabora Limited * * This program 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 of the licence or (at * your option) any later version. * * Authors: Ryan Lortie * Christian Kellner * Samuel Cormier-Iijima * Vivek Dasmohapatra * * Upstream: git://git.gnome.org/gnio * Branched at: 42b00d143fcf644880456d06d3a20b6e990a7fa3 * "toss out everything that moved to glib" * * This file follows the original coding style from upstream, not house * collabora style: It is a copy of unmerged gnio TLS support with the * 'g' prefixes changes to 'wocky' and server-side TLS support added. */ /** * SECTION: wocky-tls * @title: Wocky GnuTLS TLS * @short_description: Establish TLS sessions * * The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug * output from GNU TLS. To enable it, set it to a value from 1 to 9. * Higher values will print more information. See the documentation of * gnutls_global_set_log_level for more details. * * Increasing the value past certain thresholds will also trigger increased * debugging output from within wocky-tls.c as well. * * The WOCKY_GNUTLS_OPTIONS environment variable can be set to a gnutls * priority string [See gnutls-cli(1) or the gnutls_priority_init docs] * to control most tls protocol details. An empty or unset value is roughly * equivalent to a priority string of "SECURE:+COMP-DEFLATE". */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-tls.h" #include #include #include #include #include #include #ifdef ENABLE_PREFER_STREAM_CIPHERS #define DEFAULT_TLS_OPTIONS \ /* start with nothing enabled by default */ \ "NONE:" \ /* enable all the normal algorithms */ \ "+VERS-TLS-ALL:+SIGN-ALL:+MAC-ALL:+CTYPE-ALL:+RSA:" \ /* prefer deflate compression, but fall back to null compression */ \ "+COMP-DEFLATE:+COMP-NULL:" \ /* our preferred stream ciphers */ \ "+ARCFOUR-128:+ARCFOUR-40:" \ /* all the other ciphers */ \ "+AES-128-CBC:+AES-256-CBC:+3DES-CBC:+DES-CBC:+RC2-40:" \ "+CAMELLIA-256-CBC:+CAMELLIA-128-CBC" #else #define DEFAULT_TLS_OPTIONS \ "NORMAL:" /* all secure algorithms */ \ "-COMP-NULL:" /* remove null compression */ \ "+COMP-DEFLATE:" /* prefer deflate */ \ "+COMP-NULL" /* fall back to null */ #endif #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_TLS #define DEBUG_HANDSHAKE_LEVEL 5 #define DEBUG_ASYNC_DETAIL_LEVEL 6 #define VERIFY_STRICT GNUTLS_VERIFY_DO_NOT_ALLOW_SAME #define VERIFY_NORMAL GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT #define VERIFY_LENIENT ( GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT | \ GNUTLS_VERIFY_ALLOW_ANY_X509_V1_CA_CRT | \ GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2 | \ GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5 | \ GNUTLS_VERIFY_DISABLE_TIME_CHECKS | \ GNUTLS_VERIFY_DISABLE_CA_SIGN ) #include "wocky-debug-internal.h" #include "wocky-utils.h" #include #include #include #include #include enum { PROP_S_NONE, PROP_S_STREAM, PROP_S_SERVER, PROP_S_DHBITS, PROP_S_KEYFILE, PROP_S_CERTFILE, }; enum { PROP_C_NONE, PROP_C_SESSION, }; enum { PROP_O_NONE, PROP_O_SESSION }; enum { PROP_I_NONE, PROP_I_SESSION }; typedef struct { gboolean active; gint io_priority; GCancellable *cancellable; GObject *source_object; GAsyncReadyCallback callback; gpointer user_data; gpointer source_tag; GError *error; } WockyTLSJob; typedef enum { WOCKY_TLS_OP_READ, WOCKY_TLS_OP_WRITE } WockyTLSOperation; typedef enum { WOCKY_TLS_OP_STATE_IDLE, WOCKY_TLS_OP_STATE_ACTIVE, WOCKY_TLS_OP_STATE_DONE } WockyTLSOpState; typedef struct { WockyTLSJob job; } WockyTLSJobHandshake; typedef struct { WockyTLSJob job; gconstpointer buffer; gsize count; } WockyTLSJobWrite; typedef struct { WockyTLSJob job; gpointer buffer; gsize count; } WockyTLSJobRead; typedef struct { WockyTLSOpState state; guint8 *buffer; gssize requested; gssize result; GError *error; } WockyTLSOp; typedef GIOStreamClass WockyTLSConnectionClass; typedef GObjectClass WockyTLSSessionClass; typedef GInputStreamClass WockyTLSInputStreamClass; typedef GOutputStreamClass WockyTLSOutputStreamClass; static gnutls_dh_params_t dh_0768 = NULL; static gnutls_dh_params_t dh_1024 = NULL; static gnutls_dh_params_t dh_2048 = NULL; static gnutls_dh_params_t dh_3072 = NULL; static gnutls_dh_params_t dh_4096 = NULL; struct _WockyTLSSession { GObject parent; GIOStream *stream; GCancellable *cancellable; GError *error; gboolean async; /* tls server support */ gboolean server; gnutls_dh_params_t dh_params; guint dh_bits; gchar *key_file; gchar *cert_file; /* frontend jobs */ WockyTLSJobHandshake handshake_job; WockyTLSJobRead read_job; WockyTLSJobWrite write_job; /* backend jobs */ WockyTLSOp read_op; WockyTLSOp write_op; gnutls_session_t session; gnutls_certificate_credentials gnutls_cert_cred; }; typedef struct { GInputStream parent; WockyTLSSession *session; } WockyTLSInputStream; typedef struct { GOutputStream parent; WockyTLSSession *session; } WockyTLSOutputStream; struct _WockyTLSConnection { GIOStream parent; WockyTLSSession *session; WockyTLSInputStream *input; WockyTLSOutputStream *output; }; static guint tls_debug_level = 0; static GType wocky_tls_input_stream_get_type (void); static GType wocky_tls_output_stream_get_type (void); G_DEFINE_TYPE (WockyTLSConnection, wocky_tls_connection, G_TYPE_IO_STREAM); G_DEFINE_TYPE (WockyTLSSession, wocky_tls_session, G_TYPE_OBJECT); G_DEFINE_TYPE (WockyTLSInputStream, wocky_tls_input_stream, G_TYPE_INPUT_STREAM); G_DEFINE_TYPE (WockyTLSOutputStream, wocky_tls_output_stream, G_TYPE_OUTPUT_STREAM); #define WOCKY_TYPE_TLS_INPUT_STREAM (wocky_tls_input_stream_get_type ()) #define WOCKY_TYPE_TLS_OUTPUT_STREAM (wocky_tls_output_stream_get_type ()) #define WOCKY_TLS_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TLS_INPUT_STREAM, \ WockyTLSInputStream)) #define WOCKY_TLS_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TLS_OUTPUT_STREAM, \ WockyTLSOutputStream)) static const gchar *hdesc_to_string (long desc) { #define HDESC(x) case GNUTLS_HANDSHAKE_##x: return #x; break; switch (desc) { HDESC (HELLO_REQUEST); HDESC (CLIENT_HELLO); HDESC (SERVER_HELLO); HDESC (CERTIFICATE_PKT); HDESC (SERVER_KEY_EXCHANGE); HDESC (CERTIFICATE_REQUEST); HDESC (SERVER_HELLO_DONE); HDESC (CERTIFICATE_VERIFY); HDESC (CLIENT_KEY_EXCHANGE); HDESC (FINISHED); HDESC (SUPPLEMENTAL); } return "Unknown State"; } static const gchar *error_to_string (long error) { const gchar *result; result = gnutls_strerror_name (error); if (result != NULL) return result; return "Unknown Error"; } static gboolean wocky_tls_set_error (GError **error, gssize result) { int code = (int) result; if (result < 0) g_set_error (error, WOCKY_TLS_ERROR, 0, "%d: %s", code, error_to_string (code)); return result < 0; } static GSimpleAsyncResult * wocky_tls_job_make_result (WockyTLSJob *job, gssize result) { if (result != GNUTLS_E_AGAIN) { GSimpleAsyncResult *simple; GError *error = NULL; simple = g_simple_async_result_new (job->source_object, job->callback, job->user_data, job->source_tag); if (job->error != NULL) { #ifdef WOCKY_TLS_STRICT_ERROR_ASSERTIONS g_assert (result == GNUTLS_E_PUSH_ERROR || result == GNUTLS_E_PULL_ERROR); #endif g_simple_async_result_set_from_error (simple, job->error); g_error_free (job->error); } else if (wocky_tls_set_error (&error, result)) { g_simple_async_result_set_from_error (simple, error); g_error_free (error); } if (job->cancellable != NULL) g_object_unref (job->cancellable); job->cancellable = NULL; g_object_unref (job->source_object); job->source_object = NULL; job->active = FALSE; return simple; } else { g_assert (job->active); return NULL; } } static void wocky_tls_job_result_gssize (WockyTLSJob *job, gssize result) { GSimpleAsyncResult *simple; if ((simple = wocky_tls_job_make_result (job, result))) { if (result >= 0) g_simple_async_result_set_op_res_gssize (simple, result); g_simple_async_result_complete (simple); g_object_unref (simple); } } static void wocky_tls_job_result_boolean (WockyTLSJob *job, gint result) { GSimpleAsyncResult *simple; if ((simple = wocky_tls_job_make_result (job, result))) { g_simple_async_result_complete (simple); g_object_unref (simple); } } static void wocky_tls_session_try_operation (WockyTLSSession *session, WockyTLSOperation operation) { if (session->handshake_job.job.active) { gint result; DEBUG ("session %p: async job handshake", session); session->async = TRUE; result = gnutls_handshake (session->session); g_assert (result != GNUTLS_E_INTERRUPTED); if (tls_debug_level >= DEBUG_HANDSHAKE_LEVEL) { gnutls_handshake_description_t i; gnutls_handshake_description_t o; DEBUG ("session %p: async job handshake: %d %s", session, result, error_to_string(result)); i = gnutls_handshake_get_last_in (session->session); o = gnutls_handshake_get_last_out (session->session); DEBUG ("session %p: async job handshake: { in: %s; out: %s }", session, hdesc_to_string (i), hdesc_to_string (o)); } session->async = FALSE; wocky_tls_job_result_boolean (&session->handshake_job.job, result); } else if (operation == WOCKY_TLS_OP_READ) { gssize result = 0; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG ("async job OP_READ"); g_assert (session->read_job.job.active); /* If the read result is 0, the remote end disconnected us, no need to * pull data through gnutls_record_recv in that case */ if (session->read_op.result != 0) { session->async = TRUE; result = gnutls_record_recv (session->session, session->read_job.buffer, session->read_job.count); g_assert (result != GNUTLS_E_INTERRUPTED); session->async = FALSE; } wocky_tls_job_result_gssize (&session->read_job.job, result); } else { gssize result; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG ("async job OP_WRITE: %"G_GSIZE_FORMAT, session->write_job.count); g_assert (operation == WOCKY_TLS_OP_WRITE); g_assert (session->write_job.job.active); session->async = TRUE; result = gnutls_record_send (session->session, session->write_job.buffer, session->write_job.count); g_assert (result != GNUTLS_E_INTERRUPTED); session->async = FALSE; wocky_tls_job_result_gssize (&session->write_job.job, result); } } static void wocky_tls_job_start (WockyTLSJob *job, gpointer source_object, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data, gpointer source_tag) { g_assert (job->active == FALSE); g_assert (job->cancellable == NULL); /* this is always a circular reference, so it will keep the * session alive for as long as the job is running. */ job->source_object = g_object_ref (source_object); job->io_priority = io_priority; if (cancellable != NULL) job->cancellable = g_object_ref (cancellable); job->callback = callback; job->user_data = user_data; job->source_tag = source_tag; job->error = NULL; job->active = TRUE; } WockyTLSConnection * wocky_tls_session_handshake (WockyTLSSession *session, GCancellable *cancellable, GError **error) { gint result; DEBUG ("sync job handshake"); session->error = NULL; session->cancellable = cancellable; result = gnutls_handshake (session->session); g_assert (result != GNUTLS_E_INTERRUPTED); g_assert (result != GNUTLS_E_AGAIN); session->cancellable = NULL; if (tls_debug_level >= DEBUG_HANDSHAKE_LEVEL) DEBUG ("sync job handshake: %d %s", result, error_to_string (result)); if (session->error != NULL) { g_assert (result == GNUTLS_E_PULL_ERROR || result == GNUTLS_E_PUSH_ERROR); g_propagate_error (error, session->error); return NULL; } else if (wocky_tls_set_error (error, result)) return NULL; return g_object_new (WOCKY_TYPE_TLS_CONNECTION, "session", session, NULL); } /* ************************************************************************* */ /* adding CA certificates and CRL lists for peer certificate verification */ typedef int (*add_certfile) (gnutls_certificate_credentials_t res, const char *file, gnutls_x509_crt_fmt_t type); static void add_certfiles (gnutls_certificate_credentials cred, const gchar *thing, add_certfile add) { int n = 0; struct stat target; DEBUG ("checking %s", thing); if (stat (thing, &target) != 0) { DEBUG ("ca/crl file '%s': stat failed)", thing); return; } if (S_ISDIR (target.st_mode)) { DIR *dir; struct dirent *entry; if ((dir = opendir (thing)) == NULL) return; for (entry = readdir (dir); entry != NULL; entry = readdir (dir)) { struct stat file; gchar *path = g_build_path ("/", thing, entry->d_name, NULL); if ((stat (path, &file) == 0) && S_ISREG (file.st_mode)) n += add (cred, path, GNUTLS_X509_FMT_PEM); g_free (path); } DEBUG ("+ %s: %d certs from dir", thing, n); closedir (dir); } else if (S_ISREG (target.st_mode)) { n = add (cred, thing, GNUTLS_X509_FMT_PEM); DEBUG ("+ %s: %d certs from file", thing, n); } } void wocky_tls_session_add_ca (WockyTLSSession *session, const gchar *path) { DEBUG ("adding CA CERT path '%s'", (gchar *) path); add_certfiles (session->gnutls_cert_cred, path, gnutls_certificate_set_x509_trust_file); } void wocky_tls_session_add_crl (WockyTLSSession *session, const gchar *path) { DEBUG ("adding CRL path '%s'", (gchar *) path); add_certfiles (session->gnutls_cert_cred, path, gnutls_certificate_set_x509_crl_file); } /* ************************************************************************* */ void wocky_tls_session_handshake_async (WockyTLSSession *session, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { wocky_tls_job_start (&session->handshake_job.job, session, io_priority, cancellable, callback, user_data, wocky_tls_session_handshake_async); wocky_tls_session_try_operation (session, 0); } WockyTLSConnection * wocky_tls_session_handshake_finish (WockyTLSSession *session, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); { GObject *source_object; source_object = g_async_result_get_source_object (result); g_object_unref (source_object); g_return_val_if_fail (G_OBJECT (session) == source_object, NULL); } g_return_val_if_fail (wocky_tls_session_handshake_async == g_simple_async_result_get_source_tag (simple), NULL); if (g_simple_async_result_propagate_error (simple, error)) return NULL; DEBUG ("connection OK"); return g_object_new (WOCKY_TYPE_TLS_CONNECTION, "session", session, NULL); } GPtrArray * wocky_tls_session_get_peers_certificate (WockyTLSSession *session, WockyTLSCertType *type) { guint idx; guint n_peers; const gnutls_datum_t *peers = NULL; GPtrArray *certificates; peers = gnutls_certificate_get_peers (session->session, &n_peers); if (peers == NULL) return NULL; certificates = g_ptr_array_new_with_free_func ((GDestroyNotify) g_array_unref); for (idx = 0; idx < n_peers; idx++) { GArray *cert = g_array_sized_new (TRUE, TRUE, sizeof (guchar), peers[idx].size); g_array_append_vals (cert, peers[idx].data, peers[idx].size); g_ptr_array_add (certificates, cert); } if (type != NULL) { switch (gnutls_certificate_type_get (session->session)) { case GNUTLS_CRT_X509: *type = WOCKY_TLS_CERT_TYPE_X509; break; case GNUTLS_CRT_OPENPGP: *type = WOCKY_TLS_CERT_TYPE_OPENPGP; break; default: *type = WOCKY_TLS_CERT_TYPE_NONE; break; } } return certificates; } int wocky_tls_session_verify_peer (WockyTLSSession *session, const gchar *peername, GStrv extra_identities, WockyTLSVerificationLevel level, WockyTLSCertStatus *status) { int rval = -1; guint peer_cert_status = 0; gboolean peer_name_ok = TRUE; gnutls_certificate_verify_flags check; /* list gnutls cert error conditions in descending order of noteworthiness * * and map them to wocky cert error conditions */ static const struct { gnutls_certificate_status_t gnutls; WockyTLSCertStatus wocky; } status_map[] = { { GNUTLS_CERT_REVOKED, WOCKY_TLS_CERT_REVOKED }, { GNUTLS_CERT_NOT_ACTIVATED, WOCKY_TLS_CERT_NOT_ACTIVE }, { GNUTLS_CERT_EXPIRED, WOCKY_TLS_CERT_EXPIRED }, { GNUTLS_CERT_SIGNER_NOT_FOUND, WOCKY_TLS_CERT_SIGNER_UNKNOWN }, { GNUTLS_CERT_SIGNER_NOT_CA, WOCKY_TLS_CERT_SIGNER_UNAUTHORISED }, { GNUTLS_CERT_INSECURE_ALGORITHM, WOCKY_TLS_CERT_INSECURE }, { GNUTLS_CERT_INVALID, WOCKY_TLS_CERT_INVALID }, { ~((long) 0), WOCKY_TLS_CERT_UNKNOWN_ERROR }, { 0, WOCKY_TLS_CERT_OK } }; g_assert (status != NULL); *status = WOCKY_TLS_CERT_OK; switch (level) { case WOCKY_TLS_VERIFY_STRICT: check = VERIFY_STRICT; break; case WOCKY_TLS_VERIFY_NORMAL: check = VERIFY_NORMAL; break; case WOCKY_TLS_VERIFY_LENIENT: check = VERIFY_LENIENT; break; default: g_warn_if_reached (); check = VERIFY_STRICT; break; } DEBUG ("setting gnutls verify flags level to: %s", wocky_enum_to_nick (WOCKY_TYPE_TLS_VERIFICATION_LEVEL, level)); gnutls_certificate_set_verify_flags (session->gnutls_cert_cred, check); rval = gnutls_certificate_verify_peers2 (session->session, &peer_cert_status); if (rval != GNUTLS_E_SUCCESS) { switch (rval) { case GNUTLS_E_NO_CERTIFICATE_FOUND: case GNUTLS_E_INVALID_REQUEST: *status = WOCKY_TLS_CERT_NO_CERTIFICATE; break; case GNUTLS_E_INSUFFICIENT_CREDENTIALS: *status = WOCKY_TLS_CERT_INSECURE; break; case GNUTLS_E_CONSTRAINT_ERROR: *status = WOCKY_TLS_CERT_MAYBE_DOS; break; case GNUTLS_E_MEMORY_ERROR: *status = WOCKY_TLS_CERT_INTERNAL_ERROR; break; default: *status = WOCKY_TLS_CERT_UNKNOWN_ERROR; } return rval; } /* if we get this far, we have a structurally valid certificate * * signed by _someone_: check the hostname matches the peername */ if (peername != NULL || extra_identities != NULL) { const gnutls_datum_t *peers; guint n_peers; gnutls_x509_crt_t x509; gnutls_openpgp_crt_t opgp; /* we know these ops must succeed, or verify_peers2 would have * * failed before we got here: We just need to duplicate a bit * * of what it does: */ peers = gnutls_certificate_get_peers (session->session, &n_peers); switch (gnutls_certificate_type_get (session->session)) { case GNUTLS_CRT_X509: DEBUG ("checking X509 cert"); if ((rval = gnutls_x509_crt_init (&x509)) == GNUTLS_E_SUCCESS) { gnutls_x509_crt_import (x509, &peers[0], GNUTLS_X509_FMT_DER); if (peername != NULL) { rval = gnutls_x509_crt_check_hostname (x509, peername); DEBUG ("gnutls_x509_crt_check_hostname: %s -> %d", peername, rval); } else { rval = 0; } if (rval == 0 && extra_identities != NULL) { gint i; for (i = 0; extra_identities[i] != NULL; i++) { rval = gnutls_x509_crt_check_hostname (x509, extra_identities[i]); DEBUG ("gnutls_x509_crt_check_hostname: %s -> %d", extra_identities[i], rval); if (rval != 0) break; } } rval = (rval == 0) ? -1 : GNUTLS_E_SUCCESS; gnutls_x509_crt_deinit (x509); } break; case GNUTLS_CRT_OPENPGP: DEBUG ("checking PGP cert"); if ((rval = gnutls_openpgp_crt_init (&opgp)) == GNUTLS_E_SUCCESS) { gnutls_openpgp_crt_import (opgp, &peers[0], GNUTLS_OPENPGP_FMT_RAW); rval = gnutls_openpgp_crt_check_hostname (opgp, peername); DEBUG ("gnutls_openpgp_crt_check_hostname: %s -> %d", peername, rval); if (peername != NULL) { rval = gnutls_openpgp_crt_check_hostname (opgp, peername); DEBUG ("gnutls_openpgp_crt_check_hostname: %s -> %d", peername, rval); } else { rval = 0; } if (rval == 0 && extra_identities != NULL) { gint i; for (i = 0; extra_identities[i] != NULL; i++) { rval = gnutls_openpgp_crt_check_hostname (opgp, extra_identities[i]); DEBUG ("gnutls_openpgp_crt_check_hostname: %s -> %d", extra_identities[i], rval); if (rval != 0) break; } } rval = (rval == 0) ? -1 : GNUTLS_E_SUCCESS; gnutls_openpgp_crt_deinit (opgp); } break; default: /* theoretically, this can't happen if ...verify_peers2 is working: */ DEBUG ("unknown cert type!"); rval = GNUTLS_E_INVALID_REQUEST; } peer_name_ok = (rval == GNUTLS_E_SUCCESS); } DEBUG ("peer_name_ok: %d", peer_name_ok ); /* if the hostname didn't match, we can just bail out with an error here * * otherwise we need to figure out which error (if any) our verification * * call failed with: */ if (!peer_name_ok) *status = WOCKY_TLS_CERT_NAME_MISMATCH; else { /* Gnutls cert checking can return multiple errors bitwise &ed together * * but we are realy only interested in the "most important" error: */ int x; *status = WOCKY_TLS_CERT_OK; for (x = 0; status_map[x].gnutls != 0; x++) { DEBUG ("checking gnutls error %d", status_map[x].gnutls); if (peer_cert_status & status_map[x].gnutls) { DEBUG ("gnutls error %d set", status_map[x].gnutls); *status = status_map[x].wocky; rval = GNUTLS_E_CERTIFICATE_ERROR; break; } } } return rval; } static gssize wocky_tls_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyTLSSession *session = WOCKY_TLS_INPUT_STREAM (stream)->session; gssize result; session->cancellable = cancellable; result = gnutls_record_recv (session->session, buffer, count); g_assert (result != GNUTLS_E_INTERRUPTED); g_assert (result != GNUTLS_E_AGAIN); session->cancellable = NULL; if (session->error != NULL) { g_assert (result == GNUTLS_E_PULL_ERROR); g_propagate_error (error, session->error); return -1; } else if (wocky_tls_set_error (error, result)) return -1; return result; } static void wocky_tls_input_stream_read_async (GInputStream *stream, void *buffer, gsize count, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_INPUT_STREAM (stream)->session; wocky_tls_job_start (&session->read_job.job, stream, io_priority, cancellable, callback, user_data, wocky_tls_input_stream_read_async); session->read_job.buffer = buffer; session->read_job.count = count; wocky_tls_session_try_operation (session, WOCKY_TLS_OP_READ); } static gssize wocky_tls_input_stream_read_finish (GInputStream *stream, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); { GObject *source_object; source_object = g_async_result_get_source_object (result); g_object_unref (source_object); g_return_val_if_fail (G_OBJECT (stream) == source_object, -1); } g_return_val_if_fail (wocky_tls_input_stream_read_async == g_simple_async_result_get_source_tag (simple), -1); if (g_simple_async_result_propagate_error (simple, error)) return -1; return g_simple_async_result_get_op_res_gssize (simple); } static gssize wocky_tls_output_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyTLSSession *session = WOCKY_TLS_OUTPUT_STREAM (stream)->session; gssize result; session->cancellable = cancellable; result = gnutls_record_send (session->session, buffer, count); g_assert (result != GNUTLS_E_INTERRUPTED); g_assert (result != GNUTLS_E_AGAIN); session->cancellable = NULL; if (session->error != NULL) { g_assert (result == GNUTLS_E_PUSH_ERROR); g_propagate_error (error, session->error); return -1; } else if (wocky_tls_set_error (error, result)) return -1; return result; } static void wocky_tls_output_stream_write_async (GOutputStream *stream, const void *buffer, gsize count, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_OUTPUT_STREAM (stream)->session; wocky_tls_job_start (&session->write_job.job, stream, io_priority, cancellable, callback, user_data, wocky_tls_output_stream_write_async); session->write_job.buffer = buffer; session->write_job.count = count; wocky_tls_session_try_operation (session, WOCKY_TLS_OP_WRITE); } static gssize wocky_tls_output_stream_write_finish (GOutputStream *stream, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); { GObject *source_object; source_object = g_async_result_get_source_object (result); g_object_unref (source_object); g_return_val_if_fail (G_OBJECT (stream) == source_object, -1); } g_return_val_if_fail (wocky_tls_output_stream_write_async == g_simple_async_result_get_source_tag (simple), -1); if (g_simple_async_result_propagate_error (simple, error)) return -1; return g_simple_async_result_get_op_res_gssize (simple); } static void wocky_tls_output_stream_init (WockyTLSOutputStream *stream) { } static void wocky_tls_input_stream_init (WockyTLSInputStream *stream) { } static void wocky_tls_output_stream_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSOutputStream *stream = WOCKY_TLS_OUTPUT_STREAM (object); switch (prop_id) { case PROP_C_SESSION: stream->session = g_value_dup_object (value); break; default: g_assert_not_reached (); } } static void wocky_tls_output_stream_constructed (GObject *object) { WockyTLSOutputStream *stream = WOCKY_TLS_OUTPUT_STREAM (object); g_assert (stream->session); } static void wocky_tls_output_stream_finalize (GObject *object) { WockyTLSOutputStream *stream = WOCKY_TLS_OUTPUT_STREAM (object); g_object_unref (stream->session); G_OBJECT_CLASS (wocky_tls_output_stream_parent_class) ->finalize (object); } static void wocky_tls_output_stream_class_init (GOutputStreamClass *class) { GObjectClass *obj_class = G_OBJECT_CLASS (class); class->write_fn = wocky_tls_output_stream_write; class->write_async = wocky_tls_output_stream_write_async; class->write_finish = wocky_tls_output_stream_write_finish; obj_class->set_property = wocky_tls_output_stream_set_property; obj_class->constructed = wocky_tls_output_stream_constructed; obj_class->finalize = wocky_tls_output_stream_finalize; g_object_class_install_property (obj_class, PROP_O_SESSION, g_param_spec_object ("session", "TLS session", "the TLS session object for this stream", WOCKY_TYPE_TLS_SESSION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void wocky_tls_input_stream_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSInputStream *stream = WOCKY_TLS_INPUT_STREAM (object); switch (prop_id) { case PROP_C_SESSION: stream->session = g_value_dup_object (value); break; default: g_assert_not_reached (); } } static void wocky_tls_input_stream_constructed (GObject *object) { WockyTLSInputStream *stream = WOCKY_TLS_INPUT_STREAM (object); g_assert (stream->session); } static void wocky_tls_input_stream_finalize (GObject *object) { WockyTLSInputStream *stream = WOCKY_TLS_INPUT_STREAM (object); g_object_unref (stream->session); G_OBJECT_CLASS (wocky_tls_input_stream_parent_class) ->finalize (object); } static void wocky_tls_input_stream_class_init (GInputStreamClass *class) { GObjectClass *obj_class = G_OBJECT_CLASS (class); class->read_fn = wocky_tls_input_stream_read; class->read_async = wocky_tls_input_stream_read_async; class->read_finish = wocky_tls_input_stream_read_finish; obj_class->set_property = wocky_tls_input_stream_set_property; obj_class->constructed = wocky_tls_input_stream_constructed; obj_class->finalize = wocky_tls_input_stream_finalize; g_object_class_install_property (obj_class, PROP_I_SESSION, g_param_spec_object ("session", "TLS session", "the TLS session object for this stream", WOCKY_TYPE_TLS_SESSION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void wocky_tls_connection_init (WockyTLSConnection *connection) { } static void wocky_tls_session_read_ready (GObject *object, GAsyncResult *result, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_SESSION (user_data); g_assert (session->read_op.state == WOCKY_TLS_OP_STATE_ACTIVE); session->read_op.result = g_input_stream_read_finish (G_INPUT_STREAM (object), result, &session->read_op.error); session->read_op.state = WOCKY_TLS_OP_STATE_DONE; /* don't recurse if the async handler is already running */ if (!session->async) wocky_tls_session_try_operation (session, WOCKY_TLS_OP_READ); } static void wocky_tls_session_write_ready (GObject *object, GAsyncResult *result, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_SESSION (user_data); gssize ret; g_assert (session->write_op.state == WOCKY_TLS_OP_STATE_ACTIVE); ret = g_output_stream_write_finish (G_OUTPUT_STREAM (object), result, &session->write_op.error); if (ret > 0) { session->write_op.result += ret; if (session->write_op.result < session->write_op.requested) { GOutputStream *stream; WockyTLSJob *active_job; stream = g_io_stream_get_output_stream (session->stream); if (session->handshake_job.job.active) active_job = &session->handshake_job.job; else active_job = &session->write_job.job; g_output_stream_write_async (stream, session->write_op.buffer + session->write_op.result, session->write_op.requested - session->write_op.result, active_job->io_priority, active_job->cancellable, wocky_tls_session_write_ready, session); return; } } else { /* Error or EOF, we're done */ session->write_op.result = ret; } session->write_op.state = WOCKY_TLS_OP_STATE_DONE; /* don't recurse if the async handler is already running */ if (!session->async) wocky_tls_session_try_operation (session, WOCKY_TLS_OP_WRITE); } static ssize_t wocky_tls_session_push_func (gpointer user_data, const void *buffer, size_t count) { WockyTLSSession *session = WOCKY_TLS_SESSION (user_data); GOutputStream *stream; stream = g_io_stream_get_output_stream (session->stream); if (session->async) { WockyTLSJob *active_job; g_assert (session->handshake_job.job.active || session->write_job.job.active); if (session->handshake_job.job.active) active_job = &session->handshake_job.job; else active_job = &session->write_job.job; g_assert (active_job->active); if (session->write_op.state == WOCKY_TLS_OP_STATE_IDLE) { session->write_op.state = WOCKY_TLS_OP_STATE_ACTIVE; session->write_op.buffer = g_memdup (buffer, count); session->write_op.requested = count; session->write_op.error = NULL; session->write_op.result = 0; g_output_stream_write_async (stream, session->write_op.buffer, session->write_op.requested, active_job->io_priority, active_job->cancellable, wocky_tls_session_write_ready, session); if G_UNLIKELY (session->write_op.state != WOCKY_TLS_OP_STATE_ACTIVE) g_warning ("The underlying stream '%s' used by the WockyTLSSession " "called the GAsyncResultCallback recursively. This " "is an error in the underlying implementation: in " "some cases it may lead to unbounded recursion. " "Result callbacks should always be dispatched from " "the mainloop.", G_OBJECT_TYPE_NAME (stream)); } g_assert (session->write_op.state != WOCKY_TLS_OP_STATE_IDLE); g_assert_cmpint (session->write_op.requested, ==, count); g_assert (memcmp (session->write_op.buffer, buffer, count) == 0); if (session->write_op.state == WOCKY_TLS_OP_STATE_DONE) { session->write_op.state = WOCKY_TLS_OP_STATE_IDLE; g_free (session->write_op.buffer); if (session->write_op.result < 0) { active_job->error = session->write_op.error; gnutls_transport_set_errno (session->session, EIO); return -1; } else { g_assert_cmpint (session->write_op.result, <=, count); return session->write_op.result; } } gnutls_transport_set_errno (session->session, EAGAIN); return -1; } else { gssize result; result = g_output_stream_write (stream, buffer, count, session->cancellable, &session->error); if (result < 0) gnutls_transport_set_errno (session->session, EIO); return result; } } static ssize_t wocky_tls_session_pull_func (gpointer user_data, void *buffer, size_t count) { WockyTLSSession *session = WOCKY_TLS_SESSION (user_data); GInputStream *stream; stream = g_io_stream_get_input_stream (session->stream); if (session->async) { WockyTLSJob *active_job; g_assert (session->handshake_job.job.active || session->read_job.job.active); if (session->handshake_job.job.active) active_job = &session->handshake_job.job; else active_job = &session->read_job.job; g_assert (active_job->active); if (session->read_op.state == WOCKY_TLS_OP_STATE_IDLE) { session->read_op.state = WOCKY_TLS_OP_STATE_ACTIVE; session->read_op.buffer = g_malloc (count); session->read_op.requested = count; session->read_op.error = NULL; g_input_stream_read_async (stream, session->read_op.buffer, session->read_op.requested, active_job->io_priority, active_job->cancellable, wocky_tls_session_read_ready, session); if G_UNLIKELY (session->read_op.state != WOCKY_TLS_OP_STATE_ACTIVE) g_warning ("The underlying stream '%s' used by the WockyTLSSession " "called the GAsyncResultCallback recursively. This " "is an error in the underlying implementation: in " "some cases it may lead to unbounded recursion. " "Result callbacks should always be dispatched from " "the mainloop.", G_OBJECT_TYPE_NAME (stream)); } g_assert (session->read_op.state != WOCKY_TLS_OP_STATE_IDLE); g_assert_cmpint (session->read_op.requested, ==, count); if (session->read_op.state == WOCKY_TLS_OP_STATE_DONE) { session->read_op.state = WOCKY_TLS_OP_STATE_IDLE; if (session->read_op.result < 0) { g_free (session->read_op.buffer); session->read_op.buffer = NULL; active_job->error = session->read_op.error; gnutls_transport_set_errno (session->session, EIO); return -1; } else { g_assert_cmpint (session->read_op.result, <=, count); memcpy (buffer, session->read_op.buffer, session->read_op.result); g_free (session->read_op.buffer); session->read_op.buffer = NULL; return session->read_op.result; } } gnutls_transport_set_errno (session->session, EAGAIN); return -1; } else { gssize result; result = g_input_stream_read (stream, buffer, count, session->cancellable, &session->error); if (result < 0) gnutls_transport_set_errno (session->session, EIO); return result; } } static void tls_debug (int level, const char *msg) { DEBUG ("[%d] [%02d] %s", getpid(), level, msg); } static void wocky_tls_session_init (WockyTLSSession *session) { const char *level; guint64 lvl = 0; static gsize initialised; if G_UNLIKELY (g_once_init_enter (&initialised)) { gnutls_global_init (); gnutls_global_set_log_function (tls_debug); g_once_init_leave (&initialised, 1); } if ((level = g_getenv ("WOCKY_TLS_DEBUG_LEVEL")) != NULL) lvl = g_ascii_strtoull (level, NULL, 10); tls_debug_level = lvl; gnutls_global_set_log_level (lvl); } static void wocky_tls_session_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); switch (prop_id) { case PROP_S_STREAM: session->stream = g_value_dup_object (value); break; case PROP_S_SERVER: session->server = g_value_get_boolean (value); break; case PROP_S_DHBITS: session->dh_bits = g_value_get_uint (value); break; case PROP_S_KEYFILE: session->key_file = g_value_dup_string (value); break; case PROP_S_CERTFILE: session->cert_file = g_value_dup_string (value); break; default: g_assert_not_reached (); } } static const char * tls_options (void) { const char *options = g_getenv ("WOCKY_GNUTLS_OPTIONS"); return (options != NULL && *options != '\0') ? options : DEFAULT_TLS_OPTIONS; } static void wocky_tls_session_constructed (GObject *object) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); gboolean server = session->server; gint code; const gchar *opt = tls_options (); const gchar *pos = NULL; /* gnutls_handshake_set_private_extensions (session->session, 1); */ gnutls_certificate_allocate_credentials (&(session->gnutls_cert_cred)); /* I think this all needs to be done per connection: conceivably the DH parameters could be moved to the global section above, but IANA cryptographer */ if (server) { gnutls_dh_params_t *dhp; if ((session->key_file != NULL) && (session->cert_file != NULL)) { DEBUG ("cert/key pair: %s/%s", session->cert_file, session->key_file); gnutls_certificate_set_x509_key_file (session->gnutls_cert_cred, session->cert_file, session->key_file, GNUTLS_X509_FMT_PEM); } switch (session->dh_bits) { case 768: dhp = &dh_0768; break; case 1024: dhp = &dh_1024; break; case 2048: dhp = &dh_2048; break; case 3072: dhp = &dh_3072; break; case 4096: dhp = &dh_4096; break; default: dhp = &dh_1024; break; } if (*dhp == NULL) { DEBUG ("Initialising DH parameters (%d bits)", session->dh_bits); gnutls_dh_params_init (dhp); gnutls_dh_params_generate2 (*dhp, session->dh_bits); } session->dh_params = *dhp; gnutls_certificate_set_dh_params (session->gnutls_cert_cred, *dhp); gnutls_init (&session->session, GNUTLS_SERVER); } else gnutls_init (&session->session, GNUTLS_CLIENT); code = gnutls_priority_set_direct (session->session, opt, &pos); if (code != GNUTLS_E_SUCCESS) { DEBUG ("could not set priority string: %s", error_to_string (code)); DEBUG (" '%s'", opt); if (pos >= opt) DEBUG (" %*s^", (int) (pos - opt), ""); } else { DEBUG ("priority set to: '%s'", opt); } code = gnutls_credentials_set (session->session, GNUTLS_CRD_CERTIFICATE, session->gnutls_cert_cred); if (code != GNUTLS_E_SUCCESS) DEBUG ("could not set credentials: %s", error_to_string (code)); gnutls_transport_set_push_function (session->session, wocky_tls_session_push_func); gnutls_transport_set_pull_function (session->session, wocky_tls_session_pull_func); gnutls_transport_set_ptr (session->session, session); g_assert (session->stream); } static void wocky_tls_session_finalize (GObject *object) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); gnutls_deinit (session->session); gnutls_certificate_free_credentials (session->gnutls_cert_cred); g_object_unref (session->stream); G_OBJECT_CLASS (wocky_tls_session_parent_class) ->finalize (object); } static void wocky_tls_session_dispose (GObject *object) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); g_free (session->key_file); session->key_file = NULL; g_free (session->cert_file); session->cert_file = NULL; g_free (session->read_op.buffer); session->read_op.buffer = NULL; G_OBJECT_CLASS (wocky_tls_session_parent_class)->dispose (object); } static void wocky_tls_session_class_init (GObjectClass *class) { class->set_property = wocky_tls_session_set_property; class->constructed = wocky_tls_session_constructed; class->finalize = wocky_tls_session_finalize; class->dispose = wocky_tls_session_dispose; g_object_class_install_property (class, PROP_S_STREAM, g_param_spec_object ("base-stream", "base stream", "the stream that TLS communicates over", G_TYPE_IO_STREAM, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_SERVER, g_param_spec_boolean ("server", "server", "whether this is a server", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_DHBITS, g_param_spec_uint ("dh-bits", "Diffie-Hellman bits", "Diffie-Hellmann bits: 768, 1024, 2048, 3072 0r 4096", 768, 4096, 1024, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_KEYFILE, g_param_spec_string ("x509-key", "x509 key", "x509 PEM key file", NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_CERTFILE, g_param_spec_string ("x509-cert", "x509 certificate", "x509 PEM certificate file", NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void wocky_tls_connection_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (object); switch (prop_id) { case PROP_C_SESSION: connection->session = g_value_dup_object (value); break; default: g_assert_not_reached (); } } static gboolean wocky_tls_connection_close (GIOStream *stream, GCancellable *cancellable, GError **error) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (stream); return g_io_stream_close (connection->session->stream, cancellable, error); } static GInputStream * wocky_tls_connection_get_input_stream (GIOStream *io_stream) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (io_stream); if (connection->input == NULL) connection->input = g_object_new (WOCKY_TYPE_TLS_INPUT_STREAM, "session", connection->session, NULL); return (GInputStream *)connection->input; } static GOutputStream * wocky_tls_connection_get_output_stream (GIOStream *io_stream) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (io_stream); if (connection->output == NULL) connection->output = g_object_new (WOCKY_TYPE_TLS_OUTPUT_STREAM, "session", connection->session, NULL); return (GOutputStream *)connection->output; } static void wocky_tls_connection_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { default: g_assert_not_reached (); } } static void wocky_tls_connection_constructed (GObject *object) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (object); g_assert (connection->session); } static void wocky_tls_connection_finalize (GObject *object) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (object); g_object_unref (connection->session); if (connection->input != NULL) g_object_unref (connection->input); if (connection->output != NULL) g_object_unref (connection->output); G_OBJECT_CLASS (wocky_tls_connection_parent_class) ->finalize (object); } static void wocky_tls_connection_class_init (WockyTLSConnectionClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); GIOStreamClass *stream_class = G_IO_STREAM_CLASS (class); gobject_class->get_property = wocky_tls_connection_get_property; gobject_class->set_property = wocky_tls_connection_set_property; gobject_class->constructed = wocky_tls_connection_constructed; gobject_class->finalize = wocky_tls_connection_finalize; g_object_class_install_property (gobject_class, PROP_C_SESSION, g_param_spec_object ("session", "TLS session", "the TLS session object for this connection", WOCKY_TYPE_TLS_SESSION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); stream_class->get_input_stream = wocky_tls_connection_get_input_stream; stream_class->get_output_stream = wocky_tls_connection_get_output_stream; stream_class->close_fn = wocky_tls_connection_close; } WockyTLSSession * wocky_tls_session_new (GIOStream *stream) { return g_object_new (WOCKY_TYPE_TLS_SESSION, "base-stream", stream, "server", FALSE, NULL); } /** * wocky_tls_session_server_new: * @stream: a GIOStream on which we expect to receive the client TLS handshake * @dhbits: size of the DH parameters (see gnutls for valid settings) * @key: the path to the X509 PEM key file * @cert: the path to the X509 PEM certificate * * Create a new TLS server session * * Returns: a #WockyTLSSession object */ WockyTLSSession * wocky_tls_session_server_new (GIOStream *stream, guint dhbits, const gchar* key, const gchar* cert) { if (dhbits == 0) dhbits = 1024; return g_object_new (WOCKY_TYPE_TLS_SESSION, "base-stream", stream, "dh-bits", dhbits, "x509-key", key, "x509-cert", cert, "server", TRUE, NULL); } /* this file is "borrowed" from an unmerged gnio feature: */ /* Local Variables: */ /* c-file-style: "gnu" */ /* End: */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-writer.h0000644000175000017500000000606312050202021023763 0ustar00wjtwjt00000000000000/* * wocky-xmpp-writer.h - Header for WockyXmppWriter * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_XMPP_WRITER_H__ #define __WOCKY_XMPP_WRITER_H__ #include #include "wocky-stanza.h" #include "wocky-node-tree.h" G_BEGIN_DECLS typedef struct _WockyXmppWriter WockyXmppWriter; /** * WockyXmppWriterClass: * * The class of a #WockyXmppWriter. */ typedef struct _WockyXmppWriterClass WockyXmppWriterClass; typedef struct _WockyXmppWriterPrivate WockyXmppWriterPrivate; struct _WockyXmppWriterClass { /**/ GObjectClass parent_class; }; struct _WockyXmppWriter { /**/ GObject parent; WockyXmppWriterPrivate *priv; }; GType wocky_xmpp_writer_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_XMPP_WRITER \ (wocky_xmpp_writer_get_type ()) #define WOCKY_XMPP_WRITER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_XMPP_WRITER, \ WockyXmppWriter)) #define WOCKY_XMPP_WRITER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_XMPP_WRITER, \ WockyXmppWriterClass)) #define WOCKY_IS_XMPP_WRITER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_XMPP_WRITER)) #define WOCKY_IS_XMPP_WRITER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_XMPP_WRITER)) #define WOCKY_XMPP_WRITER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_XMPP_WRITER, \ WockyXmppWriterClass)) WockyXmppWriter *wocky_xmpp_writer_new (void); WockyXmppWriter *wocky_xmpp_writer_new_no_stream (void); void wocky_xmpp_writer_stream_open (WockyXmppWriter *writer, const gchar *to, const gchar *from, const gchar *version, const gchar *lang, const gchar *id, const guint8 **data, gsize *length); void wocky_xmpp_writer_stream_close (WockyXmppWriter *writer, const guint8 **data, gsize *length); void wocky_xmpp_writer_write_stanza (WockyXmppWriter *writer, WockyStanza *stanza, const guint8 **data, gsize *length); void wocky_xmpp_writer_write_node_tree (WockyXmppWriter *writer, WockyNodeTree *tree, const guint8 **data, gsize *length); void wocky_xmpp_writer_flush (WockyXmppWriter *writer); G_END_DECLS #endif /* #ifndef __WOCKY_XMPP_WRITER_H__*/ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-resource-contact.c0000644000175000017500000001545312050202021024743 0ustar00wjtwjt00000000000000/* * wocky-resource-contact.c - Source for WockyResourceContact * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * 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 */ /** * SECTION: wocky-resource-contact * @title: WockyResourceContact * @short_description: * @include: wocky/wocky-resource-contact.h * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-resource-contact.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_ROSTER #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyResourceContact, wocky_resource_contact, WOCKY_TYPE_CONTACT) /* properties */ enum { PROP_RESOURCE = 1, PROP_BARE_CONTACT, }; /* signal enum */ enum { LAST_SIGNAL, }; /* static guint signals[LAST_SIGNAL] = {0}; */ /* private structure */ struct _WockyResourceContactPrivate { gboolean dispose_has_run; gchar *resource; WockyBareContact *bare_contact; }; static void wocky_resource_contact_init (WockyResourceContact *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_RESOURCE_CONTACT, WockyResourceContactPrivate); } static void wocky_resource_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyResourceContact *self = WOCKY_RESOURCE_CONTACT (object); WockyResourceContactPrivate *priv = self->priv; switch (property_id) { case PROP_RESOURCE: priv->resource = g_value_dup_string (value); break; case PROP_BARE_CONTACT: priv->bare_contact = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_resource_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyResourceContact *self = WOCKY_RESOURCE_CONTACT (object); WockyResourceContactPrivate *priv = self->priv; switch (property_id) { case PROP_RESOURCE: g_value_set_string (value, priv->resource); break; case PROP_BARE_CONTACT: g_value_set_object (value, priv->bare_contact); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_resource_contact_constructed (GObject *object) { WockyResourceContact *self = WOCKY_RESOURCE_CONTACT (object); WockyResourceContactPrivate *priv = self->priv; g_assert (priv->resource != NULL); g_assert (priv->bare_contact != NULL); } static void wocky_resource_contact_dispose (GObject *object) { WockyResourceContact *self = WOCKY_RESOURCE_CONTACT (object); WockyResourceContactPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; g_object_unref (priv->bare_contact); if (G_OBJECT_CLASS (wocky_resource_contact_parent_class)->dispose) G_OBJECT_CLASS (wocky_resource_contact_parent_class)->dispose (object); } static void wocky_resource_contact_finalize (GObject *object) { WockyResourceContact *self = WOCKY_RESOURCE_CONTACT (object); WockyResourceContactPrivate *priv = self->priv; g_free (priv->resource); G_OBJECT_CLASS (wocky_resource_contact_parent_class)->finalize (object); } static gchar * wocky_resource_contact_dup_jid (WockyContact *contact) { WockyResourceContact *self = WOCKY_RESOURCE_CONTACT (contact); const gchar *bare = wocky_bare_contact_get_jid (self->priv->bare_contact); return g_strdup_printf ("%s/%s", bare, self->priv->resource); } static void wocky_resource_contact_class_init ( WockyResourceContactClass *wocky_resource_contact_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_resource_contact_class); WockyContactClass *contact_class = WOCKY_CONTACT_CLASS (wocky_resource_contact_class); GParamSpec *spec; g_type_class_add_private (wocky_resource_contact_class, sizeof (WockyResourceContactPrivate)); object_class->constructed = wocky_resource_contact_constructed; object_class->set_property = wocky_resource_contact_set_property; object_class->get_property = wocky_resource_contact_get_property; object_class->dispose = wocky_resource_contact_dispose; object_class->finalize = wocky_resource_contact_finalize; contact_class->dup_jid = wocky_resource_contact_dup_jid; /** * WockyResourceContact:resource: * * The resource of the contact. */ spec = g_param_spec_string ("resource", "Contact resource", "Contact resource", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_RESOURCE, spec); /** * WockyResourceContact:bare-contact: * * The #WockyBareContact associated with this #WockyResourceContact */ spec = g_param_spec_object ("bare-contact", "Bare contact", "the WockyBareContact associated with this WockyResourceContact", WOCKY_TYPE_BARE_CONTACT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BARE_CONTACT, spec); } WockyResourceContact * wocky_resource_contact_new (WockyBareContact *bare, const gchar *resource) { return g_object_new (WOCKY_TYPE_RESOURCE_CONTACT, "bare-contact", bare, "resource", resource, NULL); } const gchar * wocky_resource_contact_get_resource (WockyResourceContact *self) { WockyResourceContactPrivate *priv = self->priv; return priv->resource; } WockyBareContact * wocky_resource_contact_get_bare_contact (WockyResourceContact *self) { WockyResourceContactPrivate *priv = self->priv; return priv->bare_contact; } gboolean wocky_resource_contact_equal (WockyResourceContact *a, WockyResourceContact *b) { if (a == NULL || b == NULL) return FALSE; if (wocky_strdiff (wocky_resource_contact_get_resource (a), wocky_resource_contact_get_resource (b))) return FALSE; return wocky_bare_contact_equal (wocky_resource_contact_get_bare_contact (a), wocky_resource_contact_get_bare_contact (b)); } telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-sasl-scram.h0000644000175000017500000000424312050202021023530 0ustar00wjtwjt00000000000000/* * wocky-sasl-scram.h - SCRAM-SHA1 implementation (to be RFC 5802) * Copyright (C) 2010 Sjoerd Simons * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_SASL_SCRAM_H #define _WOCKY_SASL_SCRAM_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_SASL_SCRAM \ wocky_sasl_scram_get_type () #define WOCKY_SASL_SCRAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_SASL_SCRAM, \ WockySaslScram)) #define WOCKY_SASL_SCRAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_SASL_SCRAM, \ WockySaslScramClass)) #define WOCKY_IS_SASL_SCRAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_SASL_SCRAM)) #define WOCKY_IS_SASL_SCRAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_SASL_SCRAM)) #define WOCKY_SASL_SCRAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_SASL_SCRAM, \ WockySaslScramClass)) typedef struct _WockySaslScramPrivate WockySaslScramPrivate; typedef struct { GObject parent; WockySaslScramPrivate *priv; } WockySaslScram; typedef struct { GObjectClass parent_class; } WockySaslScramClass; GType wocky_sasl_scram_get_type (void); WockySaslScram * wocky_sasl_scram_new ( const gchar *server, const gchar *username, const gchar *password); G_END_DECLS #endif /* _WOCKY_SASL_SCRAM_H */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-xmpp-error.h0000644000175000017500000003553512050202021023606 0ustar00wjtwjt00000000000000/* * wocky-xmpp-error.h - Header for Wocky's XMPP error handling API * Copyright (C) 2006-2009 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * 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 */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_XMPP_ERROR_H__ #define __WOCKY_XMPP_ERROR_H__ #include #include #include "wocky-xmpp-error-enumtypes.h" #include "wocky-node.h" /** * WockyXmppErrorType: * @WOCKY_XMPP_ERROR_TYPE_CANCEL: do not retry (the error is * unrecoverable) * @WOCKY_XMPP_ERROR_TYPE_CONTINUE: proceed (the condition was only a * warning) * @WOCKY_XMPP_ERROR_TYPE_MODIFY: retry after changing the data sent * @WOCKY_XMPP_ERROR_TYPE_AUTH: retry after providing credentials * @WOCKY_XMPP_ERROR_TYPE_WAIT: retry after waiting (the error is * temporary) * * XMPP error types as described in RFC 3920 §9.3.2. */ /*< prefix=WOCKY_XMPP_ERROR_TYPE >*/ typedef enum { WOCKY_XMPP_ERROR_TYPE_CANCEL, WOCKY_XMPP_ERROR_TYPE_CONTINUE, WOCKY_XMPP_ERROR_TYPE_MODIFY, WOCKY_XMPP_ERROR_TYPE_AUTH, WOCKY_XMPP_ERROR_TYPE_WAIT } WockyXmppErrorType; /** * WockyXmppError: * @WOCKY_XMPP_ERROR_UNDEFINED_CONDITION: he error condition is not one * of those defined by the other conditions in this list * @WOCKY_XMPP_ERROR_REDIRECT: the recipient or server is redirecting * requests for this information to another entity * @WOCKY_XMPP_ERROR_GONE: the recipient or server can no longer be * contacted at this address * @WOCKY_XMPP_ERROR_BAD_REQUEST: the sender has sent XML that is * malformed or that cannot be processed * @WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST: the recipient or server * understood the request but was not expecting it at this time * @WOCKY_XMPP_ERROR_JID_MALFORMED: the sending entity has provided or * communicated an XMPP address * @WOCKY_XMPP_ERROR_NOT_AUTHORIZED: the sender must provide proper * credentials before being allowed to perform the action, or has * provided improper credentials * @WOCKY_XMPP_ERROR_PAYMENT_REQUIRED: the requesting entity is not * authorized to access the requested service because payment is * required * @WOCKY_XMPP_ERROR_FORBIDDEN: the requesting entity does not possess * the required permissions to perform the action * @WOCKY_XMPP_ERROR_ITEM_NOT_FOUND: he addressed JID or item requested * cannot be found * @WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE: the intended recipient is * temporarily unavailable * @WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND: a remote server or * service specified as part or all of the JID of the intended * recipient does not exist * @WOCKY_XMPP_ERROR_NOT_ALLOWED: the recipient or server does not * allow any entity to perform the action * @WOCKY_XMPP_ERROR_NOT_ACCEPTABLE: the recipient or server * understands the request but is refusing to process it because it * does not meet criteria defined by the recipient or server * @WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED: the requesting entity is * not authorized to access the requested service because * registration is required * @WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED: the requesting entity is * not authorized to access the requested service because a * subscription is required * @WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT: a remote server or service * specified as part or all of the JID of the intended recipient (or * required to fulfill a request) could not be contacted within a * reasonable amount of time * @WOCKY_XMPP_ERROR_CONFLICT: access cannot be granted because an * existing resource or session exists with the same name or address * @WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR: the server could not * process the stanza because of a misconfiguration or an * otherwise-undefined internal server error * @WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT: the server or recipient lacks * the system resources necessary to service the request * @WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED: the feature requested is * not implemented by the recipient or server and therefore cannot * be processed * @WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE: the server or recipient does * not currently provide the requested service * * Possible XMPP stream errors, as defined by RFC 3920 §9.3.3. */ /*< prefix=WOCKY_XMPP_ERROR >*/ typedef enum { WOCKY_XMPP_ERROR_UNDEFINED_CONDITION = 0, /* 500 */ WOCKY_XMPP_ERROR_REDIRECT, /* 302 */ WOCKY_XMPP_ERROR_GONE, /* 302 */ WOCKY_XMPP_ERROR_BAD_REQUEST, /* 400 */ WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST, /* 400 */ WOCKY_XMPP_ERROR_JID_MALFORMED, /* 400 */ WOCKY_XMPP_ERROR_NOT_AUTHORIZED, /* 401 */ WOCKY_XMPP_ERROR_PAYMENT_REQUIRED, /* 402 */ WOCKY_XMPP_ERROR_FORBIDDEN, /* 403 */ WOCKY_XMPP_ERROR_ITEM_NOT_FOUND, /* 404 */ WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE, /* 404 */ WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND, /* 404 */ WOCKY_XMPP_ERROR_NOT_ALLOWED, /* 405 */ WOCKY_XMPP_ERROR_NOT_ACCEPTABLE, /* 406 */ WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED, /* 407 */ WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED, /* 407 */ WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT, /* 408, 504 */ WOCKY_XMPP_ERROR_CONFLICT, /* 409 */ WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR, /* 500 */ WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT, /* 500 */ WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED, /* 501 */ WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE, /* 502, 503, 510 */ /*< private >*/ NUM_WOCKY_XMPP_ERRORS /*< skip >*/ /* don't want this in the GEnum */ } WockyXmppError; GQuark wocky_xmpp_error_quark (void); #define WOCKY_XMPP_ERROR (wocky_xmpp_error_quark ()) /** * WockyXmppErrorSpecialization: * @description: description of the error * @specializes: which #WockyXmppError this error specializes * @override_type: %TRUE if @type should be used, or %FALSE if the * default error type for @specializes should be used * @type: the XMPP error type * * A struct to represent a specialization of an existing * #WockyXmppError member. */ typedef struct _WockyXmppErrorSpecialization WockyXmppErrorSpecialization; struct _WockyXmppErrorSpecialization { const gchar *description; WockyXmppError specializes; gboolean override_type; WockyXmppErrorType type; }; /** * WockyXmppErrorDomain: * @domain: a #GQuark of the error domain * @enum_type: the #GType of the error enum * @codes: a %NULL-terminated array of of #WockyXmppErrorSpecializations * * A struct to represent extra XMPP error domains added. */ typedef struct _WockyXmppErrorDomain WockyXmppErrorDomain; struct _WockyXmppErrorDomain { GQuark domain; GType enum_type; WockyXmppErrorSpecialization *codes; }; void wocky_xmpp_error_register_domain (WockyXmppErrorDomain *domain); /** * WockyJingleError: * @WOCKY_JINGLE_ERROR_OUT_OF_ORDER: the request cannot occur at this * point in the state machine * @WOCKY_JINGLE_ERROR_TIE_BREAK: the request is rejected because it * was sent while the initiator was awaiting a reply on a similar * request * @WOCKY_JINGLE_ERROR_UNKNOWN_SESSION: the 'sid' attribute specifies * a session that is unknown to the recipient * @WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO: the recipient does not * support the informational payload of a session-info action. * * Jingle specific errors. */ /*< prefix=WOCKY_JINGLE_ERROR >*/ typedef enum { WOCKY_JINGLE_ERROR_OUT_OF_ORDER, WOCKY_JINGLE_ERROR_TIE_BREAK, WOCKY_JINGLE_ERROR_UNKNOWN_SESSION, WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO } WockyJingleError; GQuark wocky_jingle_error_quark (void); #define WOCKY_JINGLE_ERROR (wocky_jingle_error_quark ()) /** * WockySIError: * @WOCKY_SI_ERROR_NO_VALID_STREAMS: none of the available streams are * acceptable * @WOCKY_SI_ERROR_BAD_PROFILE: the profile is not understood or * invalid * * SI specific errors. */ /*< prefix=WOCKY_SI_ERROR >*/ typedef enum { WOCKY_SI_ERROR_NO_VALID_STREAMS, WOCKY_SI_ERROR_BAD_PROFILE } WockySIError; GQuark wocky_si_error_quark (void); #define WOCKY_SI_ERROR (wocky_si_error_quark ()) /** * WockyXmppStreamError: * @WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT: the entity has sent XML that * cannot be processed * @WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX: the entity has sent * a namespace prefix that is unsupported, or has sent no namespace * prefix on an element that requires such a prefix * @WOCKY_XMPP_STREAM_ERROR_CONFLICT: the server is closing the active * stream for this entity because a new stream has been initiated * that conflicts with the existing stream * @WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT: the entity has not * generated any traffic over the stream for some period of time * @WOCKY_XMPP_STREAM_ERROR_HOST_GONE: the value of the 'to' attribute * provided by the initiating entity in the stream header * corresponds to a hostname that is no longer hosted by the server * @WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN: the value of the 'to' * attribute provided by the initiating entity in the stream header * does not correspond to a hostname that is hosted by the server * @WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING: a stanza sent between * two servers lacks a 'to' or 'from' attribute (or the attribute * has no value) * @WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR: the server has * experienced a misconfiguration or an otherwise-undefined internal * error that prevents it from servicing the stream * @WOCKY_XMPP_STREAM_ERROR_INVALID_FROM: the JID or hostname provided * in a 'from' address does not match an authorized JID or validated * domain negotiated between servers via SASL or dialback, or * between a client and a server via authentication and resource * binding * @WOCKY_XMPP_STREAM_ERROR_INVALID_ID: the stream ID or dialback ID * is invalid or does not match an ID previously provided * @WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE: the streams namespace * name is something other than "http://etherx.jabber.org/streams" * or the dialback namespace name is something other than * "jabber:server:dialback" * @WOCKY_XMPP_STREAM_ERROR_INVALID_XML: the entity has sent invalid * XML over the stream to a server that performs validation * @WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED: the entity has attempted * to send data before the stream has been authenticated, or * otherwise is not authorized to perform an action related to * stream negotiation * @WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION: the entity has violated * some local service policy * @WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED: the server is * unable to properly connect to a remote entity that is required * for authentication or authorization * @WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT: the server lacks the * system resources necessary to service the stream * @WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML: the entity has attempted * to send restricted XML features such as a comment, processing * instruction, DTD, entity reference, or unescaped character * @WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST: the server will not * provide service to the initiating entity but is redirecting * traffic to another host * @WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN: the server is being shut * down and all active streams are being closed * @WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION: the error condition * is not one of those defined by the other conditions in this list * @WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING: the initiating * entity has encoded the stream in an encoding that is not * supported by the server * @WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE: the initiating * entity has sent a first-level child of the stream that is not * supported by the server * @WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION: the value of the * 'version' attribute provided by the initiating entity in the * stream header specifies a version of XMPP that is not supported * by the server * @WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED: the initiating entity * has sent XML that is not well-formed * @WOCKY_XMPP_STREAM_ERROR_UNKNOWN: an unknown stream error * * Stream-level error conditions as described in RFC 3920 §4.7.3. */ /*< prefix=WOCKY_XMPP_STREAM_ERROR >*/ typedef enum { WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT, WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX, WOCKY_XMPP_STREAM_ERROR_CONFLICT, WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT, WOCKY_XMPP_STREAM_ERROR_HOST_GONE, WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN, WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING, WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR, WOCKY_XMPP_STREAM_ERROR_INVALID_FROM, WOCKY_XMPP_STREAM_ERROR_INVALID_ID, WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE, WOCKY_XMPP_STREAM_ERROR_INVALID_XML, WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED, WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION, WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED, WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT, WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML, WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST, WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN, WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION, WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING, WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE, WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION, WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED, WOCKY_XMPP_STREAM_ERROR_UNKNOWN, } WockyXmppStreamError; GQuark wocky_xmpp_stream_error_quark (void); /** * WOCKY_XMPP_STREAM_ERROR: * * Get access to the error quark of the xmpp stream errors. */ #define WOCKY_XMPP_STREAM_ERROR (wocky_xmpp_stream_error_quark ()) const gchar *wocky_xmpp_error_string (WockyXmppError error); const gchar *wocky_xmpp_error_description (WockyXmppError error); GError *wocky_xmpp_stream_error_from_node (WockyNode *error); WockyNode *wocky_stanza_error_to_node (const GError *error, WockyNode *parent_node); const gchar *wocky_xmpp_stanza_error_to_string (GError *error); void wocky_xmpp_error_extract (WockyNode *error, WockyXmppErrorType *type, GError **core, GError **specialized, WockyNode **specialized_node); void wocky_xmpp_error_init (void); void wocky_xmpp_error_deinit (void); #endif /* __WOCKY_XMPP_ERROR_H__ */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-openssl.c0000644000175000017500000017417112051446215023171 0ustar00wjtwjt00000000000000/* * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima * Copyright © 2008-2009 Codethink Limited * Copyright © 2009-2010 Collabora Limited * * This program 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 of the licence or (at * your option) any later version. * * Authors: Vivek Dasmohapatra * Ryan Lortie * Christian Kellner * Samuel Cormier-Iijima * * Based on wocky-tls.c, which was in turn based on an unmerged gnio feature. * See wocky-tls.c for details. * * This file follows the original coding style from upstream, not collabora * house style. See wocky-tls.c for details. */ /** * SECTION: wocky-tls * @title: Wocky OpenSSL TLS * @short_description: Establish TLS sessions * * The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug * output from OpenSSL. To enable it, set it to a value from 1 to 9. * Higher values will print more information. * * Increasing the value past certain thresholds will also trigger increased * debugging output from within wocky-openssl.c as well. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-tls.h" /* Apparently an implicit requirement of OpenSSL's headers... */ #ifdef G_OS_WIN32 #include #endif #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_TLS #define DEBUG_HANDSHAKE_LEVEL 5 #define DEBUG_ASYNC_DETAIL_LEVEL 6 #include "wocky-debug-internal.h" #include "wocky-utils.h" #include #include #include #include #include #include /* SSL_CTX_set_cipher_list() allows to restrict/alter the list of supported * ciphers; see ciphers(1) for documentation on the format. * Usually the normal ciphers are ok, but on mobile phones we prefer RC4 as * it decreases the size of packets. The bandwidth difference is tiny, but * the difference in power consumption between small and very small packets * can be significant on 3G. */ #ifdef ENABLE_PREFER_STREAM_CIPHERS #define CIPHER_LIST \ "RC4-SHA:" \ "RC4-MD5:" \ "ECDHE-RSA-RC4-SHA:" \ "ECDHE-ECDSA-RC4-SHA:" \ "ECDH-RSA-RC4-SHA:" \ "ECDH-ECDSA-RC4-SHA:" \ "PSK-RC4-SHA:" \ "ALL" /* fall-back to all the other algorithms */ #endif enum { PROP_S_NONE, PROP_S_STREAM, PROP_S_SERVER, PROP_S_DHBITS, PROP_S_KEYFILE, PROP_S_CERTFILE, }; enum { PROP_C_NONE, PROP_C_SESSION, }; enum { PROP_O_NONE, PROP_O_SESSION }; enum { PROP_I_NONE, PROP_I_SESSION }; typedef enum { WOCKY_TLS_OP_HANDSHAKE, WOCKY_TLS_OP_READ, WOCKY_TLS_OP_WRITE } WockyTLSOperation; /* from openssl docs: not clear if this is exported as a constant by openssl */ #define MAX_SSLV3_BLOCK_SIZE 0x4000 typedef struct { gboolean active; gint io_priority; GCancellable *cancellable; GObject *source_object; GAsyncReadyCallback callback; gpointer user_data; gpointer source_tag; GError *error; gboolean sync_complete; gchar *buffer; gsize count; gchar rbuf[MAX_SSLV3_BLOCK_SIZE]; } WockyTLSJob; typedef struct { WockyTLSJob job; gulong state; gboolean done; } WockyTLSHandshake; typedef GIOStreamClass WockyTLSConnectionClass; typedef GObjectClass WockyTLSSessionClass; typedef GInputStreamClass WockyTLSInputStreamClass; typedef GOutputStreamClass WockyTLSOutputStreamClass; struct _WockyTLSSession { GObject parent; GIOStream *stream; GCancellable *cancellable; GError *error; gboolean async; /* tls server support */ gboolean server; guint dh_bits; gchar *key_file; gchar *cert_file; /* frontend jobs */ struct { WockyTLSHandshake handshake; WockyTLSJob read; WockyTLSJob write; } job; /* openssl structures */ BIO *rbio; BIO *wbio; SSL_METHOD *method; SSL_CTX *ctx; SSL *ssl; }; typedef struct { GInputStream parent; WockyTLSSession *session; } WockyTLSInputStream; typedef struct { GOutputStream parent; WockyTLSSession *session; } WockyTLSOutputStream; struct _WockyTLSConnection { GIOStream parent; WockyTLSSession *session; WockyTLSInputStream *input; WockyTLSOutputStream *output; }; DH * get_dh4096 (void); DH * get_dh2048 (void); DH * get_dh1024 (void); DH * get_dh512 (void); static guint tls_debug_level = 0; static GType wocky_tls_input_stream_get_type (void); static GType wocky_tls_output_stream_get_type (void); G_DEFINE_TYPE (WockyTLSConnection, wocky_tls_connection, G_TYPE_IO_STREAM); G_DEFINE_TYPE (WockyTLSSession, wocky_tls_session, G_TYPE_OBJECT); G_DEFINE_TYPE (WockyTLSInputStream, wocky_tls_input_stream, G_TYPE_INPUT_STREAM); G_DEFINE_TYPE (WockyTLSOutputStream, wocky_tls_output_stream, G_TYPE_OUTPUT_STREAM); #define WOCKY_TYPE_TLS_INPUT_STREAM (wocky_tls_input_stream_get_type ()) #define WOCKY_TYPE_TLS_OUTPUT_STREAM (wocky_tls_output_stream_get_type ()) #define WOCKY_TLS_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TLS_INPUT_STREAM, \ WockyTLSInputStream)) #define WOCKY_TLS_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TLS_OUTPUT_STREAM, \ WockyTLSOutputStream)) /* Ok: This function tries to retrieve the error that caused a problem from * * bottom of the openssl error stack: The errnum argument is the error code * * returned by the last openssl operation which MAY NOT have come from the * * openssl error stack (cf SSL_get_error) and which MAY be SSL_ERROR_NONE: * * it's not supposed to be SSL_ERROR_NONE if a problem occurred, but this is * * not actually guaranteed anywhere so we have to check for it here: */ static const gchar *error_to_string (long error) { static gchar ssl_error[256]; int e; int x; /* SSL_ERROR_NONE from ERR_get_error means we have emptied the stack, * * in which case we should back up and use the last error we saw: */ for (e = x = error; x != SSL_ERROR_NONE; x = ERR_get_error ()) e = x; /* we found an error in the stack, or were passed one in errnum: */ if (e != SSL_ERROR_NONE) { ERR_error_string_n ((gulong) e, ssl_error, sizeof (ssl_error)); return ssl_error; } /* No useful/informative/relevant error found */ return NULL; } static GSimpleAsyncResult * wocky_tls_job_make_result (WockyTLSJob *job, gssize result) { GSimpleAsyncResult *simple; simple = g_simple_async_result_new (job->source_object, job->callback, job->user_data, job->source_tag); if (job->error != NULL) { DEBUG ("setting error from job '%s'", job->error->message); g_simple_async_result_set_from_error (simple, job->error); g_error_free (job->error); job->error = NULL; } if (job->source_object != NULL) g_object_unref (job->source_object); job->source_object = NULL; if (job->cancellable != NULL) g_object_unref (job->cancellable); job->cancellable = NULL; job->active = FALSE; return simple; } static void wocky_tls_job_result_gssize (WockyTLSJob *job, gssize result) { GSimpleAsyncResult *simple; if ((simple = wocky_tls_job_make_result (job, result))) { if (result >= 0) g_simple_async_result_set_op_res_gssize (simple, result); g_simple_async_result_complete (simple); g_object_unref (simple); } } /* only used for handshake results: read + write use result_gssize */ static void wocky_tls_job_result_boolean (WockyTLSJob *job, gint result) { GSimpleAsyncResult *simple; if ((simple = wocky_tls_job_make_result (job, result))) { g_simple_async_result_complete (simple); g_object_unref (simple); } } /* ************************************************************************* */ static void wocky_tls_session_try_operation (WockyTLSSession *session, WockyTLSOperation operation); static void wocky_tls_session_write_ready (GObject *object, GAsyncResult *result, gpointer user_data); static void wocky_tls_session_read_ready (GObject *object, GAsyncResult *result, gpointer user_data); /* writes to the internal BIO should always succeed, so we should never * receive SSL_ERROR_WANT_WRITE: reads, on the other hand, obviously * depend on how much data we have buffered, so SSL_ERROR_WANT_READ can * clearly happen */ static void handshake_write (WockyTLSSession *session) { gchar *wbuf; WockyTLSJob *handshake = &(session->job.handshake.job); GCancellable *cancel = handshake->cancellable; gint prio = handshake->io_priority; GOutputStream *output = g_io_stream_get_output_stream (session->stream); long wsize = BIO_get_mem_data (session->wbio, &wbuf); if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); g_output_stream_write_async (output, wbuf, wsize, prio, cancel, wocky_tls_session_write_ready, session); } static void handshake_read (WockyTLSSession *session) { GInputStream *input = g_io_stream_get_input_stream (session->stream); WockyTLSJob *handshake = (WockyTLSJob *) &session->job.handshake.job; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); g_input_stream_read_async (input, &(handshake->rbuf), MAX_SSLV3_BLOCK_SIZE, handshake->io_priority, handshake->cancellable, wocky_tls_session_read_ready, session); } static int ssl_handshake (WockyTLSSession *session) { gint result = 1; gulong errnum = SSL_ERROR_NONE; gboolean want_read = FALSE; gboolean want_write = FALSE; const gchar *errstr = NULL; gboolean done = session->job.handshake.done; gboolean fatal = FALSE; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); if (!done) { const gchar *method; if (session->server) { method = "SSL_accept"; result = SSL_accept (session->ssl); } else { method = "SSL_connect"; result = SSL_connect (session->ssl); } errnum = SSL_get_error (session->ssl, result); done = (result == 1); errstr = error_to_string (errnum); fatal = (errnum != SSL_ERROR_WANT_READ && errnum != SSL_ERROR_WANT_WRITE && errnum != SSL_ERROR_NONE); DEBUG ("%s - result: %d; error: %ld", method, result, errnum); DEBUG ("%s : %s", method, errstr); } /* buffered write data means we need to write */ want_write = BIO_pending (session->wbio) > 0; /* check to see if there's data waiting to go out: * * since writes to a BIO should always succeed, it is possible to * * have buffered write data after a successful return, but not * * possible to be waiting on a read, since SSL_connect should not * * return success if waiting for data to come in */ if (done) { session->job.handshake.done = TRUE; if (!want_write) { DEBUG ("Handshake completed"); errnum = session->job.handshake.state = SSL_ERROR_NONE; } else { DEBUG ("Handshake completed (IO incomplete)"); g_assert (errnum != SSL_ERROR_WANT_READ); errnum = SSL_ERROR_WANT_WRITE; } } else { DEBUG ("Handshake state: %ld", errnum); session->job.handshake.state = errnum; want_read = (errnum == SSL_ERROR_WANT_READ); } /* sif we want both a write (buffered data in the BIO) AND a read * * (SSL_ERROR_WANT_READ) then this will happen when the handshake_write * * invokes wocky_tls_session_write_ready which will in turn call * * wocky_tls_session_try_operation which will re-enter handshake * * and then proceed to fall back through to this block of code */ if (!fatal) { DEBUG ("want write: %d; want read: %d;", want_write, want_read); if (want_write) handshake_write (session); else if (want_read) handshake_read (session); else wocky_tls_session_try_operation (session, WOCKY_TLS_OP_HANDSHAKE); } else { DEBUG ("Handshake failed: [%d:%ld] %s", result, errnum, errstr); if (session->job.handshake.job.error != NULL) { g_error_free (session->job.handshake.job.error); session->job.handshake.job.error = NULL; } g_set_error (&(session->job.handshake.job.error), WOCKY_TLS_ERROR, result, "Handshake failed: %s", errstr); wocky_tls_session_try_operation (session, WOCKY_TLS_OP_HANDSHAKE); } return errnum; } static void ssl_fill (WockyTLSSession *session) { GInputStream *input = g_io_stream_get_input_stream (session->stream); gchar *rbuf = session->job.read.rbuf; gint prio = session->job.read.io_priority; GCancellable *cancel = session->job.read.cancellable; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); g_input_stream_read_async (input, rbuf, MAX_SSLV3_BLOCK_SIZE, prio, cancel, wocky_tls_session_read_ready, session); } static void ssl_flush (WockyTLSSession *session) { long wsize; gchar *wbuf; gint prio = session->job.read.io_priority; GOutputStream *output = g_io_stream_get_output_stream (session->stream); GCancellable *cancel = session->job.read.cancellable; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); wsize = BIO_get_mem_data (session->wbio, &wbuf); if (wsize > 0) g_output_stream_write_async (output, wbuf, wsize, prio, cancel, wocky_tls_session_write_ready, session); } /* FALSE indicates we should go round again and try to get more data */ static gboolean ssl_read_is_complete (WockyTLSSession *session, gint result) { /* if the job error is set, we should bail out now, we have failed * * otherwise: * * a -ve return with an SSL error of WANT_READ implies an incomplete * * crypto record: we need to go round again and get more data * * or: * * a 0 return means the SSL connection was shut down cleanly */ if ((session->job.read.error == NULL) && (result <= 0)) { int err = SSL_get_error (session->ssl, result); switch (err) { case SSL_ERROR_WANT_READ: DEBUG ("Incomplete SSL record, read again"); return FALSE; case SSL_ERROR_WANT_WRITE: g_warning ("read caused write: unsupported TLS re-negotiation?"); /* deliberately falling through to the default case, having logged a * more specific warning. */ default: g_set_error (&session->job.read.error, WOCKY_TLS_ERROR, err, "OpenSSL read: protocol error %d", err); } } return TRUE; } static void wocky_tls_session_try_operation (WockyTLSSession *session, WockyTLSOperation operation) { WockyTLSJob *handshake = &(session->job.handshake.job); if (handshake->active || operation == WOCKY_TLS_OP_HANDSHAKE) { gint result = session->job.handshake.state; DEBUG ("async job handshake"); if (tls_debug_level >= DEBUG_HANDSHAKE_LEVEL) DEBUG ("async job handshake: %d", result); switch (result) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: DEBUG ("Handshake incomplete..."); ssl_handshake (session); break; case SSL_ERROR_NONE: DEBUG ("Handshake complete (success): %d", result); wocky_tls_job_result_boolean (handshake, result); break; default: DEBUG ("Handshake complete (failure): %d", result); if (handshake->error == NULL) handshake->error = g_error_new (WOCKY_TLS_ERROR, result, "Handshake Error"); wocky_tls_job_result_boolean (handshake, result); } } else if (operation == WOCKY_TLS_OP_READ) { gssize result = 0; gulong pending = 0; gsize wanted = 0; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG ("async job OP_READ"); /* cipherbytes in the BIO != clearbytes after SSL_read */ wanted = session->job.read.count; pending = (gulong)BIO_pending (session->rbio); result = SSL_read (session->ssl, session->job.read.buffer, wanted); DEBUG ("read %" G_GSSIZE_FORMAT " clearbytes (from %ld cipherbytes)", result, pending); if (ssl_read_is_complete (session, result)) wocky_tls_job_result_gssize (&session->job.read, result); else ssl_fill (session); } else { /* we have no useful way of mapping SSL cipherbytes to raw * * clearbytes: it should always be a complete write unless * * there's been a network error, in which case the utility * * of a byte count is debatable anyway */ gssize result = session->job.write.count; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG ("async job OP_WRITE"); g_assert (operation == WOCKY_TLS_OP_WRITE); DEBUG ("wrote %" G_GSSIZE_FORMAT " clearbytes", result); wocky_tls_job_result_gssize (&session->job.write, result); } } static void wocky_tls_job_start (WockyTLSJob *job, gpointer source_object, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data, gpointer source_tag) { g_assert (job->active == FALSE); g_assert (job->cancellable == NULL); /* this is always a circular reference, so it will keep the * session alive for as long as the job is running. */ job->source_object = g_object_ref (source_object); job->io_priority = io_priority; if (cancellable != NULL) job->cancellable = g_object_ref (cancellable); job->callback = callback; job->user_data = user_data; job->source_tag = source_tag; job->error = NULL; job->active = TRUE; } typedef gint (*ssl_handler) (SSL *ssl); WockyTLSConnection * wocky_tls_session_handshake (WockyTLSSession *session, GCancellable *cancellable, GError **error) { gint result = -1; gboolean go = TRUE; gboolean done = FALSE; ssl_handler handler = session->server ? SSL_accept : SSL_connect; gboolean want_write = FALSE; gboolean want_read = FALSE; gint errnum = SSL_ERROR_NONE; const gchar *errstr = NULL; while (go) { DEBUG ("sync SSL handshake loop"); if (!done) { result = handler (session->ssl); errnum = SSL_get_error (session->ssl, result); done = (result == 1); DEBUG ("SSL_%s: %d:%d", (handler == SSL_accept) ? "accept" : "connect", result, errnum); if (errnum != SSL_ERROR_NONE && errnum != SSL_ERROR_WANT_READ && errnum != SSL_ERROR_WANT_WRITE) { errstr = error_to_string (errnum); DEBUG ("SSL handshake error: [%d:%d] %s", result, errnum, errstr); } } want_write = BIO_pending (session->wbio) > 0; want_read = (errnum == SSL_ERROR_WANT_READ); if (want_write) { gchar *wbuf; GOutputStream *out = g_io_stream_get_output_stream (session->stream); long wsize = BIO_get_mem_data (session->wbio, &wbuf); gssize sent = 0; DEBUG ("sending %ld cipherbytes", wsize); if (wsize > 0) sent = g_output_stream_write (out, wbuf, wsize, NULL, error); DEBUG ("sent %" G_GSSIZE_FORMAT " cipherbytes", sent); (void) BIO_reset (session->wbio); } if (want_read) { char rbuf[MAX_SSLV3_BLOCK_SIZE]; GInputStream *in = g_io_stream_get_input_stream (session->stream); gssize bytes = g_input_stream_read (in, &rbuf, sizeof(rbuf), NULL, error); DEBUG ("read %" G_GSSIZE_FORMAT " cipherbytes", bytes); BIO_write (session->rbio, &rbuf, bytes); } switch (errnum) { case SSL_ERROR_WANT_WRITE: /* WANT_WRITE is theoretically impossible, but what the hell */ case SSL_ERROR_WANT_READ: break; case SSL_ERROR_NONE: DEBUG ("handshake complete, all IO done"); go = FALSE; break; default: DEBUG ("SSL handshake error: [%d:%d] %s", result, errnum, errstr); *error = g_error_new (WOCKY_TLS_ERROR, errnum, "Handshake: %s", errstr); go = FALSE; } } if (done) return g_object_new (WOCKY_TYPE_TLS_CONNECTION, "session", session, NULL); return NULL; } /* ************************************************************************* */ /* adding CA certificates and CRL lists for peer certificate verification */ static void add_ca_or_crl (WockyTLSSession *session, const gchar *path, const gchar *label) { gboolean ok = FALSE; if (!g_file_test (path, G_FILE_TEST_EXISTS)) { DEBUG ("%s file or path '%s' not accessible", label, path); return; } if (g_file_test (path, G_FILE_TEST_IS_DIR)) { DEBUG ("Loading %s directory", label); ok = SSL_CTX_load_verify_locations (session->ctx, NULL, path); } if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) { DEBUG ("Loading %s file", label); ok = SSL_CTX_load_verify_locations (session->ctx, path, NULL); } if (!ok) { gulong e, f; for (f = e = ERR_get_error (); e != 0; e = ERR_get_error ()) f = e; DEBUG ("%s '%s' failed: %s", label, path, ERR_error_string (f, NULL)); } else DEBUG ("%s '%s' loaded", label, path); } void wocky_tls_session_add_ca (WockyTLSSession *session, const gchar *path) { add_ca_or_crl (session, path, "CA"); } void wocky_tls_session_add_crl (WockyTLSSession *session, const gchar *path) { add_ca_or_crl (session, path, "CRL"); } /* ************************************************************************* */ void wocky_tls_session_handshake_async (WockyTLSSession *session, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { DEBUG (""); wocky_tls_job_start (&session->job.handshake.job, session, io_priority, cancellable, callback, user_data, wocky_tls_session_handshake_async); ssl_handshake (session); } WockyTLSConnection * wocky_tls_session_handshake_finish (WockyTLSSession *session, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); DEBUG (""); { GObject *source_object; source_object = g_async_result_get_source_object (result); g_object_unref (source_object); g_return_val_if_fail (G_OBJECT (session) == source_object, NULL); } g_return_val_if_fail (wocky_tls_session_handshake_async == g_simple_async_result_get_source_tag (simple), NULL); if (g_simple_async_result_propagate_error (simple, error)) return NULL; DEBUG ("connection OK"); return g_object_new (WOCKY_TYPE_TLS_CONNECTION, "session", session, NULL); } #define CASELESS_CHARCMP(x, y) \ ((x) != '\0') && ((y) != '\0') && (toupper (x) == toupper (y)) static gboolean compare_wildcarded_hostname (const char *hostname, const char *certname) { DEBUG ("%s ~ %s", hostname, certname); /* first diff character */ for (; CASELESS_CHARCMP (*certname, *hostname); certname++, hostname++); /* at end of both strings: simple equality condition met, no wildcard check */ if (strlen (certname) == 0 && strlen (hostname) == 0) return TRUE; if (*certname == '*') /* wildcarded certificate */ { certname++; while (1) { /* stop at each further char into the hostname and see if it * * matches the remainder of the (possibly further wildcarded) * * certificate (eg *.*.cam.ac.uk) */ if (compare_wildcarded_hostname (hostname, certname)) return TRUE; /* came to the end of the hostname or encountered a '.' in * * in the middle of the wildcarded region, which is not allowed */ if (*hostname == '\0' || *hostname == '.') break; hostname++; } } return FALSE; } static gboolean check_peer_name (const char *target, X509 *cert) { int i; gboolean rval = FALSE; X509_NAME *subject = X509_get_subject_name (cert); X509_CINF *ci = cert->cert_info; static const long nid[] = { NID_commonName, NID_subject_alt_name, NID_undef }; /* first, see if the x509 name contains the info we want: */ for (i = 0; nid[i] != NID_undef; i++) { gssize len = X509_NAME_get_text_by_NID (subject, nid[i], NULL, -1); if (len > 0) { char *cname = g_new0 (gchar, len + 1); X509_NAME_get_text_by_NID (subject, nid[i], cname, len + 1); DEBUG ("got cname '%s' from x509 name, nid #%u", cname, i); rval = compare_wildcarded_hostname (target, cname); g_free (cname); } } /* ok, if that failed, we need to dive into the guts of the x509 structure * * and extract the subject_alt_name from the x509 v3 extensions: if that * * extension is present, and a string, use that. If it is present, and * * a multi-value stack, trawl it for the "DNS" entry and use that */ if (!rval && (ci->extensions != NULL)) for (i = 0; i < sk_X509_EXTENSION_num(ci->extensions) && !rval; i++) { X509_EXTENSION *ext = sk_X509_EXTENSION_value (ci->extensions, i); ASN1_OBJECT *obj = X509_EXTENSION_get_object (ext); X509V3_EXT_METHOD *convert = NULL; long ni = OBJ_obj2nid (obj); const guchar *p; char *value = NULL; int len = ext->value->length; void *ext_str = NULL; if (ni != NID_subject_alt_name) continue; /* OpenSSL >= 1.0 returns a const here, but we need to be also * * compatible with older versions that return a non-const value, * * hence the cast */ if ((convert = (X509V3_EXT_METHOD *) X509V3_EXT_get (ext)) == NULL) continue; p = ext->value->data; ext_str = ((convert->it != NULL) ? ASN1_item_d2i (NULL, &p, len, ASN1_ITEM_ptr(convert->it)) : convert->d2i (NULL, &p, len) ); if (ext_str == NULL) continue; if (convert->i2s != NULL) { value = convert->i2s (convert, ext_str); DEBUG ("got cname '%s' from subject_alt_name, which is a string", value); rval = compare_wildcarded_hostname (target, value); OPENSSL_free (value); } else if (convert->i2v != NULL) { int j; STACK_OF(CONF_VALUE) *nval = convert->i2v(convert, ext_str, NULL); for (j = 0; j < sk_CONF_VALUE_num (nval); j++) { CONF_VALUE *v = sk_CONF_VALUE_value(nval, j); if (!wocky_strdiff (v->name, "DNS")) { DEBUG ("Got cname '%s' from subject_alt_name, which is a " "multi-value stack with a 'DNS' entry", v->value); rval = compare_wildcarded_hostname (target, v->value); } } sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); } if (convert->it) ASN1_item_free (ext_str, ASN1_ITEM_ptr (convert->it)); else convert->ext_free (ext_str); } return rval; } static gboolean check_peer_names (const char *peer_name, GStrv extra_identities, X509 *cert) { gboolean tried = FALSE; if (peer_name != NULL) { if (check_peer_name (peer_name, cert)) return TRUE; tried = TRUE; } if (extra_identities != NULL) { gint i; for (i = 0; extra_identities[i] != NULL; i++) { if (wocky_strdiff (extra_identities[i], peer_name)) { if (check_peer_name (extra_identities[i], cert)) return TRUE; tried = TRUE; } } } /* If no peer names were passed it means we didn't want to check the * certificate against anything. * If some attempts were made then it means the check failed. */ return !tried; } GPtrArray * wocky_tls_session_get_peers_certificate (WockyTLSSession *session, WockyTLSCertType *type) { STACK_OF(X509) *cert_chain = NULL; guint cls = 0; GPtrArray *certificates; certificates = g_ptr_array_new_with_free_func ((GDestroyNotify) g_array_unref); cert_chain = SSL_get_peer_cert_chain (session->ssl); if (cert_chain == NULL) return NULL; if (type != NULL) *type = WOCKY_TLS_CERT_TYPE_X509; cls = sk_X509_num (cert_chain); for (guint i = 0; i < cls; i++) { GArray *certificate; X509 *peer; gint peer_len; guchar *peer_buffer; peer = sk_X509_value (cert_chain, i); peer_len = i2d_X509 (peer, NULL); certificate = g_array_sized_new (TRUE, TRUE, sizeof (guchar), peer_len); peer_buffer = g_malloc (peer_len); i2d_X509 (peer, &peer_buffer); peer_buffer -= peer_len; g_array_append_vals (certificate, peer_buffer, peer_len); g_ptr_array_add (certificates, certificate); g_free (peer_buffer); } return certificates; } int wocky_tls_session_verify_peer (WockyTLSSession *session, const gchar *peername, GStrv extra_identities, WockyTLSVerificationLevel level, WockyTLSCertStatus *status) { int rval = -1; X509 *cert; gboolean lenient = (level == WOCKY_TLS_VERIFY_LENIENT); DEBUG (""); g_assert (status != NULL); *status = WOCKY_TLS_CERT_OK; switch (level) { case WOCKY_TLS_VERIFY_STRICT: case WOCKY_TLS_VERIFY_NORMAL: case WOCKY_TLS_VERIFY_LENIENT: break; default: g_warn_if_reached (); level = WOCKY_TLS_VERIFY_STRICT; } DEBUG ("setting ssl verify flags level to: %s", wocky_enum_to_nick (WOCKY_TYPE_TLS_VERIFICATION_LEVEL, level)); cert = SSL_get_peer_certificate (session->ssl); rval = SSL_get_verify_result (session->ssl); DEBUG ("X509 cert: %p; verified: %d", cert, rval); /* If no certificate is presented, SSL_get_verify_result() always returns * X509_V_OK. This is listed as a bug in `man 3 SSL_get_verify_result`. To * future-proof against that bug being fixed, we don't assume that behaviour. */ if (cert == NULL) { if (lenient) { *status = WOCKY_TLS_CERT_OK; return X509_V_OK; } else if (rval == X509_V_OK) { DEBUG ("Anonymous SSL handshake"); rval = X509_V_ERR_CERT_UNTRUSTED; } } else if (!check_peer_names (peername, extra_identities, cert)) { /* Irrespective of whether the certificate is valid, if it's for the * wrong host that's arguably a more useful error condition to report. */ *status = WOCKY_TLS_CERT_NAME_MISMATCH; return X509_V_ERR_APPLICATION_VERIFICATION; } if (rval != X509_V_OK) { DEBUG ("cert verification error: %d", rval); switch (rval) { case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: case X509_V_ERR_SUBJECT_ISSUER_MISMATCH: *status = WOCKY_TLS_CERT_SIGNER_UNKNOWN; break; case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: case X509_V_ERR_CERT_SIGNATURE_FAILURE: case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: case X509_V_ERR_INVALID_PURPOSE: case X509_V_ERR_CERT_REJECTED: case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: *status = WOCKY_TLS_CERT_INVALID; break; case X509_V_ERR_CERT_REVOKED: *status = WOCKY_TLS_CERT_REVOKED; break; case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: case X509_V_ERR_CERT_NOT_YET_VALID: *status = WOCKY_TLS_CERT_NOT_ACTIVE; break; case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: case X509_V_ERR_CERT_HAS_EXPIRED: *status = WOCKY_TLS_CERT_EXPIRED; break; case X509_V_ERR_OUT_OF_MEM: *status = WOCKY_TLS_CERT_INTERNAL_ERROR; break; case X509_V_ERR_INVALID_CA: case X509_V_ERR_CERT_UNTRUSTED: case X509_V_ERR_AKID_SKID_MISMATCH: case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: case X509_V_ERR_KEYUSAGE_NO_CERTSIGN: *status = WOCKY_TLS_CERT_SIGNER_UNAUTHORISED; break; case X509_V_ERR_PATH_LENGTH_EXCEEDED: *status = WOCKY_TLS_CERT_MAYBE_DOS; break; case X509_V_ERR_UNABLE_TO_GET_CRL: /* if we are in STRICT mode, being unable to see the CRL is a * * terminal condition: in NORMAL or LENIENT we can live with it */ if (level == WOCKY_TLS_VERIFY_STRICT) *status = WOCKY_TLS_CERT_INSECURE; else DEBUG ("ignoring UNABLE_TO_GET_CRL: we're not in strict mode"); break; default: *status = WOCKY_TLS_CERT_UNKNOWN_ERROR; } /* some conditions are to be ignored when lenient, others still matter */ if (lenient) switch (*status) { case WOCKY_TLS_CERT_INTERNAL_ERROR: case WOCKY_TLS_CERT_REVOKED: case WOCKY_TLS_CERT_MAYBE_DOS: DEBUG ("this error matters, even though we're in lenient mode"); break; default: DEBUG ("ignoring errors: we're in lenient mode"); rval = X509_V_OK; *status = WOCKY_TLS_CERT_OK; } } return rval; } static gssize wocky_tls_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { /* WockyTLSSession *session = WOCKY_TLS_INPUT_STREAM (stream)->session; */ DEBUG ("sync read - not implmented"); g_assert_not_reached (); return 0; } static void wocky_tls_input_stream_read_async (GInputStream *stream, void *buffer, gsize count, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_INPUT_STREAM (stream)->session; int ret; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); g_assert (session->job.read.active == FALSE); /* It is possible for a complete SSL record to be present in the read BIO * * already as a result of a previous read, since SSL_read may extract * * just the first complete record, or some or all of them: * * as a result, we may not want to issue an actual read request as the * * data we are expecting may already have been read, causing us to wait * * until the next block of data arrives over the network (which may not * * ever happen): short-circuit the actual read if this is the case: */ ret = SSL_read (session->ssl, buffer, count); if (ssl_read_is_complete (session, ret)) { GSimpleAsyncResult *r; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG ("already have %d clearbytes buffered", ret); r = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_tls_input_stream_read_async); if (session->job.read.error == NULL) g_simple_async_result_set_op_res_gssize (r, ret); else g_simple_async_result_set_from_error (r, session->job.read.error); g_simple_async_result_complete_in_idle (r); g_object_unref (r); return; } wocky_tls_job_start (&session->job.read, stream, io_priority, cancellable, callback, user_data, wocky_tls_input_stream_read_async); session->job.read.buffer = buffer; session->job.read.count = count; ssl_fill (session); } static gssize wocky_tls_input_stream_read_finish (GInputStream *stream, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (stream), wocky_tls_input_stream_read_async), -1); if (g_simple_async_result_propagate_error (simple, error)) return -1; return g_simple_async_result_get_op_res_gssize (simple); } static gssize wocky_tls_output_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error) { /* WockyTLSSession *session = WOCKY_TLS_OUTPUT_STREAM (stream)->session; */ DEBUG ("sync write - not implemented"); g_assert_not_reached (); return 0; } static void wocky_tls_output_stream_write_async (GOutputStream *stream, const void *buffer, gsize count, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { int code; WockyTLSSession *session = WOCKY_TLS_OUTPUT_STREAM (stream)->session; DEBUG ("%" G_GSIZE_FORMAT " clearbytes to send", count); wocky_tls_job_start (&session->job.write, stream, io_priority, cancellable, callback, user_data, wocky_tls_output_stream_write_async); session->job.write.count = count; code = SSL_write (session->ssl, buffer, count); if (code < 0) { int error = SSL_get_error (session->ssl, code); switch (error) { case SSL_ERROR_WANT_WRITE: DEBUG ("Incomplete SSL write to BIO (theoretically impossible)"); ssl_flush (session); return; case SSL_ERROR_WANT_READ: g_warning ("write caused read: unsupported TLS re-negotiation?"); /* deliberately falling through to the default case, having logged a * more specific warning. */ default: DEBUG ("SSL write failed, setting error %d", error); /* if we haven't already generated an error, set one here: */ if(session->job.write.error == NULL) session->job.write.error = g_error_new (WOCKY_TLS_ERROR, error, "OpenSSL write: protocol error %d", error); wocky_tls_session_try_operation (session, WOCKY_TLS_OP_WRITE); return; } } ssl_flush (session); } static gssize wocky_tls_output_stream_write_finish (GOutputStream *stream, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); { GObject *source_object; source_object = g_async_result_get_source_object (result); g_object_unref (source_object); g_return_val_if_fail (G_OBJECT (stream) == source_object, -1); } g_return_val_if_fail (wocky_tls_output_stream_write_async == g_simple_async_result_get_source_tag (simple), -1); if (g_simple_async_result_propagate_error (simple, error)) return -1; return g_simple_async_result_get_op_res_gssize (simple); } static void wocky_tls_output_stream_init (WockyTLSOutputStream *stream) { } static void wocky_tls_input_stream_init (WockyTLSInputStream *stream) { } static void wocky_tls_output_stream_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSOutputStream *stream = WOCKY_TLS_OUTPUT_STREAM (object); switch (prop_id) { case PROP_C_SESSION: stream->session = g_value_dup_object (value); break; default: g_assert_not_reached (); } } static void wocky_tls_output_stream_constructed (GObject *object) { WockyTLSOutputStream *stream = WOCKY_TLS_OUTPUT_STREAM (object); g_assert (stream->session); } static void wocky_tls_output_stream_finalize (GObject *object) { WockyTLSOutputStream *stream = WOCKY_TLS_OUTPUT_STREAM (object); g_object_unref (stream->session); G_OBJECT_CLASS (wocky_tls_output_stream_parent_class) ->finalize (object); } static void wocky_tls_output_stream_class_init (GOutputStreamClass *class) { GObjectClass *obj_class = G_OBJECT_CLASS (class); class->write_fn = wocky_tls_output_stream_write; class->write_async = wocky_tls_output_stream_write_async; class->write_finish = wocky_tls_output_stream_write_finish; obj_class->set_property = wocky_tls_output_stream_set_property; obj_class->constructed = wocky_tls_output_stream_constructed; obj_class->finalize = wocky_tls_output_stream_finalize; g_object_class_install_property (obj_class, PROP_O_SESSION, g_param_spec_object ("session", "TLS session", "the TLS session object for this stream", WOCKY_TYPE_TLS_SESSION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void wocky_tls_input_stream_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSInputStream *stream = WOCKY_TLS_INPUT_STREAM (object); switch (prop_id) { case PROP_C_SESSION: stream->session = g_value_dup_object (value); break; default: g_assert_not_reached (); } } static void wocky_tls_input_stream_constructed (GObject *object) { WockyTLSInputStream *stream = WOCKY_TLS_INPUT_STREAM (object); g_assert (stream->session); } static void wocky_tls_input_stream_finalize (GObject *object) { WockyTLSInputStream *stream = WOCKY_TLS_INPUT_STREAM (object); g_object_unref (stream->session); G_OBJECT_CLASS (wocky_tls_input_stream_parent_class) ->finalize (object); } static void wocky_tls_input_stream_class_init (GInputStreamClass *class) { GObjectClass *obj_class = G_OBJECT_CLASS (class); class->read_fn = wocky_tls_input_stream_read; class->read_async = wocky_tls_input_stream_read_async; class->read_finish = wocky_tls_input_stream_read_finish; obj_class->set_property = wocky_tls_input_stream_set_property; obj_class->constructed = wocky_tls_input_stream_constructed; obj_class->finalize = wocky_tls_input_stream_finalize; g_object_class_install_property (obj_class, PROP_I_SESSION, g_param_spec_object ("session", "TLS session", "the TLS session object for this stream", WOCKY_TYPE_TLS_SESSION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void wocky_tls_connection_init (WockyTLSConnection *connection) { } static void wocky_tls_session_read_ready (GObject *object, GAsyncResult *result, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_SESSION (user_data); GInputStream *input = G_INPUT_STREAM (object); GError **error = &(session->job.read.error); gssize rsize = 0; gchar *buf = session->job.handshake.job.active ? session->job.handshake.job.rbuf : session->job.read.rbuf; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); rsize = g_input_stream_read_finish (input, result, error); if (rsize > 0) { int x; int y; DEBUG ("received %" G_GSSIZE_FORMAT " cipherbytes, filling SSL BIO", rsize); BIO_write (session->rbio, buf, rsize); if (tls_debug_level > DEBUG_ASYNC_DETAIL_LEVEL + 1) for (x = 0; x < rsize; x += 16) { for (y = 0; y < 16 && x + y < rsize; y++) { char c = *(buf + x + y); char d = (g_ascii_isprint (c) && g_ascii_isgraph (c)) ? c : '.'; fprintf (stderr, "%02x %c ", c & 0xff, d); } fprintf (stderr, "\n"); } } /* note that we never issue a read of 0, so this _must_ be EOF (0) * * or a fatal error (-ve rval) */ else if (session->job.handshake.job.active) { if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG("read SSL cipherbytes (handshake) failed: %" G_GSSIZE_FORMAT, rsize); session->job.handshake.state = SSL_ERROR_SSL; } else { DEBUG ("read of SSL cipherbytes failed: %" G_GSSIZE_FORMAT, rsize); if ((*error != NULL) && ((*error)->domain == g_io_error_quark ())) { /* if there were any errors we could ignore, we'd do it like this: * * g_error_free (*error); *error = NULL; */ DEBUG ("failed op: [%d] %s", (*error)->code, (*error)->message); } /* in order for non-handshake reads to return an error properly * * we need to make sure the error in the job is set */ else if (*error == NULL) { *error = g_error_new (WOCKY_TLS_ERROR, SSL_ERROR_SSL, "unknown error"); } } wocky_tls_session_try_operation (session, WOCKY_TLS_OP_READ); } static void wocky_tls_session_write_ready (GObject *object, GAsyncResult *result, gpointer user_data) { WockyTLSSession *session = WOCKY_TLS_SESSION (user_data); gint buffered = BIO_pending (session->wbio); gssize written; if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG (""); written = g_output_stream_write_finish (G_OUTPUT_STREAM (object), result, &(session->job.write.error)); if (written == buffered) { DEBUG ("%d bytes written, clearing write BIO", buffered); (void) BIO_reset (session->wbio); wocky_tls_session_try_operation (session, WOCKY_TLS_OP_WRITE); } else { gchar *buffer; long bsize = BIO_get_mem_data (session->wbio, &buffer); long psize = bsize - written; /* scrub the data we did manage to write from our buffer */ if (written > 0) { gchar *pending = g_memdup (buffer + written, psize); (void) BIO_reset (session->wbio); (void) BIO_write (session->wbio, pending, psize); g_free (pending); } if (session->job.write.error != NULL) { if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) DEBUG ("Incomplete async write [%" G_GSSIZE_FORMAT "/%d bytes]: " "%s:%u %s", written, buffered, g_quark_to_string (session->job.write.error->domain), session->job.write.error->code, session->job.write.error->message); /* if we have a non-fatal error, erase it try again */ if (g_error_matches (session->job.write.error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) g_clear_error (&(session->job.write.error)); } /* no error here means retry the operation; otherwise bail out */ if (session->job.write.error == NULL) ssl_flush (session); else wocky_tls_session_try_operation (session, WOCKY_TLS_OP_WRITE); } } static void wocky_tls_session_init (WockyTLSSession *session) { const char *level; guint lvl = 0; static gsize initialised; if G_UNLIKELY (g_once_init_enter (&initialised)) { gint malloc_init_succeeded; DEBUG ("initialising SSL library and error strings"); malloc_init_succeeded = CRYPTO_malloc_init (); g_warn_if_fail (malloc_init_succeeded); SSL_library_init (); SSL_load_error_strings (); OpenSSL_add_all_algorithms(); ENGINE_load_builtin_engines (); g_once_init_leave (&initialised, 1); } if ((level = getenv ("WOCKY_TLS_DEBUG_LEVEL")) != NULL) lvl = atoi (level); tls_debug_level = lvl; } static void wocky_tls_session_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); switch (prop_id) { case PROP_S_STREAM: session->stream = g_value_dup_object (value); break; case PROP_S_SERVER: session->server = g_value_get_boolean (value); break; case PROP_S_DHBITS: session->dh_bits = g_value_get_uint (value); break; case PROP_S_KEYFILE: session->key_file = g_value_dup_string (value); break; case PROP_S_CERTFILE: session->cert_file = g_value_dup_string (value); break; default: g_assert_not_reached (); } } static void set_dh_parameters (WockyTLSSession *session) { DH *dh; switch (session->dh_bits) { case 4096: DEBUG ("get_dh4096"); dh = get_dh4096 (); break; case 2048: DEBUG ("get_dh2048"); dh = get_dh2048 (); break; case 1024: DEBUG ("get_dh1024"); dh = get_dh1024 (); break; case 512: DEBUG ("get_dh512"); dh = get_dh512 (); break; default: DEBUG ("Bad dh-bits setting: %d, reset to 1024", session->dh_bits); dh = get_dh1024 (); } SSL_CTX_set_tmp_dh (session->ctx, dh); DH_free (dh); } static void set_ecdh_key (WockyTLSSession *session) { EC_KEY *ecdh = EC_KEY_new_by_curve_name (NID_sect163r2); if (ecdh == NULL) { DEBUG ("unable to create elliptical crypto key for sect163r2 curve"); return; } SSL_CTX_set_tmp_ecdh (session->ctx,ecdh); EC_KEY_free (ecdh); } static void wocky_tls_session_constructed (GObject *object) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); if (session->server) { DEBUG ("I'm a server; using TLSv1_server_method"); /* OpenSSL >= 1.0 returns a const here, but we need to be also * * compatible with older versions that return a non-const value, * * hence the cast */ session->method = (SSL_METHOD *) TLSv1_server_method (); } else { DEBUG ("I'm a client; using TLSv1_client_method"); session->method = (SSL_METHOD *) TLSv1_client_method (); } session->ctx = SSL_CTX_new (session->method); if (!SSL_CTX_set_default_verify_paths (session->ctx)) g_warning ("SSL_CTX_set_default_verify_paths() failed"); /* verification will be done manually after the handshake: */ SSL_CTX_set_verify (session->ctx, SSL_VERIFY_NONE, NULL); SSL_CTX_set_options (session->ctx, SSL_OP_CIPHER_SERVER_PREFERENCE | /* It is usually safe to use SSL_OP_ALL to enable the bug workaround * options if compatibility with somewhat broken implementations is * desired. */ SSL_OP_ALL | /* Set the NO_TICKET option on the context to be kind to the Google Talk * server, which seems unwilling to handle empty session tickets due to a * bug in Java. * * See http://twistedmatrix.com/trac/ticket/3463 and * http://loudmouth.lighthouseapp.com/projects/17276/tickets/28. */ SSL_OP_NO_TICKET | /* SSLv2 is excessively quaint. We shouldn't be using it anyway, since * we're using TLSv1 methods, but... */ SSL_OP_NO_SSLv2); X509_STORE_set_flags (SSL_CTX_get_cert_store (session->ctx), X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); #ifdef CIPHER_LIST SSL_CTX_set_cipher_list (session->ctx, CIPHER_LIST); #endif if (session->server) { set_dh_parameters (session); set_ecdh_key (session); } if ((session->key_file != NULL) && (session->cert_file != NULL)) { long errnum; DEBUG ("cert: %s", session->cert_file); DEBUG ("key : %s", session->key_file); SSL_CTX_use_certificate_file (session->ctx, session->cert_file, SSL_FILETYPE_PEM); SSL_CTX_use_PrivateKey_file (session->ctx, session->key_file, SSL_FILETYPE_PEM); if (!SSL_CTX_check_private_key (session->ctx)) { errnum = ERR_get_error (); DEBUG ("cert/key check: %ld %s", errnum, error_to_string (errnum)); } else DEBUG ("certificate loaded"); } session->ssl = SSL_new (session->ctx); session->rbio = BIO_new (BIO_s_mem ()); session->wbio = BIO_new (BIO_s_mem ()); if (session->rbio == NULL) g_error ("Could not allocate memory BIO for SSL reads"); if (session->wbio == NULL) g_error ("Could not allocate memory BIO for SSL writes"); if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) { int x = 0; const char *c = SSL_get_cipher_list (session->ssl, x); for (; c != NULL; c = SSL_get_cipher_list (session->ssl, ++x)) DEBUG ("%03d: %s", x, c); } if (tls_debug_level >= DEBUG_ASYNC_DETAIL_LEVEL) { BIO_set_callback (session->rbio, BIO_debug_callback); BIO_set_callback (session->wbio, BIO_debug_callback); } BIO_set_mem_eof_return (session->rbio, -1); SSL_set_bio (session->ssl, session->rbio, session->wbio); DEBUG ("done"); } static void wocky_tls_session_finalize (GObject *object) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); /* the BIOs are freed by this call */ SSL_free (session->ssl); /* free (session->method); handled by SSL_CTX_free */ session->method = NULL; SSL_CTX_free (session->ctx); session->ctx = NULL; g_object_unref (session->stream); G_OBJECT_CLASS (wocky_tls_session_parent_class)->finalize (object); } static void wocky_tls_session_dispose (GObject *object) { WockyTLSSession *session = WOCKY_TLS_SESSION (object); g_free (session->key_file); session->key_file = NULL; g_free (session->cert_file); session->cert_file = NULL; G_OBJECT_CLASS (wocky_tls_session_parent_class)->dispose (object); } static void wocky_tls_session_class_init (GObjectClass *class) { class->set_property = wocky_tls_session_set_property; class->constructed = wocky_tls_session_constructed; class->finalize = wocky_tls_session_finalize; class->dispose = wocky_tls_session_dispose; g_object_class_install_property (class, PROP_S_STREAM, g_param_spec_object ("base-stream", "base stream", "the stream that TLS communicates over", G_TYPE_IO_STREAM, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_SERVER, g_param_spec_boolean ("server", "server", "whether this is a server", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_DHBITS, g_param_spec_uint ("dh-bits", "Diffie-Hellman bits", "Diffie-Hellmann bits: 512, 1024, 2048, or 4096", 512, 4096, 1024, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_KEYFILE, g_param_spec_string ("x509-key", "x509 key", "x509 PEM key file", NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (class, PROP_S_CERTFILE, g_param_spec_string ("x509-cert", "x509 certificate", "x509 PEM certificate file", NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void wocky_tls_connection_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (object); switch (prop_id) { case PROP_C_SESSION: connection->session = g_value_dup_object (value); break; default: g_assert_not_reached (); } } static gboolean wocky_tls_connection_close (GIOStream *stream, GCancellable *cancellable, GError **error) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (stream); return g_io_stream_close (connection->session->stream, cancellable, error); } static GInputStream * wocky_tls_connection_get_input_stream (GIOStream *io_stream) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (io_stream); if (connection->input == NULL) connection->input = g_object_new (WOCKY_TYPE_TLS_INPUT_STREAM, "session", connection->session, NULL); return (GInputStream *)connection->input; } static GOutputStream * wocky_tls_connection_get_output_stream (GIOStream *io_stream) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (io_stream); if (connection->output == NULL) connection->output = g_object_new (WOCKY_TYPE_TLS_OUTPUT_STREAM, "session", connection->session, NULL); return (GOutputStream *)connection->output; } static void wocky_tls_connection_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { default: g_assert_not_reached (); } } static void wocky_tls_connection_constructed (GObject *object) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (object); g_assert (connection->session); } static void wocky_tls_connection_finalize (GObject *object) { WockyTLSConnection *connection = WOCKY_TLS_CONNECTION (object); g_object_unref (connection->session); if (connection->input != NULL) g_object_unref (connection->input); if (connection->output != NULL) g_object_unref (connection->output); G_OBJECT_CLASS (wocky_tls_connection_parent_class) ->finalize (object); } static void wocky_tls_connection_class_init (WockyTLSConnectionClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); GIOStreamClass *stream_class = G_IO_STREAM_CLASS (class); gobject_class->get_property = wocky_tls_connection_get_property; gobject_class->set_property = wocky_tls_connection_set_property; gobject_class->constructed = wocky_tls_connection_constructed; gobject_class->finalize = wocky_tls_connection_finalize; g_object_class_install_property (gobject_class, PROP_C_SESSION, g_param_spec_object ("session", "TLS session", "the TLS session object for this connection", WOCKY_TYPE_TLS_SESSION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); stream_class->get_input_stream = wocky_tls_connection_get_input_stream; stream_class->get_output_stream = wocky_tls_connection_get_output_stream; stream_class->close_fn = wocky_tls_connection_close; } WockyTLSSession * wocky_tls_session_new (GIOStream *stream) { return g_object_new (WOCKY_TYPE_TLS_SESSION, "base-stream", stream, "server", FALSE, NULL); } /** * wocky_tls_session_server_new: * @stream: a GIOStream on which we expect to receive the client TLS handshake * @dhbits: size of the DH parameters * @key: the path to the X509 PEM key file * @cert: the path to the X509 PEM certificate * * Create a new TLS server session * * Returns: a #WockyTLSSession object */ WockyTLSSession * wocky_tls_session_server_new (GIOStream *stream, guint dhbits, const gchar* key, const gchar* cert) { if (dhbits == 0) dhbits = 1024; return g_object_new (WOCKY_TYPE_TLS_SESSION, "base-stream", stream, "dh-bits", dhbits, "x509-key", key, "x509-cert", cert, "server", TRUE, NULL); } /* this file is "borrowed" from an unmerged gnio feature: */ /* Local Variables: */ /* c-file-style: "gnu" */ /* End: */ telepathy-salut-0.8.1/lib/ext/wocky/wocky/wocky-data-form.c0000644000175000017500000007047512051446215023362 0ustar00wjtwjt00000000000000/* * wocky-data-form.c - WockyDataForm * Copyright © 2009–2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * 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 */ /** * SECTION: wocky-data-form * @title: WockyDataForm * @short_description: An object to represent an XMPP data form * @include: wocky/wocky-data-form.h * * An object that represents an XMPP data form as described in * XEP-0004. */ #include "wocky-data-form.h" #include #include "wocky-namespaces.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_DATA_FORM #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyDataForm, wocky_data_form, G_TYPE_OBJECT) /* properties */ enum { PROP_TITLE = 1, PROP_INSTRUCTIONS, }; /* private structure */ struct _WockyDataFormPrivate { gchar *title; gchar *instructions; /* (gchar *) => owned (WockyDataFormField *) */ GHashTable *reported; gboolean dispose_has_run; }; GQuark wocky_data_form_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-data-form-error"); return quark; } static WockyDataFormFieldOption * wocky_data_form_field_option_new (const gchar *label, const gchar *value) { WockyDataFormFieldOption *option; g_assert (value != NULL); option = g_slice_new0 (WockyDataFormFieldOption); option->label = g_strdup (label); option->value = g_strdup (value); return option; } static void wocky_data_form_field_option_free (WockyDataFormFieldOption *option) { g_free (option->label); g_free (option->value); g_slice_free (WockyDataFormFieldOption, option); } /* pass ownership of the default_value, raw_value_contents, the value * and the options list */ static WockyDataFormField * wocky_data_form_field_new ( WockyDataFormFieldType type, const gchar *var, const gchar *label, const gchar *desc, gboolean required, GValue *default_value, gchar **raw_value_contents, GValue *value, GSList *options) { WockyDataFormField *field; field = g_slice_new0 (WockyDataFormField); field->type = type; field->var = g_strdup (var); field->label = g_strdup (label); field->desc = g_strdup (desc); field->required = required; field->default_value = default_value; field->raw_value_contents = raw_value_contents; field->value = value; field->options = options; return field; } static void wocky_data_form_field_free (WockyDataFormField *field) { if (field == NULL) return; g_free (field->var); g_free (field->label); g_free (field->desc); g_strfreev (field->raw_value_contents); if (field->default_value != NULL) wocky_g_value_slice_free (field->default_value); if (field->value != NULL) wocky_g_value_slice_free (field->value); g_slist_foreach (field->options, (GFunc) wocky_data_form_field_option_free, NULL); g_slist_free (field->options); g_slice_free (WockyDataFormField, field); } static void wocky_data_form_init (WockyDataForm *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_DATA_FORM, WockyDataFormPrivate); self->fields = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); self->fields_list = NULL; self->priv->reported = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) wocky_data_form_field_free); self->results = NULL; } static void wocky_data_form_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; switch (property_id) { case PROP_TITLE: priv->title = g_value_dup_string (value); break; case PROP_INSTRUCTIONS: priv->instructions = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_data_form_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; switch (property_id) { case PROP_TITLE: g_value_set_string (value, priv->title); break; case PROP_INSTRUCTIONS: g_value_set_string (value, priv->instructions); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_data_form_dispose (GObject *object) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (G_OBJECT_CLASS (wocky_data_form_parent_class)->dispose) G_OBJECT_CLASS (wocky_data_form_parent_class)->dispose (object); } static void data_form_field_list_free (GSList *fields) { g_slist_foreach (fields, (GFunc) wocky_data_form_field_free, NULL); g_slist_free (fields); } static void wocky_data_form_finalize (GObject *object) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; g_free (priv->title); g_free (priv->instructions); g_hash_table_unref (self->fields); data_form_field_list_free (self->fields_list); g_slist_foreach (self->results, (GFunc) data_form_field_list_free, NULL); g_slist_free (self->results); g_hash_table_unref (priv->reported); G_OBJECT_CLASS (wocky_data_form_parent_class)->finalize (object); } static void wocky_data_form_class_init ( WockyDataFormClass *wocky_data_form_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_data_form_class); GParamSpec *param_spec; g_type_class_add_private (wocky_data_form_class, sizeof (WockyDataFormPrivate)); object_class->set_property = wocky_data_form_set_property; object_class->get_property = wocky_data_form_get_property; object_class->dispose = wocky_data_form_dispose; object_class->finalize = wocky_data_form_finalize; param_spec = g_param_spec_string ("title", "title", "Title", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TITLE, param_spec); param_spec = g_param_spec_string ("instructions", "instructions", "Instructions", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INSTRUCTIONS, param_spec); } static const gchar * type_to_str (WockyDataFormFieldType type) { return wocky_enum_to_nick (WOCKY_TYPE_DATA_FORM_FIELD_TYPE, type); } /* * extract_options_list: * @node: a node * * Returns: a list of (WockyDataFormFieldOption *) containing all the *