diff -Nru gfire-0.8.3/aclocal.m4 gfire-0.9.4/aclocal.m4 --- gfire-0.8.3/aclocal.m4 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/aclocal.m4 2011-03-23 19:57:00.000000000 +0000 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2007, 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. @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, +[m4_warning([this file was generated for autoconf 2.65. 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'.])]) @@ -115,7 +115,7 @@ int major, minor, micro; char *tmp_version; - system ("touch conf.glibtest"); + fclose (fopen ("conf.glibtest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); @@ -231,10 +231,638 @@ rm -f conf.glibtest ]) +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, + [AC_TRY_LINK([ +#include +], + [return !ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) + ]) + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return !dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv)], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + MSGFMT_OPTS= + AC_MSG_CHECKING([if msgfmt accepts -c]) + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + AC_SUBST(MSGFMT_OPTS) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.ac. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN([GLIB_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_ac,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl + +# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) +# +# Create a temporary file with TEST-FILE as its contents and pass the +# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with +# 0 and perform ACTION-IF-FAIL for any other exit status. +AC_DEFUN([GLIB_RUN_PROG], +[cat >conftest.foo <<_ACEOF +$2 +_ACEOF +if AC_RUN_LOG([$1 conftest.foo]); then + m4_ifval([$3], [$3], [:]) +m4_ifvaln([$4], [else $4])dnl +echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD +fi]) + + + +dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) +# serial 40 IT_PROG_INTLTOOL +AC_DEFUN([IT_PROG_INTLTOOL], [ +AC_PREREQ([2.50])dnl +AC_REQUIRE([AM_NLS])dnl + +case "$am__api_version" in + 1.[01234]) + AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) + ;; + *) + ;; +esac + +if test -n "$1"; then + AC_MSG_CHECKING([for intltool >= $1]) + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + ] + AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) +fi + +AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) +AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) +AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) +fi + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + +_IT_SUBST(INTLTOOL_DESKTOP_RULE) +_IT_SUBST(INTLTOOL_DIRECTORY_RULE) +_IT_SUBST(INTLTOOL_KEYS_RULE) +_IT_SUBST(INTLTOOL_PROP_RULE) +_IT_SUBST(INTLTOOL_OAF_RULE) +_IT_SUBST(INTLTOOL_PONG_RULE) +_IT_SUBST(INTLTOOL_SERVER_RULE) +_IT_SUBST(INTLTOOL_SHEET_RULE) +_IT_SUBST(INTLTOOL_SOUNDLIST_RULE) +_IT_SUBST(INTLTOOL_UI_RULE) +_IT_SUBST(INTLTOOL_XAM_RULE) +_IT_SUBST(INTLTOOL_KBD_RULE) +_IT_SUBST(INTLTOOL_XML_RULE) +_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) +_IT_SUBST(INTLTOOL_CAVES_RULE) +_IT_SUBST(INTLTOOL_SCHEMAS_RULE) +_IT_SUBST(INTLTOOL_THEME_RULE) +_IT_SUBST(INTLTOOL_SERVICE_RULE) +_IT_SUBST(INTLTOOL_POLICY_RULE) + +# Check the gettext tools to make sure they are GNU +AC_PATH_PROG(XGETTEXT, xgettext) +AC_PATH_PROG(MSGMERGE, msgmerge) +AC_PATH_PROG(MSGFMT, msgfmt) +AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) +fi + +AC_PATH_PROG(INTLTOOL_PERL, perl) +if test -z "$INTLTOOL_PERL"; then + AC_MSG_ERROR([perl not found]) +fi +AC_MSG_CHECKING([for perl >= 5.8.1]) +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + AC_MSG_ERROR([perl 5.8.1 is required for intltool]) +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + AC_MSG_RESULT([$IT_PERL_VERSION]) +fi +if test "x$2" != "xno-xml"; then + AC_MSG_CHECKING([for XML::Parser]) + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + AC_MSG_RESULT([ok]) + else + AC_MSG_ERROR([XML::Parser perl module is required for intltool]) + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile +AC_SUBST(ALL_LINGUAS) + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], + [[extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr]])], + [DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share + dnl in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [DATADIRNAME=share], [DATADIRNAME=lib]) + ;; + *) + [DATADIRNAME=lib] + ;; + esac]) +fi +AC_SUBST(DATADIRNAME) + +IT_PO_SUBDIR([po]) + +]) + + +# IT_PO_SUBDIR(DIRNAME) +# --------------------- +# All po subdirs have to be declared with this macro; the subdir "po" is +# declared by IT_PROG_INTLTOOL. +# +AC_DEFUN([IT_PO_SUBDIR], +[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. +dnl +dnl The following CONFIG_COMMANDS should be executed at the very end +dnl of config.status. +AC_CONFIG_COMMANDS_PRE([ + AC_CONFIG_COMMANDS([$1/stamp-it], [ + if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then + AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) + fi + rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" + >"$1/stamp-it.tmp" + [sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" + ] + [sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r $1/POTFILES + } + ' "$1/Makefile.in" >"$1/Makefile"] + rm -f "$1/Makefile.tmp" + mv "$1/stamp-it.tmp" "$1/stamp-it" + ]) +])dnl +]) + +# _IT_SUBST(VARIABLE) +# ------------------- +# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +# +AC_DEFUN([_IT_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) + +# deprecated macros +AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) +# A hint is needed for aclocal from Automake <= 1.9.4: +# AC_DEFUN([AC_PROG_INTLTOOL], ...) + + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -243,7 +871,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -270,7 +899,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -299,6 +928,7 @@ # ------------------ 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 @@ -315,6 +945,8 @@ 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]) @@ -351,7 +983,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -371,6 +1003,9 @@ 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([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -412,7 +1047,6 @@ _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -426,23 +1060,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# 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' - # Global variables: ofile=libtool can_build_shared=yes @@ -483,6 +1100,28 @@ ])# _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' @@ -607,12 +1246,12 @@ # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_quote(m4_if([$2], [], - m4_quote(lt_decl_tag_varnames), - m4_quote(m4_shift($@)))), - m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) -m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) +[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...]) @@ -635,7 +1274,7 @@ # 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 "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -645,7 +1284,7 @@ # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$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)])])]) @@ -744,12 +1383,20 @@ 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 "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -760,9 +1407,9 @@ # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -770,16 +1417,38 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _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 # --------- @@ -789,20 +1458,11 @@ AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -828,7 +1488,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -873,15 +1533,13 @@ # 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. -if test "$no_create" != yes; then - 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) -fi +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 @@ -1058,11 +1716,13 @@ 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 @@ -1167,15 +1827,40 @@ [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 -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; 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 + 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? + # 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' ;; @@ -1194,7 +1879,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1214,11 +1899,19 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + 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\"`' + 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" - if test "$GCC" = "yes"; then - output_verbose_link_cmd=echo + 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}" @@ -1264,170 +1957,65 @@ # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# 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], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[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 - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# 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 - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +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" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH @@ -1459,7 +2047,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + 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 @@ -1611,10 +2199,19 @@ esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$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 @@ -1639,15 +2236,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval 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:__oline__: \$? = $ac_status" >&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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $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 @@ -1687,7 +2284,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $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 @@ -1739,7 +2336,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw*) + 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, @@ -1750,6 +2347,11 @@ 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. @@ -1814,8 +2416,8 @@ # 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_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` @@ -1866,7 +2468,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1907,11 +2509,13 @@ # endif #endif -#ifdef __cplusplus -extern "C" void exit (int); +/* 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)) +void fnord () __attribute__((visibility("default"))); #endif -void fnord() { int i=42;} +void fnord () { int i=42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1920,13 +2524,17 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else puts (dlerror ()); - exit (status); + return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then @@ -1965,7 +2573,7 @@ lt_cv_dlopen_self=yes ;; - mingw* | pw32*) + mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; @@ -2096,16 +2704,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval 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:__oline__: \$? = $ac_status" >&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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $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 @@ -2262,7 +2870,9 @@ [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], [], [ @@ -2271,16 +2881,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + 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 -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + 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= @@ -2293,7 +2910,7 @@ 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 ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2313,7 +2930,13 @@ if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # 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]) @@ -2401,7 +3024,7 @@ 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=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + 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 ;; @@ -2426,14 +3049,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32*) +cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2454,23 +3077,12 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; - mingw*) + mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' @@ -2527,7 +3139,14 @@ *) objformat=elf ;; esac fi - version_type=freebsd-$objformat + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' @@ -2538,6 +3157,12 @@ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in @@ -2570,6 +3195,19 @@ hardcode_into_libs=yes ;; +haiku*) + version_type=linux + 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. @@ -2612,8 +3250,10 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # 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]]*) @@ -2671,7 +3311,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -2680,16 +3320,21 @@ 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 - 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], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + 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 @@ -2698,7 +3343,7 @@ # 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;/^$/d' | tr '\n' ' '` + 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 @@ -2711,18 +3356,6 @@ 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 @@ -2894,7 +3527,7 @@ version_type=linux need_lib_prefix=no need_version=no - library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + 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 @@ -2918,7 +3551,7 @@ 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 @@ -2943,6 +3576,8 @@ 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], @@ -3055,6 +3690,7 @@ 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], @@ -3184,8 +3820,8 @@ fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3195,6 +3831,7 @@ # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -3236,15 +3873,23 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # 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 ;; @@ -3269,6 +3914,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3277,11 +3926,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_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_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 @@ -3303,11 +3952,11 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) 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 @@ -3445,7 +4094,19 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + 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" @@ -3458,13 +4119,13 @@ 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:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (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:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&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:__oline__: output\"" >&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" @@ -3487,7 +4148,7 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3515,7 +4176,12 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + 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, @@ -3532,6 +4198,7 @@ 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 @@ -3556,7 +4223,7 @@ aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32*) +cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -3657,7 +4324,7 @@ 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 + 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" @@ -3802,7 +4469,7 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32*) + 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 @@ -3819,6 +4486,11 @@ # 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. @@ -3829,10 +4501,11 @@ fi ;; hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. + # 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*|ia64*) + hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' @@ -3923,19 +4596,26 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-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' ;; - icpc* | ecpc* ) - # Intel C++ + 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,' @@ -3949,8 +4629,8 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + 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' @@ -3980,7 +4660,7 @@ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4012,7 +4692,7 @@ ;; solaris*) case $cc_basename in - CC*) + 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' @@ -4101,7 +4781,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + 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 @@ -4116,11 +4796,18 @@ _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 IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. + # 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*|ia64*) + hppa*64*) # +Z the default ;; *) @@ -4157,6 +4844,13 @@ _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 ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -4170,7 +4864,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2*) + 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], [], @@ -4199,14 +4893,28 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in - icc* | ecc* | ifort*) + # 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' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + # 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' + ;; + 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,' @@ -4218,25 +4926,25 @@ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + 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\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # 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)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *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)='' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; @@ -4268,7 +4976,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4378,8 +5086,10 @@ 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")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _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 @@ -4387,12 +5097,9 @@ pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; - cygwin* | mingw*) + cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; - linux* | k*bsd*-gnu) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4442,7 +5149,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32*) + 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++. @@ -4460,7 +5167,33 @@ 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}' @@ -4478,6 +5211,7 @@ 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 ... @@ -4493,11 +5227,12 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** 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 @@ -4529,10 +5264,11 @@ fi ;; - cygwin* | mingw* | pw32*) + 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 @@ -4554,6 +5290,11 @@ 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 @@ -4569,7 +5310,7 @@ _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) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4583,11 +5324,12 @@ 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _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*) # 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + 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' ;; @@ -4595,13 +5337,20 @@ tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _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 @@ -4617,17 +5366,17 @@ fi case $cc_basename in - xlf*) + 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)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4636,7 +5385,7 @@ fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -4748,8 +5497,10 @@ 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")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _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 @@ -4811,7 +5562,6 @@ 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 @@ -4827,6 +5577,7 @@ 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 @@ -4838,7 +5589,7 @@ # empty executable. _LT_SYS_MODULE_PATH_AIX _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _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' @@ -4853,8 +5604,13 @@ # -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' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + 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' @@ -4881,7 +5637,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32*) + 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 @@ -4893,7 +5649,7 @@ # 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 `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + _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. @@ -4960,7 +5716,7 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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' @@ -4979,13 +5735,13 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + 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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -5000,7 +5756,14 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -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 @@ -5028,19 +5791,19 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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' ) LDFLAGS="$save_LDFLAGS" else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _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' @@ -5049,7 +5812,7 @@ _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) 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 @@ -5102,17 +5865,17 @@ _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(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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _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' @@ -5122,13 +5885,13 @@ 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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $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' @@ -5319,36 +6082,38 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - 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_TAGVAR(archive_cmds_need_lc, $1)=no - else - _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* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + 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 @@ -5514,37 +6279,21 @@ ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _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], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])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 @@ -5566,6 +6315,8 @@ _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 @@ -5668,7 +6419,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5766,6 +6517,7 @@ 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. @@ -5779,7 +6531,7 @@ _LT_SYS_MODULE_PATH_AIX _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _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' @@ -5794,8 +6546,13 @@ # -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' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + 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. @@ -5824,10 +6581,11 @@ esac ;; - cygwin* | mingw* | pw32*) + 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 @@ -5888,6 +6646,11 @@ gnu*) ;; + 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)=: @@ -5912,7 +6675,7 @@ # 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; $ECHO "X$list" | $Xsed' + 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 @@ -5977,7 +6740,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + 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 @@ -6020,7 +6783,7 @@ 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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _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 @@ -6031,9 +6794,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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 -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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 @@ -6044,7 +6807,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -6062,7 +6825,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + 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' @@ -6099,26 +6862,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *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 | $NL2SP`"' + 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 | $NL2SP`~ + $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $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 will use weak symbols + *) # 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' ;; @@ -6126,7 +6889,7 @@ _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _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++ @@ -6145,9 +6908,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + 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*) + 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' @@ -6167,13 +6930,13 @@ _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _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='echo' + 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 @@ -6242,7 +7005,7 @@ _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=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6277,15 +7040,15 @@ 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $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' ;; @@ -6301,17 +7064,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _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 -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6321,7 +7084,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + 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 @@ -6357,7 +7120,7 @@ solaris*) case $cc_basename in - CC*) + 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' @@ -6378,7 +7141,7 @@ esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + 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 @@ -6405,7 +7168,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + 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. @@ -6416,7 +7179,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + 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' @@ -6470,6 +7233,10 @@ 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' @@ -6716,7 +7483,7 @@ solaris*) case $cc_basename in - CC*) + 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 @@ -6760,32 +7527,16 @@ ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _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_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[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)= @@ -6804,6 +7555,8 @@ _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 @@ -6903,32 +7656,17 @@ ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _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_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[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)= @@ -6947,6 +7685,8 @@ _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 @@ -7092,6 +7832,8 @@ _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 if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) @@ -7205,6 +7947,18 @@ ]) +# _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_SED # ------------ # Check for a fully-functional sed program, that truncates @@ -7441,7 +8195,7 @@ func_dirname () { # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else @@ -7452,7 +8206,7 @@ # func_basename file func_basename () { - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + func_basename_result=`$ECHO "${1}" | $SED "$basename"` } dnl func_dirname_and_basename @@ -7468,10 +8222,8 @@ func_stripname () { case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } @@ -7482,20 +8234,20 @@ # func_opt_split func_opt_split () { - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_xform libobj-or-source func_xform () { - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` + func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... @@ -7543,14 +8295,15 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# 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 6 ltoptions.m4 +# 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])]) @@ -7665,7 +8418,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -7673,13 +8426,13 @@ esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -7906,14 +8659,14 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 +# 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 5 ltsugar.m4 +# 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])]) @@ -7969,14 +8722,14 @@ # 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([$2], [], [], - [m4_if([$4], [], [], - [lt_join(m4_quote(m4_default([$1], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], - [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), - [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl -]) +[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]) @@ -8039,29 +8792,29 @@ # Generated from ltversion.in. -# serial 2976 ltversion.m4 +# serial 3175 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.4]) -m4_define([LT_PACKAGE_REVISION], [1.2976]) +m4_define([LT_PACKAGE_VERSION], [2.2.10]) +m4_define([LT_PACKAGE_REVISION], [1.3175]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.4' -macro_revision='1.2976' +[macro_version='2.2.10' +macro_revision='1.3175' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# 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 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -8131,7 +8884,6 @@ 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_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) 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])]) @@ -8144,8 +8896,49 @@ 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])]) + +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ([2.50]) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # @@ -8173,7 +8966,10 @@ AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +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 @@ -8186,7 +8982,6 @@ AC_MSG_RESULT([no]) PKG_CONFIG="" fi - fi[]dnl ])# PKG_PROG_PKG_CONFIG @@ -8195,34 +8990,31 @@ # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually +# 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_ifval([$2], [$2], [:]) + m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) - # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried +[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`], + [pkg_failed=yes]) + else + pkg_failed=untried fi[]dnl ])# _PKG_CONFIG @@ -8264,16 +9056,17 @@ 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 --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - ifelse([$4], , [AC_MSG_ERROR(dnl + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -8281,29 +9074,28 @@ Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) +_PKG_TEXT])[]dnl + ]) elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl + 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 .])], - [$4]) +To get pkg-config, see .])dnl + ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) + $3 fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8315,10 +9107,10 @@ # 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.10' +[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.10.1], [], +m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -8332,12 +9124,12 @@ # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl +[AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -8394,14 +9186,14 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# 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 8 +# serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -8414,6 +9206,7 @@ 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='#' @@ -8427,14 +9220,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 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 9 +# serial 10 # 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, @@ -8491,6 +9284,16 @@ 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 @@ -8508,7 +9311,17 @@ 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 @@ -8518,19 +9331,23 @@ break fi ;; + 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 - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $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 sub/conftest.${OBJEXT-o} 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 @@ -8587,57 +9404,68 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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 3 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # 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" +[{ + # 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 -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -8669,13 +9497,13 @@ # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. +# 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 13 +# 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. @@ -8692,7 +9520,7 @@ # 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.60])dnl +[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 @@ -8743,8 +9571,8 @@ AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_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. @@ -8752,23 +9580,36 @@ 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([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 + [_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 + [_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_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. @@ -8792,7 +9633,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 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, @@ -8803,7 +9644,14 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +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. @@ -8829,13 +9677,13 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# 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 3 +# serial 4 # AM_MAKE_INCLUDE() # ----------------- @@ -8844,7 +9692,7 @@ [am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. @@ -8854,24 +9702,24 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# 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 - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + 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]) @@ -8881,14 +9729,14 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# 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 5 +# serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -8905,7 +9753,14 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +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 " @@ -8943,13 +9798,13 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 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 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -8966,7 +9821,7 @@ # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- @@ -8976,14 +9831,14 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# 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 4 +# serial 5 # AM_SANITY_CHECK # --------------- @@ -8992,16 +9847,29 @@ # 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` + 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` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ @@ -9026,6 +9894,33 @@ fi AC_MSG_RESULT(yes)]) +# Copyright (C) 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 1 + +# 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 +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -9054,18 +9949,25 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 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 2 + # _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 Free Software Foundation, Inc. diff -Nru gfire-0.8.3/AUTHORS gfire-0.9.4/AUTHORS --- gfire-0.8.3/AUTHORS 2009-08-19 15:43:19.000000000 +0000 +++ gfire-0.9.4/AUTHORS 2011-03-14 20:15:20.000000000 +0000 @@ -1,21 +1,45 @@ -Authors -======= -Wolf Beat -Keith Geffert -Laurent De Marez -Warren Dumortier -Oliver Ney - -Special Thanks -============== -The folks in #pidgin (previously #gaim), especially rlaager, Paco-Paco and grim (thx grim for the build system :-)) -And a big thx to keamos which gave me many many packet dumps because i don't have windows and Xfire doesent work with WINE. -A big thx to Brian "TLM" Davenport, he helped me with the win32 release and some bugs :-) -Huge thanks to Keith Geffert which sent me patches for features i would never been able to do myself, thanks! - -Special thank to all the guys who helped testing the beta of 0.8.0! -Also want to thank Flames who made a nice converter for the games id list. -Lots of kuddos to the GOD?GOD who made the patch for the buddies who don't appear online. -And of course want to thank nwarrenfl who made the beautifull game manager and made auto game detection possible. -Thanks to Gamma and GODJonez who helped me with the packet system. -Finaly want to thank Chewit who is also in the dev team, he hosts the site and makes sure that the games list always is up-to-date. +Gfire is the combined and copyrighted work of the the following authors: + +Programming +----------- +Beat Wolf (2005-2006) +Keith Geffert (2006) +Laurent De Marez (2008-2009) +Warren Dumortier (2009-2010) +Oliver Ney (2009-2011) + +Artwork +------- +Jakub Szypulka - Xfire protocol icons (http://cubestuff.wordpress.com/2008/06/26/xfire-goes-tango-2/) +León Asad Castillejos - Recolouring of the small protocol icons + + +Special thanks +-------------- +The folks in #pidgin (previously #gaim), especially rlaager, Paco-Paco and grim + for their help with libpurple + +keamos + for his numerous xfire packet dumps + + +Brian "TLM" Davenport + for his help with the initial win32 releases and some bugs :-) + + +to all the guys who helped testing the beta of 0.8.0! + +COD?GOD + for his the patch for the buddies who don't appear online. (0.8.X series) + + +Gamma and GODJonez + for their helpw ith the packet system. + +Chewit + who is also in the teams and keeps the project running :) + + +Not listed? +----------- +If you think that we have missed you in this file, tell us! diff -Nru gfire-0.8.3/autogen.sh gfire-0.9.4/autogen.sh --- gfire-0.8.3/autogen.sh 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/autogen.sh 2010-01-09 14:57:00.000000000 +0000 @@ -11,5 +11,7 @@ autoconf || exit; automake || exit; +intltoolize --copy --force --automake || exit; + echo; echo "Done." diff -Nru gfire-0.8.3/ChangeLog gfire-0.9.4/ChangeLog --- gfire-0.8.3/ChangeLog 2009-08-19 15:44:54.000000000 +0000 +++ gfire-0.9.4/ChangeLog 2011-03-23 18:19:36.000000000 +0000 @@ -1,19 +1,84 @@ -Gfire: Xfire for Pidgin -Copyright 2006-2009 Wolf Beat, Keith Geffert, Laurent De Marez, Warren Dumortier, Oliver Ney -Distributed under the GPLv3 +# Changelog for Gfire +# Copyright 2006-2011 Wolf Beat, Keith Geffert, Laurent De Marez, Warren Dumortier, Oliver Ney +# Distributed under the GPLv3 +# $Id: CHANGELOG, v0.9.4 + +Gfire: + +0.9.4 +- Fixed rather critical crash on startup if game detection was disabled +- Rewrote file transfer code partially +- Added ability to create P2P connection with local network nodes +- Changed P2P handshaking +- NAT Type can now be looked up in the about window +- Added --disable-game-detection flag to configure for embedded systems or servers. + +0.9.3 +- Fixed further, if not almost all, P2P issues +- Fixed infinite loop on web detection usage +- Fixed possible crashes on web detection code +- Fixed bug in preferences code +- Added support for keep-alive connections on the web detection (less CPU usage) +- Added missing lower case conversion of usernames for login +- Added server browser with drivers for ASE, GameSpy, GameSpy2, Source and Savage query protocols + +0.9.2 +- Fixed file transfer completion issues +- Fixed bad loading of the game list when started without a working internet connection +- Fixed timeout issues + +0.9.1 +- Fixed file transfer on Windows +- Fixed game detection issues on Linux and Windows +- Fixed MIME-type bug in the game manager on Windows +- Added display of a buddys status message while he's playing +- Added support for game icons + +0.9.0 +- Added File Transfer +- Added Server Browser +- Added Server Detection +- Added Avatar Support +- Added Clan/Guild Support +- Added Friends of Friends +- Added Improvements to Game Manager +- Added Windows Game Detection +- Added Internationlization Support +- Added Advanced Status Handling +- Added Web Game Detection +- Added New Icons +- Added Notifications by libnotify +- Added Custom group management +- Added Largely improved chat room support +- Added VoIP software detection (requires working server detection) +- Complete Code Rewrite +- Better organisation of code +- 'Get Info' Fully Working! +- Completed network data handling issues +- Fixed a bug preventing a user logging in, with their username containing uppercase characters +- Status did not change if you logged off and logged back in +- Reversed IP address in contact listings +- In some Linux distros, the buddy list was not being displayed +- Messages received came with html tags +- Fixed HTML tags in status messages, if they contained an URL +- Fixed a crash when a "Playing" status was received +- Fixed a crash when sending an offline message +- Fixed several bugs with the games list and game manager +- Updated Web Links +- Now useable with Finch again 0.8.3 - * Corrected networking code (fixes problems with Xfire 1.13) - * Added Xfires statistics packet +- Fixed some bug in the network code which denied all logins +- Added the Xfire statistics packet 0.8.2 - * Update for server (website) change. +- Update the Gfire URLs due to a server change 0.8.1 - * Fix crash on login with some Linux distros. - * Small bugfixes/changes. - * Improve file paths. - * Only 200 characters are allowed in a topic for groupchat. +- Fix crash on login with some Linux distros. +- Small bugfixes/changes. +- Improve file paths. +- Only 200 characters are allowed in a topic for groupchat. 0.8.0 - Buddy authorization improved. @@ -44,6 +109,7 @@ - View the permissions icon next to the buddy. - Make new groupchat channels. + 0.7.1 - Minor bug fix - Download Game ID List function @@ -55,7 +121,7 @@ - Ported the gfire code from Gaim to Purple - Added new protocol icons - Added the about function (Will be used later to show the date of the game id list, so you know if you are out-dated or not.) -- Fixed the “(AFK) Away From Keyboard bug (typo) +- Fixed the “(AFK) Away From Keyboard” bug (typo) - Fixed server port bug diff -Nru gfire-0.8.3/config.guess gfire-0.9.4/config.guess --- gfire-0.8.3/config.guess 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/config.guess 2010-01-09 14:58:28.000000000 +0000 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-01-23' +timestamp='2009-02-03' # 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 @@ -139,6 +139,23 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +if [ "${UNAME_SYSTEM}" = "Linux" ] ; then + eval $set_cc_for_build + cat << EOF > $dummy.c + #include + #ifdef __UCLIBC__ + # ifdef __UCLIBC_CONFIG_VERSION__ + LIBC=uclibc __UCLIBC_CONFIG_VERSION__ + # else + LIBC=uclibc + # endif + #else + LIBC=gnu + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` +fi + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -331,7 +348,20 @@ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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 @@ -796,7 +826,7 @@ x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -840,31 +870,31 @@ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo cris-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo crisv32-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:*) eval $set_cc_for_build @@ -887,7 +917,7 @@ s: ::g p }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -910,16 +940,16 @@ s: ::g p }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo or32-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -932,40 +962,43 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-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 ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo x86_64-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -980,20 +1013,19 @@ p'` case "$ld_supported_targets" in elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" ;; a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" + echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" exit ;; esac + # This should get integrated into the C code below, but now we hack + if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -1141,6 +1173,16 @@ 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 ;; @@ -1216,6 +1258,9 @@ 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 ;; @@ -1324,6 +1369,9 @@ i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -Nru gfire-0.8.3/config.sub gfire-0.9.4/config.sub --- gfire-0.8.3/config.sub 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/config.sub 2010-01-09 14:58:28.000000000 +0000 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-01-16' +timestamp='2009-02-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | 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/'` @@ -244,18 +245,21 @@ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ + | d10v | d30v | dlx | dsp16xx | dvp \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -277,7 +281,7 @@ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | 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 \ @@ -286,7 +290,7 @@ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -329,14 +333,17 @@ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -358,20 +365,20 @@ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -439,6 +446,10 @@ basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,6 +470,10 @@ basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -526,6 +541,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -714,6 +733,24 @@ basic_machine=m68k-atari os=-mint ;; + mipsEE* | ee | ps2) + basic_machine=mips64r5900el-scei + case $os in + -linux*) + ;; + *) + os=-elf + ;; + esac + ;; + iop) + basic_machine=mipsel-scei + os=-irx + ;; + dvp) + basic_machine=dvp-scei + os=-elf + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -1128,6 +1165,10 @@ basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1166,7 +1207,7 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + 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) @@ -1238,8 +1279,9 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1248,7 +1290,7 @@ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1258,7 +1300,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1388,6 +1430,9 @@ -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; -none) ;; *) diff -Nru gfire-0.8.3/configure gfire-0.9.4/configure --- gfire-0.8.3/configure 2011-09-24 19:29:47.000000000 +0000 +++ gfire-0.9.4/configure 2011-03-23 19:57:03.000000000 +0000 @@ -1,60 +1,85 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. +# Generated by GNU Autoconf 2.65 for Gfire 0.9.4. +# +# Report bugs to . +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +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 + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -63,20 +88,18 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -87,32 +110,279 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: support@gfireproject.org about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error -# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -126,13 +396,17 @@ as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -147,563 +421,131 @@ } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit } -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac -if as_func_ret_success; then - : +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - exitcode=1 - echo as_func_ret_success failed. + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' else - exitcode=1 - echo positional parameters were not saved. + test -d ./-p && rmdir ./-p + as_mkdir_p=false fi -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -fi +SHELL=${CONFIG_SHELL-/bin/sh} -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +test -n "$DJDIR" || exec 7<&0 &1 -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# 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 - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. @@ -716,14 +558,14 @@ subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= +PACKAGE_NAME='Gfire' +PACKAGE_TARNAME='gfire' +PACKAGE_VERSION='0.9.4' +PACKAGE_STRING='Gfire 0.9.4' +PACKAGE_BUGREPORT='support@gfireproject.org' +PACKAGE_URL='' ac_unique_file="src/gfire.c" # Factoring default headers for most tests. @@ -762,123 +604,204 @@ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -am__isrc -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -sedpath -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -DEBUG_CFLAGS -PKG_CONFIG -PIDGIN_CFLAGS -PIDGIN_LIBS -GLIB_CFLAGS -GLIB_LIBS -GLIB_GENMARSHAL -GOBJECT_QUERY -GLIB_MKENUMS -PLUGINS_TRUE +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS PLUGINS_FALSE -LIBTOOL -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -SED -GREP -EGREP -FGREP -LD -DUMPBIN -ac_ct_DUMPBIN -NM -LN_S -AR -RANLIB -lt_ECHO -DSYMUTIL -NMEDIT -LIPO -OTOOL -OTOOL64 +PLUGINS_TRUE +GAME_DETECTION_FALSE +GAME_DETECTION_TRUE +INSTALL_NLS_FALSE +INSTALL_NLS_TRUE +MKINSTALLDIRS +POSUB +POFILES +PO_IN_DATADIR_FALSE +PO_IN_DATADIR_TRUE +INTLLIBS +INSTOBJEXT +GMOFILES +CATOBJEXT +CATALOGS +MSGFMT_OPTS +GETTEXT_PACKAGE +DATADIRNAME +ALL_LINGUAS +INTLTOOL_PERL +GMSGFMT +MSGFMT +MSGMERGE +XGETTEXT +INTLTOOL_POLICY_RULE +INTLTOOL_SERVICE_RULE +INTLTOOL_THEME_RULE +INTLTOOL_SCHEMAS_RULE +INTLTOOL_CAVES_RULE +INTLTOOL_XML_NOMERGE_RULE +INTLTOOL_XML_RULE +INTLTOOL_KBD_RULE +INTLTOOL_XAM_RULE +INTLTOOL_UI_RULE +INTLTOOL_SOUNDLIST_RULE +INTLTOOL_SHEET_RULE +INTLTOOL_SERVER_RULE +INTLTOOL_PONG_RULE +INTLTOOL_OAF_RULE +INTLTOOL_PROP_RULE +INTLTOOL_KEYS_RULE +INTLTOOL_DIRECTORY_RULE +INTLTOOL_DESKTOP_RULE +INTLTOOL_EXTRACT +INTLTOOL_MERGE +INTLTOOL_UPDATE +USE_NLS +GLIB_MKENUMS +GOBJECT_QUERY +GLIB_GENMARSHAL +GLIB_LIBS +GLIB_CFLAGS +DBUS_GLIB_LIBS +DBUS_GLIB_CFLAGS +GTK_FALSE +GTK_TRUE +LIBNOTIFY_LIBS +LIBNOTIFY_CFLAGS +GTK_LIBS +GTK_CFLAGS +PURPLE_LIBS +PURPLE_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +DEBUG_CFLAGS CPP -LIBOBJS -LTLIBOBJS' +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +sedpath +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_static +enable_shared +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_debug +enable_gtk +enable_libnotify +enable_dbus_status +enable_glibtest +enable_nls +enable_game_detection +enable_update_notify +' ac_precious_vars='build_alias host_alias target_alias @@ -887,15 +810,25 @@ LDFLAGS LIBS CPPFLAGS +CPP PKG_CONFIG -PIDGIN_CFLAGS -PIDGIN_LIBS -CPP' +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +PURPLE_CFLAGS +PURPLE_LIBS +GTK_CFLAGS +GTK_LIBS +LIBNOTIFY_CFLAGS +LIBNOTIFY_LIBS +DBUS_GLIB_CFLAGS +DBUS_GLIB_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -929,7 +862,7 @@ localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' @@ -994,13 +927,20 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -1013,13 +953,20 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1210,22 +1157,36 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1245,25 +1206,25 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1272,23 +1233,36 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac fi -# Be sure to have absolute directory names. +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1302,7 +1276,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1318,23 +1292,21 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1361,13 +1333,11 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1393,7 +1363,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +\`configure' configures Gfire 0.9.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,9 +1385,9 @@ Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1427,25 +1397,25 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/gfire] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1462,21 +1432,40 @@ fi if test -n "$ac_init_help"; then - + case $ac_init_help in + short | recursive ) echo "Configuration of Gfire 0.9.4:";; + esac cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-debug Compile with debugging support. - --disable-glibtest do not try to compile and run a test GLIB program + --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-debug Compile with debugging support. + --disable-gtk Don't compile with GTK+ support. (no server browser, + no game manager) + --enable-libnotify Compile with libnotify support. (depends on GTK + flag) + --enable-dbus-status Enable status change for other IM clients (currently + only kmess). + --disable-glibtest do not try to compile and run a test GLIB program + --disable-nls disable installation of translation files + --disable-nls do not use Native Language Support + --disable-game-detection + Disable game detection. e.g. use this if you intend + to build Gfire for embedded devices/servers. + --disable-update-notify Disable notifications on new available versions of + Gfire. Use this if you intend to build Gfire for a + package. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1491,17 +1480,32 @@ LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - PKG_CONFIG path to pkg-config utility - PIDGIN_CFLAGS - C compiler flags for PIDGIN, overriding pkg-config - PIDGIN_LIBS linker flags for PIDGIN, overriding pkg-config CPP C preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + PURPLE_CFLAGS + C compiler flags for PURPLE, overriding pkg-config + PURPLE_LIBS linker flags for PURPLE, overriding pkg-config + GTK_CFLAGS C compiler flags for GTK, overriding pkg-config + GTK_LIBS linker flags for GTK, overriding pkg-config + LIBNOTIFY_CFLAGS + C compiler flags for LIBNOTIFY, overriding pkg-config + LIBNOTIFY_LIBS + linker flags for LIBNOTIFY, overriding pkg-config + DBUS_GLIB_CFLAGS + C compiler flags for DBUS_GLIB, overriding pkg-config + DBUS_GLIB_LIBS + linker flags for DBUS_GLIB, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to . _ACEOF ac_status=$? fi @@ -1509,15 +1513,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1553,7 +1559,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1562,59 +1568,416 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -configure -generated by GNU Autoconf 2.61 +Gfire configure 0.9.4 +generated by GNU Autoconf 2.65 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -_ASUNAME +} # ac_fn_c_try_compile -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( cat <<\_ASBOX +## --------------------------------------- ## +## Report this to support@gfireproject.org ## +## --------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by Gfire $as_me 0.9.4, which was +generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } >&5 @@ -1648,12 +2011,12 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1669,13 +2032,13 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1700,12 +2063,13 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -1734,9 +2098,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1751,9 +2115,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1769,83 +2133,88 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h + # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1859,60 +2228,56 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1923,28 +2288,21 @@ -am__api_version='1.10' + +am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -1969,22 +2327,23 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2002,17 +2361,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac -done + + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2025,8 +2396,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2036,21 +2407,34 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + 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` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ @@ -2060,11 +2444,8 @@ # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file @@ -2073,135 +2454,246 @@ # Ok. : else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. +# Double any \ or $. # By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +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= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS - + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2218,12 +2710,12 @@ rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2242,9 +2734,7 @@ am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2259,8 +2749,8 @@ # Define the identity of the package. - PACKAGE=Gfire - VERSION="$GFIRE_VERSION" + PACKAGE=gfire + VERSION=0.9.4 # Some tools Automake needs. @@ -2279,112 +2769,6 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. @@ -2397,17 +2781,25 @@ +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +AM_BACKSLASH='\' -cat >>confdefs.h <<_ACEOF -#define GFIRE_VERSION "$GFIRE_VERSION" -_ACEOF # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_sedpath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_sedpath+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $sedpath in [\\/]* | ?:[\\/]*) @@ -2419,14 +2811,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_sedpath="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -2434,15 +2826,16 @@ fi sedpath=$ac_cv_path_sedpath if test -n "$sedpath"; then - { echo "$as_me:$LINENO: result: $sedpath" >&5 -echo "${ECHO_T}$sedpath" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sedpath" >&5 +$as_echo "$sedpath" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + # # Define Gfire header # @@ -2450,6 +2843,24 @@ +cat >>confdefs.h <<_ACEOF +#define GFIRE_VERSION_SUFFIX "" +_ACEOF + + +$as_echo "#define GFIRE_VERSION_PATCH 4" >>confdefs.h + + +$as_echo "#define GFIRE_VERSION_MINOR 9" >>confdefs.h + + +$as_echo "#define GFIRE_VERSION_MAJOR 0" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define GFIRE_VERSION_STRING "0.9.4" +_ACEOF + # # Check C compiler @@ -2463,10 +2874,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2476,25 +2887,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2503,10 +2914,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2516,25 +2927,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2542,12 +2953,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2560,10 +2967,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2573,25 +2980,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2600,10 +3007,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2614,18 +3021,18 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -2644,11 +3051,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2659,10 +3066,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2672,25 +3079,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2703,10 +3110,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2716,25 +3123,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2746,12 +3153,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2761,51 +3164,37 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2817,42 +3206,38 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2862,14 +3247,14 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2888,78 +3273,42 @@ else ac_file='' fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2967,37 +3316,90 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3009,51 +3411,46 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3067,54 +3464,34 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3125,34 +3502,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3163,35 +3517,12 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3202,42 +3533,18 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3253,18 +3560,14 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -3321,31 +3624,9 @@ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -3356,17 +3637,19 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3381,44 +3664,44 @@ am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# 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 - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then +if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi @@ -3438,10 +3721,10 @@ depcc="$CC" am_compiler_list= -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up @@ -3466,6 +3749,11 @@ if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -3483,7 +3771,17 @@ 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 @@ -3493,19 +3791,23 @@ break fi ;; + 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 - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $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 sub/conftest.${OBJEXT-o} 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 @@ -3529,8 +3831,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -3546,867 +3848,458 @@ CFLAGS="$CFLAGS_save" -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then - enableval=$enable_debug; +# +# Setup libtool +# +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - enable_debug=no + enable_static=no fi -if test "$enable_debug"="yes"; then - DEBUG_CFLAGS="$DEBUG_CFLAGS -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" -cat >>confdefs.h <<\_ACEOF -#define DEBUG 1 -_ACEOF -fi -if test "x$GCC"="xyes"; then - CFLAGS="$CFLAGS -Wall -g3" -fi -# -# Check for Pidgin -# +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi +macro_version='2.2.10' +macro_revision='1.3175' -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - PKG_CONFIG="" - fi -fi -pkg_failed=no -{ echo "$as_me:$LINENO: checking for PIDGIN" >&5 -echo $ECHO_N "checking for PIDGIN... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$PIDGIN_CFLAGS"; then - pkg_cv_PIDGIN_CFLAGS="$PIDGIN_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pidgin\"") >&5 - ($PKG_CONFIG --exists --print-errors "pidgin") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_PIDGIN_CFLAGS=`$PKG_CONFIG --cflags "pidgin" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$PIDGIN_LIBS"; then - pkg_cv_PIDGIN_LIBS="$PIDGIN_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pidgin\"") >&5 - ($PKG_CONFIG --exists --print-errors "pidgin") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_PIDGIN_LIBS=`$PKG_CONFIG --libs "pidgin" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test $pkg_failed = yes; then -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PIDGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pidgin"` - else - PIDGIN_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pidgin"` - fi - # Put the nasty error message in config.log where it belongs - echo "$PIDGIN_PKG_ERRORS" >&5 + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - { { echo "$as_me:$LINENO: error: Package requirements (pidgin) were not met: +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -$PIDGIN_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi -Alternatively, you may set the environment variables PIDGIN_CFLAGS -and PIDGIN_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 -echo "$as_me: error: Package requirements (pidgin) were not met: +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -$PIDGIN_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -Alternatively, you may set the environment variables PIDGIN_CFLAGS -and PIDGIN_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} - { (exit 1); exit 1; }; } -elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' -Alternatively, you may set the environment variables PIDGIN_CFLAGS -and PIDGIN_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -To get pkg-config, see . -See \`config.log' for more details." >&5 -echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' -Alternatively, you may set the environment variables PIDGIN_CFLAGS -and PIDGIN_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' -To get pkg-config, see . -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - PIDGIN_CFLAGS=$pkg_cv_PIDGIN_CFLAGS - PIDGIN_LIBS=$pkg_cv_PIDGIN_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_PIDGIN 1 -_ACEOF +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} -fi +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac -# -# Check for GTK+ and other dependencies -# -# Check whether --enable-glibtest was given. -if test "${enable_glibtest+set}" = set; then - enableval=$enable_glibtest; -else - enable_glibtest=yes -fi - pkg_config_args=glib-2.0 - for module in . - do - case "$module" in - gmodule) - pkg_config_args="$pkg_config_args gmodule-2.0" - ;; - gmodule-no-export) - pkg_config_args="$pkg_config_args gmodule-no-export-2.0" - ;; - gobject) - pkg_config_args="$pkg_config_args gobject-2.0" - ;; - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - gio*) - pkg_config_args="$pkg_config_args $module-2.0" - ;; - esac - done -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" + ac_cv_path_SED=$SED fi fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.16 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - PKG_CONFIG="" - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed -fi +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" - no_glib="" - if test "x$PKG_CONFIG" = x ; then - no_glib=yes - PKG_CONFIG=no - fi - min_glib_version=2.0.0 - { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 -echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; } - if test x$PKG_CONFIG != xno ; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" - enable_glibtest=no - fi - if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then - : - else - no_glib=yes - fi - fi - if test x"$no_glib" = x ; then - GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` - GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` - GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` - - GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` - GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` - glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" - rm -f conf.glibtest - if test "$cross_compiling" = yes; then - echo $ac_n "cross compiling; assumed OK... $ac_c" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include -#include -int -main () -{ - int major, minor, micro; - char *tmp_version; - system ("touch conf.glibtest"); - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -no_glib=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi - if test "x$no_glib" = x ; then - { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 -echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } - : - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - if test "$PKG_CONFIG" = "no" ; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://www.freedesktop.org/software/pkgconfig/" - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB is incorrectly installed." + ac_cv_path_GREP=$GREP fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - GLIB_GENMARSHAL="" - GOBJECT_QUERY="" - GLIB_MKENUMS="" - { { echo "$as_me:$LINENO: error: -*** GLib 2.0 is required to build gfire; please make sure you have -*** the GLib development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org" >&5 -echo "$as_me: error: -*** GLib 2.0 is required to build gfire; please make sure you have -*** the GLib development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org" >&2;} - { (exit 1); exit 1; }; } - fi - - - +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" - rm -f conf.glibtest +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -# -# Check if plugins are enabled -# -want_plugins=yes - if test "$want_plugins"="yes"; then - PLUGINS_TRUE= - PLUGINS_FALSE='#' -else - PLUGINS_TRUE='#' - PLUGINS_FALSE= -fi - -# AM_GLIB_GNU_GETTEXT - -# -# Setup libtool -# -case `pwd` in - *\ * | *\ *) - { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.2.4' -macro_revision='1.2976' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" | sed 99q >conftest.sed - $as_unset ac_script || ac_script= - # Extract the first word of "sed gsed" to use in msg output -if test -z "$SED"; then -set dummy sed gsed; ac_prog_name=$2 -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ac_path_SED_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue - # Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in *GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_SED_max-0}; then + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break @@ -4414,36 +4307,28 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_SED_found && break 3 + $ac_path_FGREP_found && break 3 + done + done done -done - -done IFS=$as_save_IFS - - + if test -z "$ac_cv_path_FGREP"; then + as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP fi -SED="$ac_cv_path_SED" -if test -z "$SED"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} - { (exit 1); exit 1; }; } + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" -else - ac_cv_path_SED=$SED -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 -echo "${ECHO_T}$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed +test -z "$GREP" && GREP=grep + -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" @@ -4455,388 +4340,127 @@ -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_GREP_found && break 3 - done -done -done -IFS=$as_save_IFS + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no fi -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } else - ac_cv_path_GREP=$GREP + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for fgrep" >&5 -echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - # Extract the first word of "fgrep" to use in msg output -if test -z "$FGREP"; then -set dummy fgrep; ac_prog_name=$2 -if test "${ac_cv_path_FGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_FGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue - # Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_FGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -FGREP="$ac_cv_path_FGREP" -if test -z "$FGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_FGREP=$FGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 -echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 -echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. @@ -4882,21 +4506,24 @@ : ${lt_cv_path_NM=no} fi fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. @@ -4906,25 +4533,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 -echo "${ECHO_T}$DUMPBIN" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4933,14 +4560,14 @@ fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. @@ -4950,25 +4577,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 -echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4980,18 +4607,23 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5004,45 +4636,45 @@ -{ echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 -echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } -if test "${lt_cv_nm_interface+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5014: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5017: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:5020: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 -echo "${ECHO_T}$lt_cv_nm_interface" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" @@ -5063,7 +4695,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw*) + 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, @@ -5074,6 +4706,11 @@ 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. @@ -5138,8 +4775,8 @@ # 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_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` @@ -5159,11 +4796,11 @@ fi if test -n $lt_cv_sys_max_cmd_len ; then - { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -5176,8 +4813,8 @@ : ${MV="mv -f"} : ${RM="rm -f"} -{ echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 -echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" @@ -5186,18 +4823,18 @@ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes -{ echo "$as_me:$LINENO: result: $xsi_shell" >&5 -echo "${ECHO_T}$xsi_shell" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } -{ echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 -echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes -{ echo "$as_me:$LINENO: result: $lt_shell_append" >&5 -echo "${ECHO_T}$lt_shell_append" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -5231,15 +4868,15 @@ -{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -5264,13 +4901,114 @@ +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } else - lt_cv_file_magic_cmd='$MAGIC_CMD' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support @@ -5309,15 +5047,23 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # 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 ;; @@ -5342,6 +5088,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -5350,11 +5100,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_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_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 @@ -5376,11 +5126,11 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) 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 @@ -5455,8 +5205,8 @@ esac fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -5475,10 +5225,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -5488,25 +5238,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5515,10 +5265,10 @@ ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -5528,25 +5278,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then @@ -5554,12 +5304,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -5584,10 +5330,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -5597,25 +5343,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5624,10 +5370,10 @@ ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -5637,25 +5383,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -5663,12 +5409,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -5687,10 +5429,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -5700,25 +5442,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5727,10 +5469,10 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -5740,25 +5482,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5766,12 +5508,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5804,6 +5542,18 @@ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + @@ -5848,10 +5598,10 @@ # Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. @@ -5868,7 +5618,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32*) +cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -5966,18 +5716,18 @@ int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -6030,11 +5780,11 @@ lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" @@ -6068,11 +5818,11 @@ lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi @@ -6096,8 +5846,9 @@ + # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then +if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi @@ -6109,11 +5860,11 @@ ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" @@ -6127,12 +5878,12 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6130 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) @@ -6166,11 +5917,11 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in @@ -6219,10 +5970,10 @@ # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -6230,11 +5981,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6245,34 +5992,13 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_cc_needs_belf=no + lt_cv_cc_needs_belf=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6280,8 +6006,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -6290,11 +6016,11 @@ sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in @@ -6320,10 +6046,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. @@ -6333,25 +6059,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 -echo "${ECHO_T}$DSYMUTIL" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6360,10 +6086,10 @@ ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. @@ -6373,25 +6099,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 -echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -6399,12 +6125,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -6416,10 +6138,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. @@ -6429,25 +6151,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { echo "$as_me:$LINENO: result: $NMEDIT" >&5 -echo "${ECHO_T}$NMEDIT" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6456,10 +6178,10 @@ ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. @@ -6469,25 +6191,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 -echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -6495,12 +6217,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -6512,10 +6230,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. @@ -6525,25 +6243,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { echo "$as_me:$LINENO: result: $LIPO" >&5 -echo "${ECHO_T}$LIPO" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6552,10 +6270,10 @@ ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. @@ -6565,25 +6283,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 -echo "${ECHO_T}$ac_ct_LIPO" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -6591,12 +6309,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -6608,10 +6322,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. @@ -6621,25 +6335,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { echo "$as_me:$LINENO: result: $OTOOL" >&5 -echo "${ECHO_T}$OTOOL" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6648,10 +6362,10 @@ ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. @@ -6661,25 +6375,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 -echo "${ECHO_T}$ac_ct_OTOOL" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -6687,12 +6401,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -6704,10 +6414,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. @@ -6717,25 +6427,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { echo "$as_me:$LINENO: result: $OTOOL64" >&5 -echo "${ECHO_T}$OTOOL64" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6744,10 +6454,10 @@ ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. @@ -6757,25 +6467,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 -echo "${ECHO_T}$ac_ct_OTOOL64" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -6783,12 +6493,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -6823,10 +6529,10 @@ - { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 -echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then @@ -6850,22 +6556,18 @@ rm -f conftest.* fi fi -{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 -echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } - { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 -echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6876,39 +6578,50 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_ld_exported_symbols_list=no + lt_cv_ld_exported_symbols_list=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 -echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -6936,7 +6649,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -6949,15 +6662,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -6971,11 +6684,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -6984,76 +6693,34 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +if $ac_preproc_ok; then : break fi @@ -7065,8 +6732,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -7076,11 +6743,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -7089,83 +6752,40 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c @@ -7175,16 +6795,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -7199,47 +6815,23 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -7249,18 +6841,14 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -7270,14 +6858,10 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -7304,192 +6888,72 @@ return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : -( exit $ac_status ) -ac_cv_header_stdc=no +else + ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi +done +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF +fi +done -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi +# Set options -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done + enable_dlopen=no - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no + enable_win32_dll=no # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then +if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -7519,40 +6983,10 @@ - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then +if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default @@ -7568,7 +7002,7 @@ # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then +if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -7630,6 +7064,7 @@ + test -z "$LN_S" && LN_S="ln -s" @@ -7649,10 +7084,10 @@ setopt NO_GLOB_SUBST fi -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null @@ -7664,8 +7099,8 @@ fi rmdir .libs 2>/dev/null fi -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -7679,19 +7114,6 @@ - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -7704,23 +7126,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# 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' - # Global variables: ofile=libtool can_build_shared=yes @@ -7749,7 +7154,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -7757,10 +7162,10 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) @@ -7810,11 +7215,11 @@ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -7823,10 +7228,10 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) @@ -7876,11 +7281,11 @@ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -7954,12 +7359,17 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac - { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext @@ -7974,15 +7384,15 @@ -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:7977: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7981: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -7991,8 +7401,8 @@ $RM conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -8011,8 +7421,8 @@ lt_prog_compiler_pic= lt_prog_compiler_static= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8046,7 +7456,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + 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 @@ -8060,11 +7470,18 @@ lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. + # 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*|ia64*) + hppa*64*) # +Z the default ;; *) @@ -8101,6 +7518,13 @@ lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8114,7 +7538,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8142,14 +7566,28 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in - icc* | ecc* | ifort*) + # old Intel for x86_64 which still supported -KPIC. + ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8161,25 +7599,25 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_wl='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' + lt_prog_compiler_wl='-Wl,' ;; esac ;; @@ -8211,7 +7649,7 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -8268,8 +7706,8 @@ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } @@ -8280,10 +7718,10 @@ # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext @@ -8298,15 +7736,15 @@ -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:8301: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8305: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -8315,8 +7753,8 @@ $RM conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in @@ -8339,10 +7777,10 @@ # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" @@ -8354,7 +7792,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -8367,8 +7805,8 @@ LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : @@ -8382,10 +7820,10 @@ - { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null @@ -8403,16 +7841,16 @@ -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:8406: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8410: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -8429,18 +7867,18 @@ $RM conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null @@ -8458,16 +7896,16 @@ -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:8461: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8465: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -8484,8 +7922,8 @@ $RM conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } @@ -8493,19 +7931,19 @@ hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -8517,8 +7955,8 @@ - { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -8562,7 +8000,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32*) + 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++. @@ -8580,7 +8018,33 @@ esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -8598,6 +8062,7 @@ 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 ... @@ -8613,11 +8078,12 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** 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 @@ -8649,10 +8115,11 @@ fi ;; - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -8674,6 +8141,11 @@ fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -8689,7 +8161,7 @@ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -8703,11 +8175,12 @@ tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -8715,13 +8188,20 @@ tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -8737,17 +8217,17 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -8756,7 +8236,7 @@ fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -8868,8 +8348,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -8931,7 +8413,6 @@ if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -8947,6 +8428,7 @@ fi fi + export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes @@ -8956,11 +8438,7 @@ allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -8971,24 +8449,7 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -9002,19 +8463,13 @@ if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9023,11 +8478,7 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9038,24 +8489,7 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -9069,15 +8503,9 @@ if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" @@ -9085,8 +8513,13 @@ # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9113,7 +8546,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32*) + 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 @@ -9125,7 +8558,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. @@ -9141,11 +8574,19 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" - if test "$GCC" = "yes"; then - output_verbose_link_cmd=echo + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -9211,7 +8652,7 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' @@ -9230,13 +8671,13 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -9251,7 +8692,46 @@ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -9279,48 +8759,26 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $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. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat >conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ int foo(void) {} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $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 - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9329,7 +8787,7 @@ link_all_deplibs=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -9382,17 +8840,17 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9402,13 +8860,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -9572,8 +9030,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -9609,46 +9067,52 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -9811,24 +9275,31 @@ - { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + 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 -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + 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= @@ -9841,7 +9312,7 @@ 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 ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -9861,7 +9332,13 @@ if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # 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 @@ -9949,7 +9426,7 @@ 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=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + 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 ;; @@ -9974,14 +9451,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32*) +cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10002,23 +9479,12 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; - mingw*) + mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' @@ -10075,7 +9541,14 @@ *) objformat=elf ;; esac fi - version_type=freebsd-$objformat + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' @@ -10086,6 +9559,12 @@ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in @@ -10118,6 +9597,19 @@ hardcode_into_libs=yes ;; +haiku*) + version_type=linux + 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. @@ -10160,8 +9652,10 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # 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]*) @@ -10218,306 +9712,2117 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + 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 + 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 + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +LIBTOOL="$LIBTOOL --silent" + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; enable_debug="$enableval" +else + enable_debug=no +fi + + +if test x$enable_debug != xno; then + DEBUG_CFLAGS="$DEBUG_CFLAGS -g -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" + +$as_echo "#define DEBUG 1" >>confdefs.h + + if test x$enable_debug = xverbose; then + +$as_echo "#define DEBUG_VERBOSE 1" >>confdefs.h + + fi +fi + + + +if test "x$GCC"="xyes"; then + CFLAGS="$CFLAGS -Wall" +fi + + +# +# Check for Pidgin +# + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PURPLE" >&5 +$as_echo_n "checking for PURPLE... " >&6; } + +if test -n "$PURPLE_CFLAGS"; then + pkg_cv_PURPLE_CFLAGS="$PURPLE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"purple\""; } >&5 + ($PKG_CONFIG --exists --print-errors "purple") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PURPLE_CFLAGS=`$PKG_CONFIG --cflags "purple" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PURPLE_LIBS"; then + pkg_cv_PURPLE_LIBS="$PURPLE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"purple\""; } >&5 + ($PKG_CONFIG --exists --print-errors "purple") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PURPLE_LIBS=`$PKG_CONFIG --libs "purple" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PURPLE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "purple" 2>&1` + else + PURPLE_PKG_ERRORS=`$PKG_CONFIG --print-errors "purple" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PURPLE_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (purple) were not met: + +$PURPLE_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables PURPLE_CFLAGS +and PURPLE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables PURPLE_CFLAGS +and PURPLE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + PURPLE_CFLAGS=$pkg_cv_PURPLE_CFLAGS + PURPLE_LIBS=$pkg_cv_PURPLE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PURPLE 1" >>confdefs.h + +fi + + + + +# +# Check for GTK+ and other dependencies +# +# Check whether --enable-gtk was given. +if test "${enable_gtk+set}" = set; then : + enableval=$enable_gtk; enable_gtk="$enableval" +else + enable_gtk=yes +fi + +# Check whether --enable-libnotify was given. +if test "${enable_libnotify+set}" = set; then : + enableval=$enable_libnotify; enable_libnotify="$enableval" +else + enable_libnotify=no +fi + + +if test x$enable_gtk = xyes; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5 +$as_echo_n "checking for GTK... " >&6; } + +if test -n "$GTK_CFLAGS"; then + pkg_cv_GTK_CFLAGS="$GTK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.14.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.14.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.14.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTK_LIBS"; then + pkg_cv_GTK_LIBS="$GTK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.14.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.14.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.14.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-2.0 >= 2.14.0" 2>&1` + else + GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-2.0 >= 2.14.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTK_PKG_ERRORS" >&5 + + as_fn_error " +*** GTK+ 2.0 is required to build Gfire; please make sure you have +*** the GTK+ development headers installed. The latest version of GTK is +*** always available at http://www.gtk.org" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error " +*** GTK+ 2.0 is required to build Gfire; please make sure you have +*** the GTK+ development headers installed. The latest version of GTK is +*** always available at http://www.gtk.org" "$LINENO" 5 +else + GTK_CFLAGS=$pkg_cv_GTK_CFLAGS + GTK_LIBS=$pkg_cv_GTK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_GTK 1" >>confdefs.h + +fi + + + + if test x$enable_libnotify = xyes; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNOTIFY" >&5 +$as_echo_n "checking for LIBNOTIFY... " >&6; } + +if test -n "$LIBNOTIFY_CFLAGS"; then + pkg_cv_LIBNOTIFY_CFLAGS="$LIBNOTIFY_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnotify >= 0.3.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libnotify >= 0.3.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBNOTIFY_CFLAGS=`$PKG_CONFIG --cflags "libnotify >= 0.3.2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBNOTIFY_LIBS"; then + pkg_cv_LIBNOTIFY_LIBS="$LIBNOTIFY_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnotify >= 0.3.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libnotify >= 0.3.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBNOTIFY_LIBS=`$PKG_CONFIG --libs "libnotify >= 0.3.2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBNOTIFY_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libnotify >= 0.3.2" 2>&1` + else + LIBNOTIFY_PKG_ERRORS=`$PKG_CONFIG --print-errors "libnotify >= 0.3.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBNOTIFY_PKG_ERRORS" >&5 + + as_fn_error " +*** You have requested to build Gfire with libnotify support. You do not have it; +*** please make sure you have the libnotify development headers installed. +*** The latest version of libnotify is always available at http://galago-project.org" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error " +*** You have requested to build Gfire with libnotify support. You do not have it; +*** please make sure you have the libnotify development headers installed. +*** The latest version of libnotify is always available at http://galago-project.org" "$LINENO" 5 +else + LIBNOTIFY_CFLAGS=$pkg_cv_LIBNOTIFY_CFLAGS + LIBNOTIFY_LIBS=$pkg_cv_LIBNOTIFY_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_LIBNOTIFY 1" >>confdefs.h + +fi + + + fi +fi + if test "x$enable_gtk" = "xyes"; then + GTK_TRUE= + GTK_FALSE='#' +else + GTK_TRUE='#' + GTK_FALSE= +fi + + +# Check whether --enable-dbus-status was given. +if test "${enable_dbus_status+set}" = set; then : + enableval=$enable_dbus_status; enable_dbus_status="$enableval" +else + enable_dbus_status=no +fi + +if test $enable_dbus_status = "yes"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5 +$as_echo_n "checking for DBUS_GLIB... " >&6; } + +if test -n "$DBUS_GLIB_CFLAGS"; then + pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DBUS_GLIB_LIBS"; then + pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-glib-1" 2>&1` + else + DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-glib-1" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DBUS_GLIB_PKG_ERRORS" >&5 + + as_fn_error " +*** Glib DBus bindings are required to build Gfire with your current configure flags; +*** please make sure you have the GLib DBus development headers installed. +*** The latest version of GLib is always available at http://www.gtk.org" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error " +*** Glib DBus bindings are required to build Gfire with your current configure flags; +*** please make sure you have the GLib DBus development headers installed. +*** The latest version of GLib is always available at http://www.gtk.org" "$LINENO" 5 +else + DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS + DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_DBUS_GLIB 1" >>confdefs.h + +fi + + + +$as_echo "#define USE_DBUS_STATUS_CHANGE 1" >>confdefs.h + +fi + +# Check whether --enable-glibtest was given. +if test "${enable_glibtest+set}" = set; then : + enableval=$enable_glibtest; +else + enable_glibtest=yes +fi + + + pkg_config_args=glib-2.0 + for module in . gthread + do + case "$module" in + gmodule) + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" + ;; + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + gio*) + pkg_config_args="$pkg_config_args $module-2.0" + ;; + esac + done + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.16 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + + no_glib="" + + if test "x$PKG_CONFIG" = x ; then + no_glib=yes + PKG_CONFIG=no + fi + + min_glib_version=2.18.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5 +$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" + rm -f conf.glibtest + if test "$cross_compiling" = yes; then : + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + fclose (fopen ("conf.glibtest", "w")); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} + _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + no_glib=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 +$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } + : + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include + int main () { - + return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then - shlibpath_overrides_runpath=yes +if ac_fn_c_try_link "$LINENO"; then : + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" + as_fn_error " +*** GLib 2.0 is required to build Gfire; please make sure you have +*** the GLib development headers installed. The latest version of GLib is +*** always available at http://www.gtk.org" "$LINENO" 5 + fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - # 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 + rm -f conf.glibtest - # 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;/^$/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 - ;; +# +# Internationalisation support +# +# Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; enable_nls="$enableval" +else + enable_nls=yes +fi -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +if test x$enable_nls = xyes; then -*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' - ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi -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 - ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } -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 - 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' - ;; +case "$am__api_version" in + 1.01234) + as_fn_error "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 + ;; + *) + ;; +esac -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 +if test -n ""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= " >&5 +$as_echo_n "checking for intltool >= ... " >&6; } + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 +$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + as_fn_error "Your intltool is too old. You need intltool or later." "$LINENO" 5 +fi + +# Extract the first word of "intltool-update", so it can be a program name with args. +set dummy intltool-update; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_UPDATE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_UPDATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - need_version=yes - ;; +done + done +IFS=$as_save_IFS -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - 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 ;; +esac +fi +INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE +if test -n "$INTLTOOL_UPDATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 +$as_echo "$INTLTOOL_UPDATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - 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' +# Extract the first word of "intltool-merge", so it can be a program name with args. +set dummy intltool-merge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_MERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_MERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_name_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 ;; +esac +fi +INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE +if test -n "$INTLTOOL_MERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 +$as_echo "$INTLTOOL_MERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH + +# Extract the first word of "intltool-extract", so it can be a program name with args. +set dummy intltool-extract; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_EXTRACT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_EXTRACT in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -*) - dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT +if test -n "$INTLTOOL_EXTRACT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 +$as_echo "$INTLTOOL_EXTRACT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } 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" + + +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + as_fn_error "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< $@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< $@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' @@ -10604,325 +11909,461 @@ - { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi + + + + + + + + + + +# Check the gettext tools to make sure they are GNU +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $XGETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +XGETTEXT=$ac_cv_path_XGETTEXT +if test -n "$XGETTEXT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGMERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MSGMERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGMERGE=$ac_cv_path_MSGMERGE +if test -n "$MSGMERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGFMT=$ac_cv_path_MSGFMT +if test -n "$MSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + as_fn_error "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + as_fn_error "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL +if test -n "$INTLTOOL_PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 +$as_echo "$INTLTOOL_PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_PERL"; then + as_fn_error "perl not found" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 +$as_echo_n "checking for perl >= 5.8.1... " >&6; } +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + as_fn_error "perl 5.8.1 is required for intltool" "$LINENO" 5 +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 +$as_echo "$IT_PERL_VERSION" >&6; } +fi +if test "x" != "xno-xml"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 +$as_echo_n "checking for XML::Parser... " >&6; } + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + else + as_fn_error "XML::Parser perl module is required for intltool" "$LINENO" 5 + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile + + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + DATADIRNAME=share else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + DATADIRNAME=share +else + DATADIRNAME=lib fi -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless + ;; + *) + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi + GETTEXT_PACKAGE="$PACKAGE" - 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 - ;; +cat >>confdefs.h <<_ACEOF +#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" +_ACEOF - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; + ALL_LINGUAS="cs de ee es fr pl ro sk sv" - darwin*) - # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + for ac_header in locale.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); +fi + +done + + if test $ac_cv_header_locale_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if test "${am_cv_val_LC_MESSAGES+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int main () { -return dlopen (); +return LC_MESSAGES ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no + am_cv_val_LC_MESSAGES=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h -fi + fi + fi + USE_NLS=yes - ;; - *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load + gt_cv_have_gettext=no -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= -#ifdef __STDC__ -# include -#else -# include -#endif + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = x""yes; then : + gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" -#undef shl_load + # + # First check in libc + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 +$as_echo_n "checking for ngettext in libc... " >&6; } +if test "${gt_cv_func_ngettext_libc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_shl_load || defined __stub___shl_load -choke me -#endif +#include int main () { -return shl_load (); +return !ngettext ("","", 1) ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_shl_load=yes +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_ngettext_libc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shl_load=no + gt_cv_func_ngettext_libc=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 +$as_echo "$gt_cv_func_ngettext_libc" >&6; } + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 +$as_echo_n "checking for dgettext in libc... " >&6; } +if test "${gt_cv_func_dgettext_libc+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); +#include + int main () { -return shl_load (); +return !dgettext ("","") ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_shl_load=yes +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_dgettext_libc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no + gt_cv_func_dgettext_libc=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 +$as_echo "$gt_cv_func_dgettext_libc" >&6; } + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi +done -#ifdef __STDC__ -# include -#else -# include -#endif + fi -#undef dlopen + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 +$as_echo_n "checking for bindtextdomain in -lintl... " >&6; } +if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -10930,68 +12371,35 @@ #ifdef __cplusplus extern "C" #endif -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_dlopen || defined __stub___dlopen -choke me -#endif - +char bindtextdomain (); int main () { -return dlopen (); +return bindtextdomain (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_dlopen=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_bindtextdomain=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_dlopen=no + ac_cv_lib_intl_bindtextdomain=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 +$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } +if test "x$ac_cv_lib_intl_bindtextdomain" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_ngettext+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -11000,62 +12408,35 @@ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char ngettext (); int main () { -return dlopen (); +return ngettext (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no + ac_cv_lib_intl_ngettext=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 +$as_echo_n "checking for dgettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_dgettext+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -11064,62 +12445,48 @@ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dgettext (); int main () { -return dlopen (); +return dgettext (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_svld_dlopen=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dgettext=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_intl_dgettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 +$as_echo "$ac_cv_lib_intl_dgettext" >&6; } +if test "x$ac_cv_lib_intl_dgettext" = x""yes; then : + gt_cv_func_dgettext_libintl=yes +fi - ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 +$as_echo_n "checking if -liconv is needed to use gettext... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_ngettext+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -11128,437 +12495,495 @@ #ifdef __cplusplus extern "C" #endif -char dld_link (); +char ngettext (); int main () { -return dld_link (); +return ngettext (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_dld_link=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_dld_link=no + ac_cv_lib_intl_ngettext=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 +$as_echo_n "checking for dcgettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_dcgettext+set}" = set; then : + $as_echo_n "(cached) " >&6 else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11222 "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 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus -extern "C" void exit (int); +extern "C" #endif - -void fnord() { int i=42;} -int main () +char dcgettext (); +int +main () { - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); +return dcgettext (); + ; + return 0; } -_LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dcgettext=yes +else + ac_cv_lib_intl_dcgettext=no fi -rm -fr conftest* - - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 +$as_echo "$ac_cv_lib_intl_dcgettext" >&6; } +if test "x$ac_cv_lib_intl_dcgettext" = x""yes; then : + gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross + : +fi + else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11322 "configure" -#include "confdefs.h" + : +fi -#if HAVE_DLFCN_H -#include -#endif + fi -#include + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +fi +done -/* 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 + LIBS="$glib_save_LIBS" -#ifdef __cplusplus -extern "C" void exit (int); -#endif + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi - exit (status); -} -_LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* + if test "$gt_cv_have_gettext" = "yes"; then +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h -fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi 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 + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" + ;; +esac fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + for ac_func in dcgettext +do : + ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" +if test "x$ac_cv_func_dcgettext" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF +fi +done + MSGFMT_OPTS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 +$as_echo_n "checking if msgfmt accepts -c... " >&6; } + cat >conftest.foo <<_ACEOF +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +_ACEOF +if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 + ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +echo "$as_me: failed input was:" >&5 +sed 's/^/| /' conftest.foo >&5 +fi + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + CATOBJEXT=.mo + DATADIRNAME=lib +fi + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi - - - - - -striplib= -old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac fi + if test "$gt_cv_have_gettext" = "yes" ; then +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + fi + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + fi + # We need to process the po/ directory. + POSUB=po + ac_config_commands="$ac_config_commands default-1" + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done - # Report which library types will actually be built - { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } - test "$can_build_shared" = "no" && enable_shared=no - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 +$as_echo_n "checking for catalogs to be installed... " >&6; } + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 +$as_echo "$LINGUAS" >&6; } + fi + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES +fi + if test "x$enable_nls" = "xyes"; then + INSTALL_NLS_TRUE= + INSTALL_NLS_FALSE='#' +else + INSTALL_NLS_TRUE='#' + INSTALL_NLS_FALSE= +fi +# +# Game detection wanted? +# +# Check whether --enable-game-detection was given. +if test "${enable_game_detection+set}" = set; then : + enableval=$enable_game_detection; enable_game_detection="$enableval" +else + enable_game_detection=yes +fi +if test x$enable_game_detection = xyes; then +$as_echo "#define USE_GAME_DETECTION 1" >>confdefs.h +fi + if test "x$enable_game_detection" = "xyes"; then + GAME_DETECTION_TRUE= + GAME_DETECTION_FALSE='#' +else + GAME_DETECTION_TRUE='#' + GAME_DETECTION_FALSE= +fi - ac_config_commands="$ac_config_commands libtool" +# +# Update notifications wanted? +# +# Check whether --enable-update-notify was given. +if test "${enable_update_notify+set}" = set; then : + enableval=$enable_update_notify; enable_update_notify="$enableval" +else + enable_update_notify=yes +fi +if test x$enable_update_notify = xyes; then +$as_echo "#define UPDATE_NOTIFY 1" >>confdefs.h -# Only expand once: +fi +# +# Check if plugins are enabled +# +want_plugins=yes + if test "x$want_plugins" = "xyes"; then + PLUGINS_TRUE= + PLUGINS_FALSE='#' +else + PLUGINS_TRUE='#' + PLUGINS_FALSE= +fi -LIBTOOL="$LIBTOOL --silent" # # Finish up # -ac_config_headers="$ac_config_headers pre_config.h" +ac_config_headers="$ac_config_headers gfire_config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile pixmaps/Makefile po/Makefile.in" -ac_config_files="$ac_config_files Makefile data/Makefile pixmaps/Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -11587,12 +13012,13 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -11600,8 +13026,8 @@ (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -11624,12 +13050,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -11645,45 +13071,62 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_TRUE}" && test -z "${GTK_FALSE}"; then + as_fn_error "conditional \"GTK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + ac_config_commands="$ac_config_commands po/stamp-it" + + +if test -z "${INSTALL_NLS_TRUE}" && test -z "${INSTALL_NLS_FALSE}"; then + as_fn_error "conditional \"INSTALL_NLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GAME_DETECTION_TRUE}" && test -z "${GAME_DETECTION_FALSE}"; then + as_fn_error "conditional \"GAME_DETECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"PLUGINS\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"PLUGINS\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"PLUGINS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -11693,59 +13136,79 @@ debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +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 + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -11754,20 +13217,18 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -11778,32 +13239,111 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + -# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -11817,13 +13357,17 @@ as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -11838,104 +13382,103 @@ } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -11952,12 +13495,12 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else - case $1 in - -*)set "./$1";; + case $1 in #( + -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -11972,13 +13515,19 @@ exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was +This file was extended by Gfire $as_me 0.9.4, which was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -11991,7 +13540,16 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -11999,22 +13557,25 @@ _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -12025,16 +13586,17 @@ Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +Gfire config.status 0.9.4 +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -12042,11 +13604,12 @@ srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -12068,34 +13631,40 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -12110,27 +13679,29 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # @@ -12144,130 +13715,143 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in SHELL \ +ECHO \ +SED \ GREP \ EGREP \ FGREP \ @@ -12277,6 +13861,7 @@ lt_SP2NL \ lt_NL2SP \ reload_flag \ +OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ @@ -12290,8 +13875,6 @@ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ @@ -12321,12 +13904,13 @@ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -12353,9 +13937,9 @@ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -12363,12 +13947,6 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -12389,9 +13967,10 @@ + _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -12399,15 +13978,16 @@ case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "pre_config.h") CONFIG_HEADERS="$CONFIG_HEADERS pre_config.h" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "gfire_config.h") CONFIG_HEADERS="$CONFIG_HEADERS gfire_config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "pixmaps/Makefile") CONFIG_FILES="$CONFIG_FILES pixmaps/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -12434,7 +14014,7 @@ trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -12445,223 +14025,139 @@ { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -sedpath!$sedpath$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -DEBUG_CFLAGS!$DEBUG_CFLAGS$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -PIDGIN_CFLAGS!$PIDGIN_CFLAGS$ac_delim -PIDGIN_LIBS!$PIDGIN_LIBS$ac_delim -GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim -GLIB_LIBS!$GLIB_LIBS$ac_delim -GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim -GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim -GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim -PLUGINS_TRUE!$PLUGINS_TRUE$ac_delim -PLUGINS_FALSE!$PLUGINS_FALSE$ac_delim -LIBTOOL!$LIBTOOL$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -SED!$SED$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr fi -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -FGREP!$FGREP$ac_delim -LD!$LD$ac_delim -DUMPBIN!$DUMPBIN$ac_delim -ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim -NM!$NM$ac_delim -LN_S!$LN_S$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$ac_delim -lt_ECHO!$lt_ECHO$ac_delim -DSYMUTIL!$DSYMUTIL$ac_delim -NMEDIT!$NMEDIT$ac_delim -LIPO!$LIPO$ac_delim -OTOOL!$OTOOL$ac_delim -OTOOL64!$OTOOL64$ac_delim -CPP!$CPP$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and @@ -12678,20 +14174,128 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -12719,26 +14323,34 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -12748,42 +14360,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -12801,20 +14378,15 @@ q } s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -12859,12 +14431,12 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -12872,36 +14444,37 @@ /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' $ac_file_inputs` in +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -12912,121 +14485,50 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. -_am_arg=$ac_file +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in @@ -13041,7 +14543,7 @@ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -echo X"$_am_arg" | +$as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -13061,30 +14563,40 @@ s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # 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" || + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || -echo X"$mf" | +$as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -13102,68 +14614,33 @@ q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir=$dirpart/$fdir - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -13181,16 +14658,12 @@ q } s/.*/./; q'` - test -d "$as_dir" && break + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" done -done +} ;; "libtool":C) @@ -13213,7 +14686,8 @@ # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -13245,6 +14719,9 @@ # ### BEGIN LIBTOOL CONFIG +# Whether or not to build static libraries. +build_old_libs=$enable_static + # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision @@ -13252,15 +14729,18 @@ # Whether or not to build shared libraries. build_libtool_libs=$enable_shared -# Whether or not to build static libraries. -build_old_libs=$enable_static - # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + # The host system. host_alias=$host_alias host=$host @@ -13310,9 +14790,8 @@ # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -13332,6 +14811,9 @@ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -13353,12 +14835,6 @@ # The name of the directory that contains temporary libtool files. objdir=$objdir -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO - # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -13421,6 +14897,9 @@ # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -13460,6 +14939,10 @@ # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -13719,7 +15202,7 @@ func_dirname () { # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else @@ -13730,7 +15213,7 @@ # func_basename file func_basename () { - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + func_basename_result=`$ECHO "${1}" | $SED "$basename"` } @@ -13743,10 +15226,8 @@ func_stripname () { case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } @@ -13757,20 +15238,20 @@ # func_opt_split func_opt_split () { - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_xform libobj-or-source func_xform () { - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... @@ -13824,16 +15305,41 @@ chmod +x "$ofile" ;; + "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac ;; + "po/stamp-it":C) + if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then + as_fn_error "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 + fi + rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" + >"po/stamp-it.tmp" + sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" + + sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r po/POTFILES + } + ' "po/Makefile.in" >"po/Makefile" + rm -f "po/Makefile.tmp" + mv "po/stamp-it.tmp" "po/stamp-it" + ;; esac done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -13853,7 +15359,11 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -13861,33 +15371,42 @@ echo "Configuration complete." echo; -pidginlibdir=$(pkg-config pidgin --variable=libdir) -pidginpfxdir=$(pkg-config pidgin --variable=prefix) - echo "Debugging enabled.............: $enable_debug" -echo "Pidgin package prefix.........: $pidginpfxdir" -echo "Pidgin package libdir.........: $pidginlibdir" +echo "GTK enabled...................: $enable_gtk" +echo "libnotify enabled.............: $enable_libnotify" +echo "DBus status change enabled....: $enable_dbus_status" +echo "Game detection enabled........: $enable_game_detection" +echo "Notify on new version.........: $enable_update_notify" +echo "NLS enabled...................: $enable_nls" + +echo; + +purplelibdir=$(pkg-config purple --variable=libdir) +purplepfxdir=$(pkg-config purple --variable=prefix) + +echo "Libpurple package prefix......: $purplepfxdir" +echo "Libpurple package libdir......: $purplelibdir" echo "Install prefix................: $prefix" gfld=`eval echo $libdir` gfld=`eval echo $gfld` echo "Install libdir................: $gfld" -echo -n "Pidgin libdir detected........: " -if test -d "$gfld/pidgin"; then +echo -n "Purple libdir detected........: " +if test -d "$gfld/purple-2"; then echo "yes" else echo "no!" echo; - echo "We did not detect a Pidgin directory off of the \"install libdir\": $gfld/pidgin" + echo "We did not detect a libpurple directory off of the \"install libdir\": $gfld/purple-2" echo; echo "This is not a fatal error, as we cannot detect all cases. For most" echo "users though, we should be able to detect this directory. The compile" echo "will not fail, however the install may put files in the wrong place." echo; - echo "The Pidgin package libdir and prefix is where Pidgin believes itself to" + echo "The libpurple package libdir and prefix is where libpurple believes itself to" echo "be installed. The Install prefix and libdir should match them." - echo "use ./configure --prefix=$pidginpfxdir to fix this," - echo "and if necessary use: ./configure --prefix=$pidginpfxdir --libdir=$pidginlibdir" + echo "use ./configure --prefix=$purplepfxdir to fix this," + echo "and if necessary use: ./configure --prefix=$purplepfxdir --libdir=$purplelibdir" fi echo; diff -Nru gfire-0.8.3/configure.ac gfire-0.9.4/configure.ac --- gfire-0.8.3/configure.ac 2011-09-24 19:29:47.000000000 +0000 +++ gfire-0.9.4/configure.ac 2011-03-23 19:56:50.000000000 +0000 @@ -3,14 +3,23 @@ # thank you guys!!! # -GFIRE_VERSION="`cat ./VERSION`" +# Get Gfire version +m4_define(gfire_version, regexp(m4_include(VERSION), [\([0-9a-zA-Z.-]+\)], [\1])) +m4_define(gfire_version_patch, regexp(gfire_version, [\([0-9]+\).\([0-9]+\).\([0-9]+\)], [\3])) +m4_define(gfire_version_minor, regexp(gfire_version, [\([0-9]+\).\([0-9]+\).\([0-9]+\)], [\2])) +m4_define(gfire_version_major, regexp(gfire_version, [\([0-9]+\).\([0-9]+\).\([0-9]+\)], [\1])) +m4_define(gfire_version_suffix, regexp(gfire_version, [\([0-9]+\).\([0-9]+\).\([0-9]+\)-?\([a-zA-Z0-9]+\)], [\4])) -AC_INIT(src/gfire.c) AC_PREREQ(2.50) +AC_INIT([Gfire], [gfire_version], [support@gfireproject.org]) +AC_CONFIG_SRCDIR([src/gfire.c]) + + +AM_INIT_AUTOMAKE([gfire], [gfire_version], "") +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -AM_INIT_AUTOMAKE([Gfire], "$GFIRE_VERSION", "") -AC_DEFINE_UNQUOTED(GFIRE_VERSION, "$GFIRE_VERSION", [Gfire Version]) AC_PATH_PROG(sedpath, sed) +AC_CONFIG_MACRO_DIR([m4]) # # Define Gfire header @@ -21,6 +30,12 @@ ]) AH_BOTTOM([#endif]) +AC_DEFINE_UNQUOTED([GFIRE_VERSION_SUFFIX], ["gfire_version_suffix"], [Gfire version suffix]) +AC_DEFINE([GFIRE_VERSION_PATCH], [gfire_version_patch], [Gfire patch version]) +AC_DEFINE([GFIRE_VERSION_MINOR], [gfire_version_minor], [Gfire minor version]) +AC_DEFINE([GFIRE_VERSION_MAJOR], [gfire_version_major], [Gfire major version]) +AC_DEFINE_UNQUOTED([GFIRE_VERSION_STRING], ["gfire_version"], [Gfire version string]) + # # Check C compiler # @@ -28,94 +43,174 @@ AC_PROG_CC CFLAGS="$CFLAGS_save" -AC_ARG_ENABLE(debug, [ --enable-debug Compile with debugging support.],, enable_debug=no) +# +# Setup libtool +# +AC_DISABLE_STATIC +AM_PROG_LIBTOOL +LIBTOOL="$LIBTOOL --silent" + +AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Compile with debugging support.]), enable_debug="$enableval", enable_debug=no) -if test "$enable_debug"="yes"; then - DEBUG_CFLAGS="$DEBUG_CFLAGS -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" +if test x$enable_debug != xno; then + DEBUG_CFLAGS="$DEBUG_CFLAGS -g -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.]) + if test x$enable_debug = xverbose; then + AC_DEFINE(DEBUG_VERBOSE, 1, [Define if verbose debugging is enabled.]) + fi fi AC_SUBST(DEBUG_CFLAGS) - + if test "x$GCC"="xyes"; then - CFLAGS="$CFLAGS -Wall -g3" + CFLAGS="$CFLAGS -Wall" fi AC_SUBST(CFLAGS) # # Check for Pidgin # -PKG_CHECK_MODULES(PIDGIN, pidgin, [AC_DEFINE(HAVE_PIDGIN, 1, [Define if we've found pidgin.])]) +PKG_CHECK_MODULES(PURPLE, purple, [AC_DEFINE(HAVE_PURPLE, 1, [Define if we've found libpurple.])]) -AC_SUBST(PIDGIN_CFLAGS) -AC_SUBST(PIDGIN_LIBS) +AC_SUBST(PURPLE_CFLAGS) +AC_SUBST(PURPLE_LIBS) # # Check for GTK+ and other dependencies # -AM_PATH_GLIB_2_0(2.0.0,, AC_MSG_ERROR([ -*** GLib 2.0 is required to build gfire; please make sure you have -*** the GLib development headers installed. The latest version of GLib is +AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk], [Don't compile with GTK+ support. (no server browser, no game manager)]), enable_gtk="$enableval", enable_gtk=yes) +AC_ARG_ENABLE(libnotify, AS_HELP_STRING([--enable-libnotify], [Compile with libnotify support. (depends on GTK flag)]), enable_libnotify="$enableval", enable_libnotify=no) + +if test x$enable_gtk = xyes; then + PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.14.0, AC_DEFINE(HAVE_GTK, 1, [Define if we've support for GTK+]), AC_MSG_ERROR([ +*** GTK+ 2.0 is required to build Gfire; please make sure you have +*** the GTK+ development headers installed. The latest version of GTK is *** always available at http://www.gtk.org])) + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + + if test x$enable_libnotify = xyes; then + PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.3.2, AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if we've support for libnotify]), AC_MSG_ERROR([ +*** You have requested to build Gfire with libnotify support. You do not have it; +*** please make sure you have the libnotify development headers installed. +*** The latest version of libnotify is always available at http://galago-project.org])) + AC_SUBST(LIBNOTIFY_CFLAGS) + AC_SUBST(LIBNOTIFY_LIBS) + fi +fi +AM_CONDITIONAL(GTK, test "x$enable_gtk" = "xyes") + +AC_ARG_ENABLE(dbus-status, AS_HELP_STRING([--enable-dbus-status], [Enable status change for other IM clients (currently only kmess).]), enable_dbus_status="$enableval", enable_dbus_status=no) +if test $enable_dbus_status = "yes"; then + PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1, AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if we've support for dbus-glib]), AC_MSG_ERROR([ +*** Glib DBus bindings are required to build Gfire with your current configure flags; +*** please make sure you have the GLib DBus development headers installed. +*** The latest version of GLib is always available at http://www.gtk.org])) + AC_SUBST(DBUS_GLIB_CFLAGS) + AC_SUBST(DBUS_GLIB_LIBS) + AC_DEFINE([USE_DBUS_STATUS_CHANGE], [1], [Use DBus status change if defined]) +fi + +AM_PATH_GLIB_2_0(2.18.0,, AC_MSG_ERROR([ +*** GLib 2.0 is required to build Gfire; please make sure you have +*** the GLib development headers installed. The latest version of GLib is +*** always available at http://www.gtk.org]), gthread) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) # -# Check if plugins are enabled +# Internationalisation support # -want_plugins=yes -AM_CONDITIONAL(PLUGINS, test "$want_plugins"="yes") -# AM_GLIB_GNU_GETTEXT +AC_ARG_ENABLE(nls, AS_HELP_STRING([--disable-nls], [disable installation of translation files]), enable_nls="$enableval", enable_nls=yes) +if test x$enable_nls = xyes; then + AC_PROG_INTLTOOL + GETTEXT_PACKAGE="$PACKAGE" + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used]) + + ALL_LINGUAS="cs de ee es fr pl ro sk sv" + AM_GLIB_GNU_GETTEXT +fi +AM_CONDITIONAL(INSTALL_NLS, test "x$enable_nls" = "xyes") # -# Setup libtool +# Game detection wanted? # -AM_PROG_LIBTOOL -LIBTOOL="$LIBTOOL --silent" +AC_ARG_ENABLE(game-detection, AS_HELP_STRING([--disable-game-detection], [Disable game detection. e.g. use this if you intend to build Gfire for embedded devices/servers.]), enable_game_detection="$enableval", enable_game_detection=yes) +if test x$enable_game_detection = xyes; then + AC_DEFINE([USE_GAME_DETECTION], [1], [Support game detection]) +fi +AM_CONDITIONAL(GAME_DETECTION, test "x$enable_game_detection" = "xyes") + +# +# Update notifications wanted? +# +AC_ARG_ENABLE(update-notify, AS_HELP_STRING([--disable-update-notify], [Disable notifications on new available versions of Gfire. Use this if you intend to build Gfire for a package.]), enable_update_notify="$enableval", enable_update_notify=yes) +if test x$enable_update_notify = xyes; then + AC_DEFINE([UPDATE_NOTIFY], [1], [Show notifications about newer versions]) +fi + +# +# Check if plugins are enabled +# +want_plugins=yes +AM_CONDITIONAL(PLUGINS, test "x$want_plugins" = "xyes") # # Finish up # -AM_CONFIG_HEADER(pre_config.h) +AM_CONFIG_HEADER(gfire_config.h) -AC_OUTPUT([ -Makefile -data/Makefile -pixmaps/Makefile -src/Makefile +AC_CONFIG_FILES([ + Makefile + src/Makefile + data/Makefile + pixmaps/Makefile + po/Makefile.in ]) +AC_OUTPUT + echo; echo "Configuration complete." echo; -pidginlibdir=$(pkg-config pidgin --variable=libdir) -pidginpfxdir=$(pkg-config pidgin --variable=prefix) - echo "Debugging enabled.............: $enable_debug" -echo "Pidgin package prefix.........: $pidginpfxdir" -echo "Pidgin package libdir.........: $pidginlibdir" +echo "GTK enabled...................: $enable_gtk" +echo "libnotify enabled.............: $enable_libnotify" +echo "DBus status change enabled....: $enable_dbus_status" +echo "Game detection enabled........: $enable_game_detection" +echo "Notify on new version.........: $enable_update_notify" +echo "NLS enabled...................: $enable_nls" + +echo; + +purplelibdir=$(pkg-config purple --variable=libdir) +purplepfxdir=$(pkg-config purple --variable=prefix) + +echo "Libpurple package prefix......: $purplepfxdir" +echo "Libpurple package libdir......: $purplelibdir" echo "Install prefix................: $prefix" gfld=`eval echo $libdir` gfld=`eval echo $gfld` echo "Install libdir................: $gfld" -echo -n "Pidgin libdir detected........: " -if test -d "$gfld/pidgin"; then +echo -n "Purple libdir detected........: " +if test -d "$gfld/purple-2"; then echo "yes" else echo "no!" echo; - echo "We did not detect a Pidgin directory off of the \"install libdir\": $gfld/pidgin" + echo "We did not detect a libpurple directory off of the \"install libdir\": $gfld/purple-2" echo; echo "This is not a fatal error, as we cannot detect all cases. For most" echo "users though, we should be able to detect this directory. The compile" echo "will not fail, however the install may put files in the wrong place." echo; - echo "The Pidgin package libdir and prefix is where Pidgin believes itself to" + echo "The libpurple package libdir and prefix is where libpurple believes itself to" echo "be installed. The Install prefix and libdir should match them." - echo "use ./configure --prefix=$pidginpfxdir to fix this," - echo "and if necessary use: ./configure --prefix=$pidginpfxdir --libdir=$pidginlibdir" + echo "use ./configure --prefix=$purplepfxdir to fix this," + echo "and if necessary use: ./configure --prefix=$purplepfxdir --libdir=$purplelibdir" fi echo; diff -Nru gfire-0.8.3/data/games.glade gfire-0.9.4/data/games.glade --- gfire-0.8.3/data/games.glade 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/data/games.glade 2010-03-06 14:29:14.000000000 +0000 @@ -0,0 +1,538 @@ + + + + + + Manage Games + center + 600 + 350 + True + + + True + 5 + 5 + 5 + 5 + + + True + True + + + True + vertical + + + True + 0 + none + + + True + 12 + + + True + 3 + 2 + + + 145 + True + 0 + Game: + + + GTK_FILL + + + + + True + 0 + Detection Executable: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Launch Executable: + + + 2 + 3 + GTK_FILL + + + + + 30 + True + True + + + + 1 + 2 + 10 + + + + + True + + + 1 + 2 + 1 + 2 + 10 + + + + + True + + + Use same file + True + True + False + True + True + + + False + 5 + 0 + + + + + True + False + + + 5 + 1 + + + + + 1 + 2 + 2 + 3 + 5 + + + + + + + + + True + <b>Basic settings</b> + True + + + + + False + 5 + 0 + + + + + True + True + + + True + 12 + + + True + 2 + + + 145 + True + 0 + Launch prefix: + + + GTK_FILL + + + + + True + True + + + + 1 + 2 + 10 + + + + + + + + + True + <b>Advanced settings</b> + True + + + + + False + 5 + 1 + + + + + True + + + False + end + 3 + + + + + True + + + gtk-add + True + True + True + True + + + 0 + + + + + gtk-close + True + True + True + True + + + 1 + + + + + False + end + 2 + + + + + + + True + Add a game + + + False + + + + + True + vertical + + + True + 0 + none + + + True + 12 + + + True + 3 + 2 + + + 145 + True + 0 + Game: + + + GTK_FILL + + + + + True + 0 + Detection Executable: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Launch Executable: + + + 2 + 3 + GTK_FILL + + + + + True + + + 1 + 2 + 1 + 2 + 10 + + + + + True + + + Use same file + True + True + False + True + True + + + False + 5 + 0 + + + + + True + False + + + 5 + 1 + + + + + 1 + 2 + 2 + 3 + 5 + + + + + 30 + True + edit_game_list_store + + + + 0 + + + + + 1 + 2 + + 10 + + + + + + + + + True + <b>Basic settings</b> + True + + + + + False + 5 + 0 + + + + + True + True + True + + + True + 12 + + + True + 2 + + + 145 + True + 0 + Launch prefix: + + + GTK_FILL + + + + + True + True + + + + 1 + 2 + 10 + + + + + + + + + True + <b>Advanced settings</b> + True + + + + + False + 5 + 1 + + + + + True + + + False + end + 3 + + + + + True + + + gtk-apply + True + True + True + True + + + 0 + + + + + gtk-remove + True + True + True + True + + + 1 + + + + + gtk-close + True + True + True + True + + + 2 + + + + + False + end + 2 + + + + + 1 + + + + + True + Edit or remove a game + + + 1 + False + + + + + + + + + + + + + + diff -Nru gfire-0.8.3/data/gfire_manage.glade gfire-0.9.4/data/gfire_manage.glade --- gfire-0.8.3/data/gfire_manage.glade 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/data/gfire_manage.glade 1970-01-01 00:00:00.000000000 +0000 @@ -1,405 +0,0 @@ - - - - - - - - - - Native game - - - Non-native game - - - - - - - - - - 500 - 280 - True - Manage Games - GTK_WIN_POS_CENTER - True - - - True - 5 - 5 - 5 - 5 - - - True - True - - - True - - - True - 5 - 5 - <b>The game ID is the Xfire game ID. Visit the Gfire wiki for more information.</b> - True - True - - - False - 5 - - - - - True - 3 - 2 - - - True - True - +connect @ip@:@port@ - - - 1 - 2 - 2 - 3 - 10 - 2 - - - - - True - 0 - 30 - Connect option: - - - 2 - 3 - GTK_FILL - - - - - True - 0 - 30 - Game ID: - - - GTK_FILL - - - - - True - True - 4097 - - - 1 - 2 - 10 - 2 - - - - - True - 0 - 30 - Game path: - - - 1 - 2 - GTK_FILL - - - - - True - True - /usr/local/games/enemy-territory/et.x86 - - - 1 - 2 - 1 - 2 - 10 - 2 - - - - - False - 1 - - - - - True - 1 - add_type_list_store - - - - 0 - - - - - False - 2 - - - - - True - - - False - 3 - - - - - True - - - True - True - True - gtk-close - True - - - - - True - True - True - gtk-add - True - - - 1 - - - - - False - 4 - - - - - - - True - Add game - - - False - - - - - True - - - True - 5 - 5 - <b>Choose a game from the list. Removing a game will only remove it from Gfire.</b> - True - True - - - False - 5 - - - - - True - 3 - 2 - - - True - True - - - 1 - 2 - 2 - 3 - 10 - 2 - - - - - True - 0 - 30 - Launch option: - - - 2 - 3 - GTK_FILL - - - - - True - 0 - 30 - Game path: - - - GTK_FILL - - - - - True - True - - - 1 - 2 - 10 - 2 - - - - - True - 0 - 30 - Connect option: - - - 1 - 2 - GTK_FILL - - - - - True - True - - - 1 - 2 - 1 - 2 - 10 - 2 - - - - - False - 1 - - - - - True - 1 - edit_games_list_store - - - - 0 - - - - - False - 2 - - - - - True - - - False - 3 - - - - - True - - - True - True - True - gtk-close - True - - - - - True - True - True - gtk-remove - True - - - 1 - - - - - True - True - True - gtk-apply - True - - - 2 - - - - - False - 4 - - - - - - - True - Edit or remove game - - - 1 - False - - - - - - - - diff -Nru gfire-0.8.3/data/gfire_processes.xml gfire-0.9.4/data/gfire_processes.xml --- gfire-0.8.3/data/gfire_processes.xml 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/data/gfire_processes.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru gfire-0.8.3/data/Makefile.am gfire-0.9.4/data/Makefile.am --- gfire-0.8.3/data/Makefile.am 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/data/Makefile.am 2010-01-09 14:57:00.000000000 +0000 @@ -1,12 +1,4 @@ -EXTRA_DIST = gfire_manage.glade \ - scripts/server_detection/4097.py +EXTRA_DIST = games.glade servers.glade gfire_datadir = $(datadir)/purple/gfire -gfire_data_scriptsdir = $(gfire_datadir)/scripts -gfire_data_server_detectiondir = $(gfire_data_scriptsdir)/server_detection -gfire_data_server_detection_toolsdir = $(gfire_data_server_detectiondir)/tools - -gfire_data_DATA = gfire_manage.glade -gfire_data_scripts_DATA = -gfire_data_server_detection_DATA = scripts/server_detection/4097.py -gfire_data_server_detection_tools_DATA = +gfire_data_DATA = games.glade servers.glade diff -Nru gfire-0.8.3/data/Makefile.in gfire-0.9.4/data/Makefile.in --- gfire-0.8.3/data/Makefile.in 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/data/Makefile.in 2011-03-23 19:57:03.000000000 +0000 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@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 @@ -35,12 +37,19 @@ subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/VERSION $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/pre_config.h +CONFIG_HEADER = $(top_builddir)/gfire_config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -48,32 +57,45 @@ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(gfire_datadir)" \ - "$(DESTDIR)$(gfire_data_scriptsdir)" \ - "$(DESTDIR)$(gfire_data_server_detectiondir)" \ - "$(DESTDIR)$(gfire_data_server_detection_toolsdir)" -gfire_dataDATA_INSTALL = $(INSTALL_DATA) -gfire_data_scriptsDATA_INSTALL = $(INSTALL_DATA) -gfire_data_server_detectionDATA_INSTALL = $(INSTALL_DATA) -gfire_data_server_detection_toolsDATA_INSTALL = $(INSTALL_DATA) -DATA = $(gfire_data_DATA) $(gfire_data_scripts_DATA) \ - $(gfire_data_server_detection_DATA) \ - $(gfire_data_server_detection_tools_DATA) +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__installdirs = "$(DESTDIR)$(gfire_datadir)" +DATA = $(gfire_data_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ +DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -85,19 +107,32 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ +LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -106,8 +141,13 @@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -116,17 +156,26 @@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIDGIN_CFLAGS = @PIDGIN_CFLAGS@ -PIDGIN_LIBS = @PIDGIN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PURPLE_CFLAGS = @PURPLE_CFLAGS@ +PURPLE_LIBS = @PURPLE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -163,7 +212,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -177,19 +225,12 @@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXTRA_DIST = gfire_manage.glade \ - scripts/server_detection/4097.py - +EXTRA_DIST = games.glade servers.glade gfire_datadir = $(datadir)/purple/gfire -gfire_data_scriptsdir = $(gfire_datadir)/scripts -gfire_data_server_detectiondir = $(gfire_data_scriptsdir)/server_detection -gfire_data_server_detection_toolsdir = $(gfire_data_server_detectiondir)/tools -gfire_data_DATA = gfire_manage.glade -gfire_data_scripts_DATA = -gfire_data_server_detection_DATA = scripts/server_detection/4097.py -gfire_data_server_detection_tools_DATA = +gfire_data_DATA = games.glade servers.glade all: all-am .SUFFIXES: @@ -197,14 +238,14 @@ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( 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 data/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu data/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -222,6 +263,7 @@ 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 @@ -231,71 +273,23 @@ install-gfire_dataDATA: $(gfire_data_DATA) @$(NORMAL_INSTALL) test -z "$(gfire_datadir)" || $(MKDIR_P) "$(DESTDIR)$(gfire_datadir)" - @list='$(gfire_data_DATA)'; for p in $$list; do \ + @list='$(gfire_data_DATA)'; test -n "$(gfire_datadir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(gfire_dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gfire_datadir)/$$f'"; \ - $(gfire_dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gfire_datadir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(gfire_datadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(gfire_datadir)" || exit $$?; \ done uninstall-gfire_dataDATA: @$(NORMAL_UNINSTALL) - @list='$(gfire_data_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(gfire_datadir)/$$f'"; \ - rm -f "$(DESTDIR)$(gfire_datadir)/$$f"; \ - done -install-gfire_data_scriptsDATA: $(gfire_data_scripts_DATA) - @$(NORMAL_INSTALL) - test -z "$(gfire_data_scriptsdir)" || $(MKDIR_P) "$(DESTDIR)$(gfire_data_scriptsdir)" - @list='$(gfire_data_scripts_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(gfire_data_scriptsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gfire_data_scriptsdir)/$$f'"; \ - $(gfire_data_scriptsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gfire_data_scriptsdir)/$$f"; \ - done - -uninstall-gfire_data_scriptsDATA: - @$(NORMAL_UNINSTALL) - @list='$(gfire_data_scripts_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(gfire_data_scriptsdir)/$$f'"; \ - rm -f "$(DESTDIR)$(gfire_data_scriptsdir)/$$f"; \ - done -install-gfire_data_server_detectionDATA: $(gfire_data_server_detection_DATA) - @$(NORMAL_INSTALL) - test -z "$(gfire_data_server_detectiondir)" || $(MKDIR_P) "$(DESTDIR)$(gfire_data_server_detectiondir)" - @list='$(gfire_data_server_detection_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(gfire_data_server_detectionDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gfire_data_server_detectiondir)/$$f'"; \ - $(gfire_data_server_detectionDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gfire_data_server_detectiondir)/$$f"; \ - done - -uninstall-gfire_data_server_detectionDATA: - @$(NORMAL_UNINSTALL) - @list='$(gfire_data_server_detection_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(gfire_data_server_detectiondir)/$$f'"; \ - rm -f "$(DESTDIR)$(gfire_data_server_detectiondir)/$$f"; \ - done -install-gfire_data_server_detection_toolsDATA: $(gfire_data_server_detection_tools_DATA) - @$(NORMAL_INSTALL) - test -z "$(gfire_data_server_detection_toolsdir)" || $(MKDIR_P) "$(DESTDIR)$(gfire_data_server_detection_toolsdir)" - @list='$(gfire_data_server_detection_tools_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(gfire_data_server_detection_toolsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gfire_data_server_detection_toolsdir)/$$f'"; \ - $(gfire_data_server_detection_toolsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gfire_data_server_detection_toolsdir)/$$f"; \ - done - -uninstall-gfire_data_server_detection_toolsDATA: - @$(NORMAL_UNINSTALL) - @list='$(gfire_data_server_detection_tools_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(gfire_data_server_detection_toolsdir)/$$f'"; \ - rm -f "$(DESTDIR)$(gfire_data_server_detection_toolsdir)/$$f"; \ - done + @list='$(gfire_data_DATA)'; test -n "$(gfire_datadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(gfire_datadir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(gfire_datadir)" && rm -f $$files tags: TAGS TAGS: @@ -319,13 +313,17 @@ 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -333,7 +331,7 @@ check: check-am all-am: Makefile $(DATA) installdirs: - for dir in "$(DESTDIR)$(gfire_datadir)" "$(DESTDIR)$(gfire_data_scriptsdir)" "$(DESTDIR)$(gfire_data_server_detectiondir)" "$(DESTDIR)$(gfire_data_server_detection_toolsdir)"; do \ + for dir in "$(DESTDIR)$(gfire_datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -356,6 +354,7 @@ 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" @@ -374,28 +373,38 @@ html: html-am +html-am: + info: info-am info-am: -install-data-am: install-gfire_dataDATA install-gfire_data_scriptsDATA \ - install-gfire_data_server_detectionDATA \ - install-gfire_data_server_detection_toolsDATA +install-data-am: install-gfire_dataDATA 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 @@ -414,10 +423,7 @@ ps-am: -uninstall-am: uninstall-gfire_dataDATA \ - uninstall-gfire_data_scriptsDATA \ - uninstall-gfire_data_server_detectionDATA \ - uninstall-gfire_data_server_detection_toolsDATA +uninstall-am: uninstall-gfire_dataDATA .MAKE: install-am install-strip @@ -426,18 +432,13 @@ 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-gfire_dataDATA \ - install-gfire_data_scriptsDATA \ - install-gfire_data_server_detectionDATA \ - install-gfire_data_server_detection_toolsDATA 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 uninstall-gfire_dataDATA \ - uninstall-gfire_data_scriptsDATA \ - uninstall-gfire_data_server_detectionDATA \ - uninstall-gfire_data_server_detection_toolsDATA + 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 uninstall-gfire_dataDATA + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru gfire-0.8.3/data/Makefile.mingw gfire-0.9.4/data/Makefile.mingw --- gfire-0.8.3/data/Makefile.mingw 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/data/Makefile.mingw 2010-01-09 14:57:00.000000000 +0000 @@ -0,0 +1,16 @@ +GFIRE_DIR = .. +include ../mingw.mak + +.PHONY: all clean + +FILES = games.glade servers.glade + +all: ${FILES} + +clean: + +install: all + mkdir -p ${WIN32_INSTALL_DIR}/purple/gfire + list='${FILES}'; for file in $$list; do \ + cp $$file ${WIN32_INSTALL_DIR}/purple/gfire/; \ + done; \ No newline at end of file diff -Nru gfire-0.8.3/data/scripts/server_detection/4097.py gfire-0.9.4/data/scripts/server_detection/4097.py --- gfire-0.8.3/data/scripts/server_detection/4097.py 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/data/scripts/server_detection/4097.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -import subprocess, time, string, re, itertools - -seconds = 5 -command = ['sudo', 'tcpdump', '-f'] -grep = 'UDP' - -regex = re.compile('\d*:\d*:\d*.\d* IP \d*.\d*.\d*.\d*.\d\d\d\d\d > \d*-\d*-\d*-\d*.*, length*') -regex_ip = re.compile('\d*.\d*.\d*.\d*.\d\d\d\d\d') - -try: - output = subprocess.Popen(command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False) - time.sleep(seconds) - output.kill() - - ips = 0 - for line in itertools.islice(output.stdout, 3, None): - if grep in line and re.match(regex, line) and ips < 20: - line_fields = line.strip().split() - ip_full = line_fields[2] - ip_fields = ip_full.split('.') - print "%s.%s.%s.%s:%s" % (ip_fields[0], ip_fields[1], ip_fields[2], ip_fields[3], ip_fields[4]) - -except OSError: - print "OSError" diff -Nru gfire-0.8.3/data/servers.glade gfire-0.9.4/data/servers.glade --- gfire-0.8.3/data/servers.glade 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/data/servers.glade 2010-09-09 14:37:59.000000000 +0000 @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Server Browser + center + 650 + 400 + True + + + True + vertical + + + True + icons + + + True + False + True + Refresh the server list + True + gtk-refresh + + + False + True + + + + + True + False + True + Display further information about this server + True + gtk-info + + + False + True + + + + + True + False + True + Join this server + True + gtk-connect + + + False + True + + + + + True + + + False + True + + + + + True + False + True + Add a new favourite server + gtk-add + True + gtk-add + + + False + True + + + + + True + False + True + Remove this favourite server + True + gtk-remove + + + False + True + + + + + True + + + False + True + + + + + True + True + Close the server browser + True + gtk-quit + + + False + True + + + + + True + + + True + True + Select the game you want to query servers for... + game_list_store + + + + 0 + + + + + + + True + True + + + + + False + 0 + + + + + True + True + never + + + True + True + servers_list_tree_store + False + True + True + 0 + + + True + fixed + 350 + Name + True + True + True + 0 + + + + 0 + + + + + + + True + fixed + 50 + Ping + True + True + True + 1 + + + + 1 + + + + + + + True + fixed + 75 + Players + True + True + True + 2 + + + + 2 + + + + + + + True + fixed + 100 + Map + True + True + True + 3 + + + + 3 + + + + + + + + + 1 + + + + + + + 5 + Add Favourite Server + False + center + normal + + + + True + vertical + 2 + + + True + 2 + 2 + 5 + + + True + True + + + + 1 + 2 + + + + + 45 + True + True + 5 + + + + 1 + 2 + 1 + 2 + + + + + True + 0 + IP Address: + + + + + True + 0 + Port: + + + 1 + 2 + + + + + False + 1 + + + + + True + end + + + gtk-add + True + True + True + True + + + False + False + 0 + + + + + gtk-cancel + True + True + True + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + add_button + cancel_button + + + diff -Nru gfire-0.8.3/debian/changelog gfire-0.9.4/debian/changelog --- gfire-0.8.3/debian/changelog 2011-09-24 19:29:47.000000000 +0000 +++ gfire-0.9.4/debian/changelog 2011-09-24 19:08:17.000000000 +0000 @@ -1,3 +1,15 @@ +gfire (0.9.4-0ubuntu1) oneiric; urgency=low + + * New upstream release. (LP: #845552, LP: #852607) + - drop unneeded configure* patches + * remove la file + * use dh-autoreconf to regenerate autofoo files + * debian/watch: search for bz2 tarball + * update to standard 3.9.2, no further changes required + * change to source format 3.0 (quilt) + + -- Julian Taylor Sun, 18 Sep 2011 16:19:16 +0200 + gfire (0.8.3-0ubuntu2) oneiric; urgency=low * configure.ac, configure: diff -Nru gfire-0.8.3/debian/control gfire-0.9.4/debian/control --- gfire-0.8.3/debian/control 2011-09-24 19:29:47.000000000 +0000 +++ gfire-0.9.4/debian/control 2011-09-24 19:07:36.000000000 +0000 @@ -3,8 +3,8 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Jacob Peddicord -Build-Depends: cdbs, debhelper (>= 6), autotools-dev, pidgin-dev -Standards-Version: 3.8.3 +Build-Depends: cdbs, debhelper (>= 6), dh-autoreconf, pidgin-dev +Standards-Version: 3.9.2 Homepage: http://gfireproject.org/ Package: gfire diff -Nru gfire-0.8.3/debian/rules gfire-0.9.4/debian/rules --- gfire-0.8.3/debian/rules 2011-09-24 19:29:47.000000000 +0000 +++ gfire-0.9.4/debian/rules 2011-09-24 19:07:36.000000000 +0000 @@ -2,6 +2,10 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/autoreconf.mk # Do not install the README file, as it's uninteresting DEB_INSTALL_DOCS_ALL= + +install/gfire:: + find $(CURDIR) -name "*.la" -delete diff -Nru gfire-0.8.3/debian/source/format gfire-0.9.4/debian/source/format --- gfire-0.8.3/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/debian/source/format 2011-09-24 19:29:48.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru gfire-0.8.3/debian/watch gfire-0.9.4/debian/watch --- gfire-0.8.3/debian/watch 2011-09-24 19:29:47.000000000 +0000 +++ gfire-0.9.4/debian/watch 2011-09-24 19:07:36.000000000 +0000 @@ -1,3 +1,3 @@ version=3 -http://sf.net/gfire/pidgin-gfire-(.*)\.tar\.gz +http://sf.net/gfire/pidgin-gfire-(.*)\.tar\.bz2 diff -Nru gfire-0.8.3/depcomp gfire-0.9.4/depcomp --- gfire-0.8.3/depcomp 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/depcomp 2010-01-09 14:58:28.000000000 +0000 @@ -1,7 +1,10 @@ #! /bin/sh - # depcomp - compile a program generating dependencies as side-effects -# Copyright 1999, 2000 Free Software Foundation, Inc. + +scriptversion=2007-03-29.01 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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 @@ -15,8 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -25,13 +28,45 @@ # Originally written by Alexandre Oliva . +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi -# `libtool' can also be set to `yes' or `no'. -depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +# 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" @@ -57,7 +92,20 @@ ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## 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 @@ -163,31 +211,43 @@ aix) # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. 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. - stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - outname="$stripped.o" + # 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 "$tmpdepfile" + 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -197,37 +257,136 @@ rm -f "$tmpdepfile" ;; +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +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 AIX compiler uses -MD to generate dependencies as a side + # 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 + # 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$//'` - tmpdepfile1="$object.d" - tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 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" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi - if test -f "$tmpdepfile1"; then - tmpdepfile="$tmpdepfile1" - else - tmpdepfile="$tmpdepfile2" - fi + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a space and a tab in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -240,34 +399,42 @@ dashmstdout) # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - test -z "$dashmflag" && dashmflag=-M - ( IFS=" " - case " $* " in - *" --mode=compile "*) # this is libtool, let us make it quiet - for arg - do # cycle over the arguments - case "$arg" in - "--mode=compile") - # insert --quiet before "--mode=compile" - set fnord "$@" --quiet - shift # fnord - ;; - esac - set fnord "$@" "$arg" - shift # fnord - shift # "$arg" - done + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg ;; esac - "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - ) & - proc=$! - "$@" - stat=$? - wait "$proc" - if test "$stat" != 0; then exit $stat; fi + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' @@ -285,36 +452,40 @@ ;; makedepend) - # X makedepend - ( - shift - cleared=no - for arg in "$@"; do - case $cleared in no) - set ""; shift - cleared=yes - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift;; - -*) - ;; - *) - set fnord "$@" "$arg"; shift;; - esac + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" - ) & - proc=$! - "$@" - stat=$? - wait "$proc" - if test "$stat" != 0; then exit $stat; fi + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tail +3 "$tmpdepfile" | tr ' ' ' + sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. @@ -324,35 +495,40 @@ cpp) # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - ( IFS=" " - case " $* " in - *" --mode=compile "*) - for arg - do # cycle over the arguments - case $arg in - "--mode=compile") - # insert --quiet before "--mode=compile" - set fnord "$@" --quiet - shift # fnord - ;; - esac - set fnord "$@" "$arg" - shift # fnord - shift # "$arg" - done + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg ;; esac - "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" - ) & - proc=$! - "$@" - stat=$? - wait "$proc" - if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -362,34 +538,27 @@ msvisualcpp) # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o, + # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. - ( IFS=" " - case " $* " in - *" --mode=compile "*) - for arg - do # cycle over the arguments - case $arg in - "--mode=compile") - # insert --quiet before "--mode=compile" - set fnord "$@" --quiet - shift # fnord - ;; - esac + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) set fnord "$@" "$arg" - shift # fnord - shift # "$arg" - done - ;; + shift + shift + ;; esac - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - ) & - proc=$! - "$@" - stat=$? - wait "$proc" - if test "$stat" != 0; then exit $stat; fi + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" @@ -409,3 +578,12 @@ esac exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -Nru gfire-0.8.3/gfire_config.h gfire-0.9.4/gfire_config.h --- gfire-0.8.3/gfire_config.h 2009-08-19 13:43:10.000000000 +0000 +++ gfire-0.9.4/gfire_config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* pre_config.h. Generated from pre_config.h.in by configure. */ -/* pre_config.h.in. Generated from configure.ac by autoheader. */ - - -#ifndef _GFIRE_CONFIG_H -#define _GFIRE_CONFIG_H - - -/* Define if debugging is enabled. */ -#define DEBUG 1 - -/* Gfire Version */ -#define GFIRE_VERSION "" - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define if we've found pidgin. */ -#define HAVE_PIDGIN 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Define to the address where bug reports for this package should be sent. */ -#define SNPP_PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define SNPP_PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define SNPP_PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define SNPP_PACKAGE_TARNAME "" - -/* Define to the version of this package. */ -#define SNPP_PACKAGE_VERSION "" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -#endif diff -Nru gfire-0.8.3/gfire_config.h.in gfire-0.9.4/gfire_config.h.in --- gfire-0.8.3/gfire_config.h.in 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/gfire_config.h.in 2011-03-20 13:26:14.000000000 +0000 @@ -0,0 +1,126 @@ +/* gfire_config.h.in. Generated from configure.ac by autoheader. */ + + +#ifndef _GFIRE_CONFIG_H +#define _GFIRE_CONFIG_H + + +/* Define if debugging is enabled. */ +#undef DEBUG + +/* Define if verbose debugging is enabled. */ +#undef DEBUG_VERBOSE + +/* always defined to indicate that i18n is enabled */ +#undef ENABLE_NLS + +/* Define the gettext package to be used */ +#undef GETTEXT_PACKAGE + +/* Gfire major version */ +#undef GFIRE_VERSION_MAJOR + +/* Gfire minor version */ +#undef GFIRE_VERSION_MINOR + +/* Gfire patch version */ +#undef GFIRE_VERSION_PATCH + +/* Gfire version string */ +#undef GFIRE_VERSION_STRING + +/* Gfire version suffix */ +#undef GFIRE_VERSION_SUFFIX + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#undef HAVE_BIND_TEXTDOMAIN_CODESET + +/* Define if we've support for dbus-glib */ +#undef HAVE_DBUS_GLIB + +/* Define to 1 if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define if we've support for GTK+ */ +#undef HAVE_GTK + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define if we've support for libnotify */ +#undef HAVE_LIBNOTIFY + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if we've found libpurple. */ +#undef HAVE_PURPLE + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Show notifications about newer versions */ +#undef UPDATE_NOTIFY + +/* Use DBus status change if defined */ +#undef USE_DBUS_STATUS_CHANGE + +/* Support game detection */ +#undef USE_GAME_DETECTION + +#endif diff -Nru gfire-0.8.3/gfire_config_win.h gfire-0.9.4/gfire_config_win.h --- gfire-0.8.3/gfire_config_win.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/gfire_config_win.h 2011-03-23 18:07:06.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +// gfire_config_win.h. Copied from gfire_config.h for Windows builds +#ifndef _GFIRE_CONFIG_H +#define _GFIRE_CONFIG_H + +/* always defined to indicate that i18n is enabled */ +#define ENABLE_NLS 1 + +/* Define the gettext package to be used */ +#define GETTEXT_PACKAGE "gfire" + +/* Gfire major version */ +#define GFIRE_VERSION_MAJOR 0 + +/* Gfire minor version */ +#define GFIRE_VERSION_MINOR 9 + +/* Gfire patch version */ +#define GFIRE_VERSION_PATCH 4 + +/* Gfire version string */ +#define GFIRE_VERSION_STRING "0.9.4" + +/* Gfire version suffix */ +#define GFIRE_VERSION_SUFFIX "" + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 + +/* Define to 1 if you have the `dcgettext' function. */ +#define HAVE_DCGETTEXT 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#define HAVE_GETTEXT 1 + +/* Define if we've support for GTK+ */ +#define HAVE_GTK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if we've found pidgin. */ +#define HAVE_PIDGIN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "support@gfireproject.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Gfire" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Gfire 0.9.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gfire" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.9.4" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Show notifications about newer versions */ +#define UPDATE_NOTIFY 1 + +/* Support game detection */ +#define USE_GAME_DETECTION 1 + +#endif diff -Nru gfire-0.8.3/ltmain.sh gfire-0.9.4/ltmain.sh --- gfire-0.8.3/ltmain.sh 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/ltmain.sh 2011-03-23 19:56:57.000000000 +0000 @@ -1,9 +1,10 @@ # Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.4 +# libtool (GNU libtool) 2.2.10 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 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. @@ -32,50 +33,54 @@ # # 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 -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message +# --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) +# --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 +# 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. +# 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.2.4 Debian-2.2.4-0ubuntu4 -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.10 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . -PROGRAM=ltmain.sh +PROGRAM=libtool PACKAGE=libtool -VERSION="2.2.4 Debian-2.2.4-0ubuntu4" +VERSION=2.2.10 TIMESTAMP="" -package_revision=1.2976 +package_revision=1.3175 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -91,10 +96,15 @@ 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. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -107,24 +117,33 @@ 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"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="grep -E"} +: ${FGREP="grep -F"} +: ${GREP="grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} +: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -159,32 +178,168 @@ func_dirname_and_basename () { # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + 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 "X${1}" | $Xsed -e "$basename"` + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # Generated shell functions inserted here. -# 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" +# 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: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -258,6 +413,13 @@ : } +# 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 () @@ -326,9 +488,9 @@ case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -378,7 +540,7 @@ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "X$my_tmpdir" | $Xsed + $ECHO "$my_tmpdir" } @@ -392,7 +554,7 @@ { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -419,7 +581,7 @@ { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ + my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -489,14 +651,19 @@ } - - - # func_version # Echo version message to standard output and exit. func_version () { - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + $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/ @@ -509,19 +676,20 @@ # Echo short help message to standard output and exit. func_usage () { - $SED -n '/^# Usage:/,/# -h/ { + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - $ECHO + echo $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help -# Echo long help message to standard output and exit. +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { @@ -538,7 +706,10 @@ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" - exit $? + ret=$? + if test -z "$1"; then + exit $ret + fi } # func_missing_arg argname @@ -546,7 +717,7 @@ # exit_cmd. func_missing_arg () { - func_error "missing argument for $1" + func_error "missing argument for $1." exit_cmd=exit } @@ -556,29 +727,6 @@ -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file @@ -907,7 +1068,7 @@ func_lalib_unsafe_p () { lalib_p=no - if test -r "$1" && exec 5<&0 <"$1"; then + 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 @@ -1015,10 +1176,13 @@ func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" 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 "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + " $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. *) @@ -1032,8 +1196,11 @@ func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + " $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. @@ -1212,7 +1379,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx) + *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1275,7 +1442,7 @@ # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2*) + cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac @@ -1287,7 +1454,7 @@ # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -1444,7 +1611,7 @@ } $opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () @@ -1481,10 +1648,11 @@ -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 building PIC objects only - -prefer-non-pic try to building non-PIC objects only + -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. @@ -1537,7 +1705,7 @@ The following components of INSTALL-COMMAND are treated specially: - -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -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)." @@ -1557,6 +1725,8 @@ -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) @@ -1585,6 +1755,11 @@ -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. @@ -1622,14 +1797,40 @@ ;; esac - $ECHO + echo $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? } - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help +# 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 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 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... @@ -1711,7 +1912,7 @@ 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 @@ -1753,7 +1954,7 @@ # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" + echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS @@ -1794,23 +1995,23 @@ # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" + 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:" + 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" + 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" + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR @@ -1822,21 +2023,21 @@ $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'" + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi - $ECHO + echo - $ECHO "See any operating system documentation about shared libraries for" + 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), crle(1) and ld.so(8) manual" + echo "pages." ;; *) - $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac - $ECHO "X----------------------------------------------------------------------" | $Xsed + echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS } @@ -1851,7 +2052,7 @@ # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -1866,6 +2067,11 @@ # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$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= @@ -1875,8 +2081,10 @@ install_type= isdir=no stripme= + no_mode=: for arg do + arg2= if test -n "$dest"; then files="$files $dest" dest=$arg @@ -1886,10 +2094,9 @@ case $arg in -d) isdir=yes ;; -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac + if $install_cp; then :; else + prev=$arg + fi ;; -g | -m | -o) prev=$arg @@ -1903,6 +2110,10 @@ *) # 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 @@ -1914,6 +2125,10 @@ # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -1922,6 +2137,13 @@ 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" + install_shared_prog="$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" @@ -2009,7 +2231,7 @@ if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + 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 @@ -2022,9 +2244,9 @@ if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2042,11 +2264,11 @@ test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" @@ -2152,7 +2374,7 @@ # Do a test to see if this is really a libtool program. case $host in - *cygwin*|*mingw*) + *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result @@ -2182,7 +2404,7 @@ if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + 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 @@ -2201,7 +2423,7 @@ file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -2220,7 +2442,7 @@ } else # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -2322,6 +2544,10 @@ extern \"C\" { #endif +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + /* External symbol declarations for the compiler. */\ " @@ -2331,7 +2557,7 @@ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" @@ -2358,7 +2584,7 @@ $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in - *cygwin* | *mingw* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; @@ -2370,7 +2596,7 @@ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -2414,10 +2640,10 @@ if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { @@ -2426,8 +2652,8 @@ } lt_dlsymlist; " case $host in - *cygwin* | *mingw* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ + *cygwin* | *mingw* | *cegcc* ) + echo >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" @@ -2440,7 +2666,7 @@ lt_dlsym_const=const ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist @@ -2456,7 +2682,7 @@ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -2512,18 +2738,18 @@ # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in - *cygwin* | *mingw* ) + *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + 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 "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -2537,8 +2763,8 @@ # really was required. # Nullify the symbol file. - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } @@ -2548,6 +2774,7 @@ # 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 @@ -2558,8 +2785,9 @@ 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 pe-i386(.*architecture: i386)?' >/dev/null ; then + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ @@ -2597,7 +2825,18 @@ $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + 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 @@ -2668,7 +2907,7 @@ darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -2683,34 +2922,30 @@ func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + 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 +# func_emit_wrapper [arg=no] # -# emit a libtool wrapper script on stdout -# don't directly open a file because we may want to +# 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 variable +# func_mode_link because it depends on a number of variables # set therein. # -# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# 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 '.lib' directory. This is a cygwin/mingw-specific +# the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi + func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2726,7 +2961,6 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -2757,31 +2991,132 @@ else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ + 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 () +{ " - $ECHO "\ + 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 () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + 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'\` + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -2791,8 +3126,8 @@ esac fi - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into @@ -2805,7 +3140,7 @@ fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -2868,7 +3203,7 @@ # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " @@ -2885,36 +3220,179 @@ $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 + 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 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } -# end: func_emit_wrapper + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_result=`cygpath -w "$1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result= + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# 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. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # 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_pathlist_tmp1=$func_stripname_result + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + func_to_host_pathlist_result=` + ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_append func_to_host_pathlist_result ";$func_to_host_path_result" + fi + fi + fi + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result"; then + func_error "Could not determine the host path(s) corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_append func_to_host_pathlist_result ";" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout @@ -2932,20 +3410,18 @@ This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. */ EOF cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif #include #include #ifdef _MSC_VER # include # include # include -# define setmode _setmode #else # include # include @@ -2962,6 +3438,44 @@ #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) @@ -2977,14 +3491,7 @@ # define S_IXGRP 0 #endif -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - +/* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -3015,10 +3522,6 @@ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -3031,22 +3534,13 @@ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; #else -# define LTWRAPPER_DEBUGPRINTF(args) +static int lt_debug = 0; #endif -const char *program_name = NULL; +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -3056,37 +3550,88 @@ int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_fatal (const char *message, ...); - -static const char *script_text = +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 - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat </dev/null || echo $SHELL` - case $lt_newargv0 in - *.exe | *.EXE) ;; - *) lt_newargv0=$lt_newargv0.exe ;; - esac - ;; - * ) lt_newargv0=$SHELL ;; - esac - fi - - cat < 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 -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + 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*) + *-*-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 @@ -3554,6 +4386,7 @@ new_inherited_linker_flags= avoid_version=no + bindir= dlfiles= dlprefiles= dlself=no @@ -3646,6 +4479,11 @@ esac case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -3907,6 +4745,11 @@ continue ;; + -bindir) + prev=bindir + continue + ;; + -dlopen) prev=dlfiles continue @@ -3959,6 +4802,13 @@ -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result + if test -z "$dir"; 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 # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -3977,14 +4827,16 @@ ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; + ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; @@ -3995,7 +4847,7 @@ -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4072,7 +4924,7 @@ -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + *-*-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" @@ -4181,7 +5033,7 @@ for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" + arg="$arg $func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" @@ -4227,18 +5079,19 @@ arg="$func_quote_for_eval_result" ;; - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files + # 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 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" @@ -4398,7 +5251,7 @@ if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -4506,10 +5359,7 @@ case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -4524,7 +5374,8 @@ # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + func_basename "$deplib" + deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; @@ -4703,7 +5554,7 @@ match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -4713,15 +5564,15 @@ ;; esac if test "$valid_a_lib" != yes; then - $ECHO + 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." + 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 $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -4794,7 +5645,7 @@ # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + 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 "*) ;; @@ -4802,7 +5653,7 @@ esac done fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + 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 @@ -5032,7 +5883,7 @@ if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw*) + *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no @@ -5056,7 +5907,7 @@ fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO + echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -5102,7 +5953,7 @@ elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw*) + *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" @@ -5159,9 +6010,9 @@ 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" + 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 @@ -5301,21 +6152,21 @@ # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - $ECHO + 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." + 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." + 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." + 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 @@ -5369,6 +6220,7 @@ 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) @@ -5434,7 +6286,7 @@ compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -5602,7 +6454,7 @@ 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 $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" @@ -5670,7 +6522,7 @@ age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|sunos) + freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" @@ -5682,9 +6534,6 @@ revision="$number_minor" lt_irix_increment=no ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; esac ;; no) @@ -5884,7 +6733,7 @@ tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in - *.$objext) + *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then @@ -5907,14 +6756,14 @@ oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + 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 "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + # 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 @@ -5955,7 +6804,7 @@ if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) @@ -6040,13 +6889,13 @@ newdeplibs="$newdeplibs $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $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 I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." + 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 I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; @@ -6083,22 +6932,22 @@ newdeplibs="$newdeplibs $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $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 a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." + 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 a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi ;; *) @@ -6144,7 +6993,7 @@ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | @@ -6159,12 +7008,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + 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" + 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 @@ -6202,7 +7051,7 @@ 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 \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" @@ -6213,12 +7062,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + 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" + 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 @@ -6236,25 +7085,25 @@ ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + 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 "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO + case $tmp_deplibs in + *[!\ \ ]*) + echo if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $ECHO "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - fi + ;; + esac ;; esac versuffix=$versuffix_save @@ -6266,23 +7115,23 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + 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 + 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." + 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." + 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" @@ -6292,16 +7141,16 @@ 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." + 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." + 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 @@ -6318,9 +7167,9 @@ # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + 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 @@ -6442,7 +7291,7 @@ done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= @@ -6454,7 +7303,7 @@ orig_export_symbols= case $host_os in - cygwin* | mingw*) + 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 @@ -6508,7 +7357,7 @@ 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 "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_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 @@ -6609,7 +7458,8 @@ save_libobjs=$libobjs fi save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + func_basename "$output" + output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. @@ -6622,12 +7472,12 @@ 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 + echo 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done - $ECHO ')' >> $output + echo ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk @@ -6669,17 +7519,19 @@ # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + 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 + objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -6689,7 +7541,8 @@ # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + 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 @@ -6748,7 +7601,7 @@ 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 "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -6913,7 +7766,7 @@ 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 "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" @@ -6924,7 +7777,7 @@ fi # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + 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 $?' @@ -6984,8 +7837,8 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac @@ -7002,8 +7855,8 @@ esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7079,14 +7932,16 @@ esac fi case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; @@ -7138,8 +7993,8 @@ if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + 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" @@ -7151,6 +8006,10 @@ 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 @@ -7164,7 +8023,7 @@ esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + 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. @@ -7211,7 +8070,7 @@ # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + 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 @@ -7230,7 +8089,7 @@ if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -7242,7 +8101,7 @@ fi # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + 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 @@ -7266,18 +8125,7 @@ fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -7308,11 +8156,10 @@ func_emit_cwrapperexe_src > $cwrappersource - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. + # 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 @@ -7399,7 +8246,7 @@ done | sort | sort -uc >/dev/null 2>&1); then : else - $ECHO "copying selected object files to avoid basename conflicts..." + echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" @@ -7510,7 +8357,7 @@ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -7595,9 +8442,27 @@ 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) tdlname=../bin/$dlname ;; + *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 diff -Nru gfire-0.8.3/m4/intltool.m4 gfire-0.9.4/m4/intltool.m4 --- gfire-0.8.3/m4/intltool.m4 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/m4/intltool.m4 2011-03-23 19:57:04.000000000 +0000 @@ -0,0 +1,216 @@ +## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- +## Copyright (C) 2001 Eazel, Inc. +## Author: Maciej Stachowiak +## Kenneth Christiansen +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be 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. + +dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) +# serial 40 IT_PROG_INTLTOOL +AC_DEFUN([IT_PROG_INTLTOOL], [ +AC_PREREQ([2.50])dnl +AC_REQUIRE([AM_NLS])dnl + +case "$am__api_version" in + 1.[01234]) + AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) + ;; + *) + ;; +esac + +if test -n "$1"; then + AC_MSG_CHECKING([for intltool >= $1]) + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + ] + AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) +fi + +AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) +AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) +AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) +fi + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + +_IT_SUBST(INTLTOOL_DESKTOP_RULE) +_IT_SUBST(INTLTOOL_DIRECTORY_RULE) +_IT_SUBST(INTLTOOL_KEYS_RULE) +_IT_SUBST(INTLTOOL_PROP_RULE) +_IT_SUBST(INTLTOOL_OAF_RULE) +_IT_SUBST(INTLTOOL_PONG_RULE) +_IT_SUBST(INTLTOOL_SERVER_RULE) +_IT_SUBST(INTLTOOL_SHEET_RULE) +_IT_SUBST(INTLTOOL_SOUNDLIST_RULE) +_IT_SUBST(INTLTOOL_UI_RULE) +_IT_SUBST(INTLTOOL_XAM_RULE) +_IT_SUBST(INTLTOOL_KBD_RULE) +_IT_SUBST(INTLTOOL_XML_RULE) +_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) +_IT_SUBST(INTLTOOL_CAVES_RULE) +_IT_SUBST(INTLTOOL_SCHEMAS_RULE) +_IT_SUBST(INTLTOOL_THEME_RULE) +_IT_SUBST(INTLTOOL_SERVICE_RULE) +_IT_SUBST(INTLTOOL_POLICY_RULE) + +# Check the gettext tools to make sure they are GNU +AC_PATH_PROG(XGETTEXT, xgettext) +AC_PATH_PROG(MSGMERGE, msgmerge) +AC_PATH_PROG(MSGFMT, msgfmt) +AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) +fi + +AC_PATH_PROG(INTLTOOL_PERL, perl) +if test -z "$INTLTOOL_PERL"; then + AC_MSG_ERROR([perl not found]) +fi +AC_MSG_CHECKING([for perl >= 5.8.1]) +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + AC_MSG_ERROR([perl 5.8.1 is required for intltool]) +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + AC_MSG_RESULT([$IT_PERL_VERSION]) +fi +if test "x$2" != "xno-xml"; then + AC_MSG_CHECKING([for XML::Parser]) + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + AC_MSG_RESULT([ok]) + else + AC_MSG_ERROR([XML::Parser perl module is required for intltool]) + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile +AC_SUBST(ALL_LINGUAS) + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], + [[extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr]])], + [DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share + dnl in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [DATADIRNAME=share], [DATADIRNAME=lib]) + ;; + *) + [DATADIRNAME=lib] + ;; + esac]) +fi +AC_SUBST(DATADIRNAME) + +IT_PO_SUBDIR([po]) + +]) + + +# IT_PO_SUBDIR(DIRNAME) +# --------------------- +# All po subdirs have to be declared with this macro; the subdir "po" is +# declared by IT_PROG_INTLTOOL. +# +AC_DEFUN([IT_PO_SUBDIR], +[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. +dnl +dnl The following CONFIG_COMMANDS should be executed at the very end +dnl of config.status. +AC_CONFIG_COMMANDS_PRE([ + AC_CONFIG_COMMANDS([$1/stamp-it], [ + if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then + AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) + fi + rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" + >"$1/stamp-it.tmp" + [sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" + ] + [sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r $1/POTFILES + } + ' "$1/Makefile.in" >"$1/Makefile"] + rm -f "$1/Makefile.tmp" + mv "$1/stamp-it.tmp" "$1/stamp-it" + ]) +])dnl +]) + +# _IT_SUBST(VARIABLE) +# ------------------- +# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +# +AC_DEFUN([_IT_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) + +# deprecated macros +AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) +# A hint is needed for aclocal from Automake <= 1.9.4: +# AC_DEFUN([AC_PROG_INTLTOOL], ...) + diff -Nru gfire-0.8.3/m4/libtool.m4 gfire-0.9.4/m4/libtool.m4 --- gfire-0.8.3/m4/libtool.m4 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/m4/libtool.m4 2011-03-23 19:56:57.000000000 +0000 @@ -0,0 +1,7450 @@ +# 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 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 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([], [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_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])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) 2010 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + 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)], + [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 + + +# _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([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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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 -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; 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 +# -------------------------- +# 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\"`' + 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 +# ----------------------- +# 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. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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_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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + 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_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +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 \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$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 + ;; + + 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"`func_fallback_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)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + 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 + 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 + 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 + 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,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + 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 + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux + 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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # 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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + 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 + 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 + 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 + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +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 Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + 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_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_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_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};"\ +" /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 + + # 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 +#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. */ +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_save_LIBS="$LIBS" + lt_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_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -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 + +_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_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)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +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 + ;; + 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) + 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*) + ;; + *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 ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + 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) + 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' + ;; + 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\ F* | *Sun*Fortran*) + # 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\ 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,' + ;; + 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_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# 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]) + +# +# 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_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' + 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*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + 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_flag_spec_ld, $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 + ;; + 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/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + 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= + 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)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $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*) + 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 $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' + 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 $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 + ;; + + 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 $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 + + 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 + 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 + _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 + _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. + _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(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + 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 + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_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 -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 -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_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 -fPIC ${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_flag_spec_ld, $1)='+b $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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_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 $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. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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' + ) + LDFLAGS="$save_LDFLAGS" + 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*) + 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} $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 ${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 ${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_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_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([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_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([], [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 +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_flag_spec_ld, $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_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_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 -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_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 + _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 + _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*) + # _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 + ;; + 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 + ;; + + freebsd[[12]]*) + # 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 + ;; + + gnu*) + ;; + + 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 -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_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 -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 -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) + 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 -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 -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 -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 + 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_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 +# 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 +]) +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 $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_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 + ;; + + *.$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 + +# 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_flag_spec_ld, $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 + CC=${F77-"f77"} + 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" +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_flag_spec_ld, $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 + CC=${FC-"f95"} + 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" +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_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +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" +])# _LT_LANG_GCJ_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_GCC=$GCC +GCC= +CC=${RC-"windres"} +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" +])# _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_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_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"}, \ + = c,a/b,, \ + && 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_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# 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 () +{ + # Extract subdirectory from the argument. + 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_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# 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 +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) diff -Nru gfire-0.8.3/m4/lt~obsolete.m4 gfire-0.9.4/m4/lt~obsolete.m4 --- gfire-0.8.3/m4/lt~obsolete.m4 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/m4/lt~obsolete.m4 2011-03-23 19:56:58.000000000 +0000 @@ -0,0 +1,98 @@ +# 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])]) diff -Nru gfire-0.8.3/m4/ltoptions.m4 gfire-0.9.4/m4/ltoptions.m4 --- gfire-0.8.3/m4/ltoptions.m4 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/m4/ltoptions.m4 2011-03-23 19:56:57.000000000 +0000 @@ -0,0 +1,369 @@ +# 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], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [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])]) diff -Nru gfire-0.8.3/m4/ltsugar.m4 gfire-0.9.4/m4/ltsugar.m4 --- gfire-0.8.3/m4/ltsugar.m4 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/m4/ltsugar.m4 2011-03-23 19:56:58.000000000 +0000 @@ -0,0 +1,123 @@ +# 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 +]) diff -Nru gfire-0.8.3/m4/ltversion.m4 gfire-0.9.4/m4/ltversion.m4 --- gfire-0.8.3/m4/ltversion.m4 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/m4/ltversion.m4 2011-03-23 19:56:58.000000000 +0000 @@ -0,0 +1,23 @@ +# 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. + +# Generated from ltversion.in. + +# serial 3175 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.10]) +m4_define([LT_PACKAGE_REVISION], [1.3175]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.10' +macro_revision='1.3175' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff -Nru gfire-0.8.3/Makefile.am gfire-0.9.4/Makefile.am --- gfire-0.8.3/Makefile.am 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/Makefile.am 2011-03-14 18:03:21.000000000 +0000 @@ -1,17 +1,17 @@ -EXTRA_DIST = COPYING \ - ChangeLog \ - INSTALL \ - NEWS \ - README \ - VERSION \ - gfire.spec \ - gfire_config.h +EXTRA_DIST = config.rpath config.rpath COPYING \ + ChangeLog \ + INSTALL \ + NEWS \ + README \ + VERSION \ + gfire.spec SUBDIRS = data pixmaps src -AM_CFLAGS = -DDATADIR=\"$(datadir)\" -BUILT_SOURCES = gfire_config.h -$(OBJECTS): $(BUILT_SOURCES) +if INSTALL_NLS +SUBDIRS += po +endif -gfire_config.h: pre_config.h - $(sedpath) 's/#define PACKAGE/#define SNPP_PACKAGE/g' pre_config.h > $@ +AM_CFLAGS = -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" + +ACLOCAL_AMFLAGS = -I m4 diff -Nru gfire-0.8.3/Makefile.in gfire-0.9.4/Makefile.in --- gfire-0.8.3/Makefile.in 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/Makefile.in 2011-03-23 19:57:04.000000000 +0000 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @@ -15,8 +16,9 @@ @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@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 @@ -31,20 +33,28 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@INSTALL_NLS_TRUE@am__append_1 = po subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/pre_config.h.in \ + $(srcdir)/Makefile.in $(srcdir)/gfire_config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/VERSION $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = pre_config.h +CONFIG_HEADER = gfire_config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -56,33 +66,68 @@ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = data pixmaps src po DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +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" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ +DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -94,19 +139,32 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ +LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -115,8 +173,13 @@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -125,17 +188,26 @@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIDGIN_CFLAGS = @PIDGIN_CFLAGS@ -PIDGIN_LIBS = @PIDGIN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PURPLE_CFLAGS = @PURPLE_CFLAGS@ +PURPLE_LIBS = @PURPLE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -172,7 +244,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -186,21 +257,21 @@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXTRA_DIST = COPYING \ - ChangeLog \ - INSTALL \ - NEWS \ - README \ - VERSION \ - gfire.spec \ - gfire_config.h - -SUBDIRS = data pixmaps src -AM_CFLAGS = -DDATADIR=\"$(datadir)\" -BUILT_SOURCES = gfire_config.h -all: $(BUILT_SOURCES) pre_config.h +EXTRA_DIST = config.rpath config.rpath COPYING \ + ChangeLog \ + INSTALL \ + NEWS \ + README \ + VERSION \ + gfire.spec + +SUBDIRS = data pixmaps src $(am__append_1) +AM_CFLAGS = -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" +ACLOCAL_AMFLAGS = -I m4 +all: gfire_config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: @@ -210,15 +281,15 @@ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ - cd $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -234,26 +305,27 @@ $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): -pre_config.h: stamp-h1 +gfire_config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi -stamp-h1: $(srcdir)/pre_config.h.in $(top_builddir)/config.status +stamp-h1: $(srcdir)/gfire_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status pre_config.h -$(srcdir)/pre_config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + cd $(top_builddir) && $(SHELL) ./config.status gfire_config.h +$(srcdir)/gfire_config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: - -rm -f pre_config.h stamp-h1 + -rm -f gfire_config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo @@ -262,7 +334,7 @@ -rm -rf .libs _libs distclean-libtool: - -rm -f libtool + -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -271,7 +343,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -288,7 +360,7 @@ else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -296,7 +368,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -322,16 +394,16 @@ else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(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" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -339,14 +411,14 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(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) pre_config.h.in $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) gfire_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -358,45 +430,50 @@ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) pre_config.h.in $(LISP) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) gfire_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + 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) pre_config.h.in $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) gfire_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) pre_config.h.in $(LISP) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) gfire_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -412,38 +489,55 @@ 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + 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="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -456,6 +550,10 @@ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -479,15 +577,17 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -495,9 +595,11 @@ mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -519,13 +621,15 @@ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -543,13 +647,11 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile pre_config.h +check: check-recursive +all-am: Makefile gfire_config.h installdirs: installdirs-recursive installdirs-am: -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive +install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -569,11 +671,11 @@ 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." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am @@ -590,6 +692,8 @@ html: html-recursive +html-am: + info: info-recursive info-am: @@ -598,18 +702,28 @@ 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 @@ -632,29 +746,26 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi 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 + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + 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 -$(OBJECTS): $(BUILT_SOURCES) -gfire_config.h: pre_config.h - $(sedpath) 's/#define PACKAGE/#define SNPP_PACKAGE/g' pre_config.h > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru gfire-0.8.3/Makefile.mingw gfire-0.9.4/Makefile.mingw --- gfire-0.8.3/Makefile.mingw 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/Makefile.mingw 2010-09-10 22:35:47.000000000 +0000 @@ -0,0 +1,41 @@ +GFIRE_DIR = . +include mingw.mak + +GFIRE_VERSION_STRING = `cat VERSION` +GFIRE_VERSION_SUFFIX = `awk '{split($$1,array,"\\\.|-"); print array[4];}' VERSION` +GFIRE_VERSION_PATCH = `awk '{split($$1,array,"\\\.|-"); print array[3];}' VERSION` +GFIRE_VERSION_MINOR = `awk '{split($$1,array,"\\\.|-"); print array[2];}' VERSION` +GFIRE_VERSION_MAJOR = `awk '{split($$1,array,"\\\.|-"); print array[1];}' VERSION` + +SUBDIRS = src po data pixmaps + +.PHONY: all clean installer + +all: gfire_config_win.h + @list='${SUBDIRS}'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) -f Makefile.mingw all) || exit 1; \ + done; + +clean: + @list='${SUBDIRS}'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) -f Makefile.mingw clean) || exit 1; \ + done; + +distclean: clean + rm -rf ${WIN32_INSTALL_DIR} + rm -f pidgin-gfire-$(GFIRE_VERSION_STRING).exe + rm -f pidgin-gfire-$(GFIRE_VERSION_STRING).zip + +install: all + @list='${SUBDIRS}'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) -f Makefile.mingw install) || exit 1; \ + done; + +installer: installer-gui installer-zip + +installer-gui: install VERSION + ${MAKENSIS} -V3 -DGFIRE_VERSION="$(GFIRE_VERSION_STRING)" -DGFIRE_INSTALL_DIR="${WIN32_INSTALL_DIR}" ${GFIRE_DIR}/nsis/gfire-installer.nsi + #${MAKENSIS} ${GFIRE_DIR}/nsis/gfire-installer.nsi + +installer-zip: install VERSION + cd ${WIN32_INSTALL_DIR} && /usr/bin/zip -ru ../pidgin-gfire-`cat ../VERSION`.zip * diff -Nru gfire-0.8.3/mingw.mak gfire-0.9.4/mingw.mak --- gfire-0.8.3/mingw.mak 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/mingw.mak 2011-03-12 22:15:44.000000000 +0000 @@ -0,0 +1,23 @@ +# The name of your windows compiler +WIN32_COMPILER = i686-pc-mingw32-gcc +WIN32_WINDRES = i686-pc-mingw32-windres + +# The directory containing the GTK and GLib files +WIN32_DEV_DIR = ${GFIRE_DIR}/../../pidgin_mingw/win32-dev +WIN32_GTK_DIR = ${WIN32_DEV_DIR}/gtk_2_0 + +# The directory containing pidgin +WIN32_PIDGIN_DIR = ${GFIRE_DIR}/../../pidgin_mingw/pidgin-2.7.7 + +# Install dir (the files are copied there for creation of NSIS installer and .zip-file) +WIN32_INSTALL_DIR = ${GFIRE_DIR}/win32-install + +# Your msgfmt (part of GNU gettext) program +GMSGFMT = /usr/bin/gmsgfmt + +# Your makensis program +MAKENSIS = /usr/bin/makensis + +# Your C and LD flags +#USER_CFLAGS = -DDEBUG=1 +USER_LDFLAGS = diff -Nru gfire-0.8.3/nsis/gfire-installer.nsi gfire-0.9.4/nsis/gfire-installer.nsi --- gfire-0.8.3/nsis/gfire-installer.nsi 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/nsis/gfire-installer.nsi 2010-01-09 14:57:00.000000000 +0000 @@ -0,0 +1,93 @@ +; Script based on pidgin-facebook installer + +SetCompressor /SOLID lzma + +; HM NIS Edit Wizard helper defines +;!define GFIRE_VERSION "0.9.0-svn" +;!define GFIRE_INSTALL_DIR "./win32-install" +!define PRODUCT_NAME "Gfire" +!define PRODUCT_VERSION ${GFIRE_VERSION} +!define PRODUCT_PUBLISHER "Gfire Team" +!define PRODUCT_WEB_SITE "http://gfireproject.org" +!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" +!define PRODUCT_UNINST_ROOT_KEY "HKLM" + +!define GFIRE_DIR ".." + +; MUI 1.67 compatible ------ +!include "MUI.nsh" + +; MUI Settings +!define MUI_ABORTWARNING +!define MUI_ICON ".\gfx\gfire.ico" +!define MUI_UNICON ".\gfx\gfire.ico" +!define MUI_WELCOMEFINISHPAGE_BITMAP ".\gfx\gfire-intro.bmp" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP ".\gfx\gfire-header.bmp" + + +; Welcome page +!insertmacro MUI_PAGE_WELCOME +; License page +!insertmacro MUI_PAGE_LICENSE "${GFIRE_DIR}\COPYING" +; Instfiles page +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_TEXT "Run Pidgin" +!define MUI_FINISHPAGE_RUN_FUNCTION "RunPidgin" +!insertmacro MUI_PAGE_FINISH + +; Uninstaller pages +;!insertmacro MUI_UNPAGE_INSTFILES + +; Language files +!insertmacro MUI_LANGUAGE "English" + +; MUI end ------ + +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" +OutFile "..\pidgin-gfire-${PRODUCT_VERSION}.exe" + +Var "PidginDir" + +ShowInstDetails show +ShowUnInstDetails show + +Section "MainSection" SEC01 + ;Check for pidgin installation + Call GetPidginInstPath + + SetOverwrite try + uninst: + ClearErrors + Delete "$PidginDir\plugins\libxfire.dll" + IfErrors dllbusy + Goto after_uninst + dllbusy: + MessageBox MB_RETRYCANCEL "libxfire.dll is busy. Please close Pidgin (including tray icon) and try again." IDCANCEL Cancel + Goto uninst + cancel: + Abort "Installation of Gfire aborted" + after_uninst: + + SetOutPath $PidginDir + File /r ${GFIRE_DIR}/${GFIRE_INSTALL_DIR}/*.* + +SectionEnd + +Function GetPidginInstPath + Push $0 + ReadRegStr $0 HKLM "Software\pidgin" "" + IfFileExists "$0\pidgin.exe" cont + ReadRegStr $0 HKCU "Software\pidgin" "" + IfFileExists "$0\pidgin.exe" cont + MessageBox MB_OK|MB_ICONINFORMATION "Failed to find Pidgin installation." + Abort "Failed to find Pidgin installation. Please install Pidgin first." + cont: + StrCpy $PidginDir $0 +FunctionEnd + +Function RunPidgin + ExecShell "" "$PidginDir\pidgin.exe" +FunctionEnd + Binary files /tmp/SpNtePhYv6/gfire-0.8.3/nsis/gfx/gfire-header.bmp and /tmp/SuRYzFsUtN/gfire-0.9.4/nsis/gfx/gfire-header.bmp differ Binary files /tmp/SpNtePhYv6/gfire-0.8.3/nsis/gfx/gfire.ico and /tmp/SuRYzFsUtN/gfire-0.9.4/nsis/gfx/gfire.ico differ Binary files /tmp/SpNtePhYv6/gfire-0.8.3/nsis/gfx/gfire-intro.bmp and /tmp/SuRYzFsUtN/gfire-0.9.4/nsis/gfx/gfire-intro.bmp differ Binary files /tmp/SpNtePhYv6/gfire-0.8.3/pixmaps/16/gfire.png and /tmp/SuRYzFsUtN/gfire-0.9.4/pixmaps/16/gfire.png differ Binary files /tmp/SpNtePhYv6/gfire-0.8.3/pixmaps/22/gfire.png and /tmp/SuRYzFsUtN/gfire-0.9.4/pixmaps/22/gfire.png differ Binary files /tmp/SpNtePhYv6/gfire-0.8.3/pixmaps/emblems/game-voip.png and /tmp/SuRYzFsUtN/gfire-0.9.4/pixmaps/emblems/game-voip.png differ Binary files /tmp/SpNtePhYv6/gfire-0.8.3/pixmaps/emblems/voip.png and /tmp/SuRYzFsUtN/gfire-0.9.4/pixmaps/emblems/voip.png differ diff -Nru gfire-0.8.3/pixmaps/Makefile.am gfire-0.9.4/pixmaps/Makefile.am --- gfire-0.8.3/pixmaps/Makefile.am 2009-05-30 19:37:13.000000000 +0000 +++ gfire-0.9.4/pixmaps/Makefile.am 2010-01-09 14:56:59.000000000 +0000 @@ -1,11 +1,16 @@ EXTRA_DIST = 16/gfire.png \ 22/gfire.png \ - 48/gfire.png + 48/gfire.png \ + emblems/voip.png \ + emblems/game-voip.png pidgin_protocol_pix16dir = $(datadir)/pixmaps/pidgin/protocols/16 pidgin_protocol_pix22dir = $(datadir)/pixmaps/pidgin/protocols/22 pidgin_protocol_pix48dir = $(datadir)/pixmaps/pidgin/protocols/48 +pidgin_emblemsdir = $(datadir)/pixmaps/pidgin/emblems/16 pidgin_protocol_pix16_DATA = 16/gfire.png pidgin_protocol_pix22_DATA = 22/gfire.png pidgin_protocol_pix48_DATA = 48/gfire.png +pidgin_emblems_DATA = emblems/voip.png \ + emblems/game-voip.png diff -Nru gfire-0.8.3/pixmaps/Makefile.in gfire-0.9.4/pixmaps/Makefile.in --- gfire-0.8.3/pixmaps/Makefile.in 2009-05-30 19:37:13.000000000 +0000 +++ gfire-0.9.4/pixmaps/Makefile.in 2011-03-23 19:57:03.000000000 +0000 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.2 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@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 @@ -35,12 +37,19 @@ subdir = pixmaps DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/VERSION $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/pre_config.h +CONFIG_HEADER = $(top_builddir)/gfire_config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -48,29 +57,49 @@ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(pidgin_protocol_pix16dir)" \ +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__installdirs = "$(DESTDIR)$(pidgin_emblemsdir)" \ + "$(DESTDIR)$(pidgin_protocol_pix16dir)" \ "$(DESTDIR)$(pidgin_protocol_pix22dir)" \ "$(DESTDIR)$(pidgin_protocol_pix48dir)" -pidgin_protocol_pix16DATA_INSTALL = $(INSTALL_DATA) -pidgin_protocol_pix22DATA_INSTALL = $(INSTALL_DATA) -pidgin_protocol_pix48DATA_INSTALL = $(INSTALL_DATA) -DATA = $(pidgin_protocol_pix16_DATA) $(pidgin_protocol_pix22_DATA) \ - $(pidgin_protocol_pix48_DATA) +DATA = $(pidgin_emblems_DATA) $(pidgin_protocol_pix16_DATA) \ + $(pidgin_protocol_pix22_DATA) $(pidgin_protocol_pix48_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ +DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -82,19 +111,32 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ +LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -103,6 +145,10 @@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -114,17 +160,26 @@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIDGIN_CFLAGS = @PIDGIN_CFLAGS@ -PIDGIN_LIBS = @PIDGIN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PURPLE_CFLAGS = @PURPLE_CFLAGS@ +PURPLE_LIBS = @PURPLE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -161,7 +216,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -180,14 +234,20 @@ top_srcdir = @top_srcdir@ EXTRA_DIST = 16/gfire.png \ 22/gfire.png \ - 48/gfire.png + 48/gfire.png \ + emblems/voip.png \ + emblems/game-voip.png pidgin_protocol_pix16dir = $(datadir)/pixmaps/pidgin/protocols/16 pidgin_protocol_pix22dir = $(datadir)/pixmaps/pidgin/protocols/22 pidgin_protocol_pix48dir = $(datadir)/pixmaps/pidgin/protocols/48 +pidgin_emblemsdir = $(datadir)/pixmaps/pidgin/emblems/16 pidgin_protocol_pix16_DATA = 16/gfire.png pidgin_protocol_pix22_DATA = 22/gfire.png pidgin_protocol_pix48_DATA = 48/gfire.png +pidgin_emblems_DATA = emblems/voip.png \ + emblems/game-voip.png + all: all-am .SUFFIXES: @@ -200,9 +260,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu pixmaps/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu pixmaps/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -220,63 +280,93 @@ 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 +install-pidgin_emblemsDATA: $(pidgin_emblems_DATA) + @$(NORMAL_INSTALL) + test -z "$(pidgin_emblemsdir)" || $(MKDIR_P) "$(DESTDIR)$(pidgin_emblemsdir)" + @list='$(pidgin_emblems_DATA)'; test -n "$(pidgin_emblemsdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pidgin_emblemsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pidgin_emblemsdir)" || exit $$?; \ + done + +uninstall-pidgin_emblemsDATA: + @$(NORMAL_UNINSTALL) + @list='$(pidgin_emblems_DATA)'; test -n "$(pidgin_emblemsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pidgin_emblemsdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pidgin_emblemsdir)" && rm -f $$files install-pidgin_protocol_pix16DATA: $(pidgin_protocol_pix16_DATA) @$(NORMAL_INSTALL) test -z "$(pidgin_protocol_pix16dir)" || $(MKDIR_P) "$(DESTDIR)$(pidgin_protocol_pix16dir)" - @list='$(pidgin_protocol_pix16_DATA)'; for p in $$list; do \ + @list='$(pidgin_protocol_pix16_DATA)'; test -n "$(pidgin_protocol_pix16dir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pidgin_protocol_pix16DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pidgin_protocol_pix16dir)/$$f'"; \ - $(pidgin_protocol_pix16DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pidgin_protocol_pix16dir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pidgin_protocol_pix16dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pidgin_protocol_pix16dir)" || exit $$?; \ done uninstall-pidgin_protocol_pix16DATA: @$(NORMAL_UNINSTALL) - @list='$(pidgin_protocol_pix16_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pidgin_protocol_pix16dir)/$$f'"; \ - rm -f "$(DESTDIR)$(pidgin_protocol_pix16dir)/$$f"; \ - done + @list='$(pidgin_protocol_pix16_DATA)'; test -n "$(pidgin_protocol_pix16dir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pidgin_protocol_pix16dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pidgin_protocol_pix16dir)" && rm -f $$files install-pidgin_protocol_pix22DATA: $(pidgin_protocol_pix22_DATA) @$(NORMAL_INSTALL) test -z "$(pidgin_protocol_pix22dir)" || $(MKDIR_P) "$(DESTDIR)$(pidgin_protocol_pix22dir)" - @list='$(pidgin_protocol_pix22_DATA)'; for p in $$list; do \ + @list='$(pidgin_protocol_pix22_DATA)'; test -n "$(pidgin_protocol_pix22dir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pidgin_protocol_pix22DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pidgin_protocol_pix22dir)/$$f'"; \ - $(pidgin_protocol_pix22DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pidgin_protocol_pix22dir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pidgin_protocol_pix22dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pidgin_protocol_pix22dir)" || exit $$?; \ done uninstall-pidgin_protocol_pix22DATA: @$(NORMAL_UNINSTALL) - @list='$(pidgin_protocol_pix22_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pidgin_protocol_pix22dir)/$$f'"; \ - rm -f "$(DESTDIR)$(pidgin_protocol_pix22dir)/$$f"; \ - done + @list='$(pidgin_protocol_pix22_DATA)'; test -n "$(pidgin_protocol_pix22dir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pidgin_protocol_pix22dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pidgin_protocol_pix22dir)" && rm -f $$files install-pidgin_protocol_pix48DATA: $(pidgin_protocol_pix48_DATA) @$(NORMAL_INSTALL) test -z "$(pidgin_protocol_pix48dir)" || $(MKDIR_P) "$(DESTDIR)$(pidgin_protocol_pix48dir)" - @list='$(pidgin_protocol_pix48_DATA)'; for p in $$list; do \ + @list='$(pidgin_protocol_pix48_DATA)'; test -n "$(pidgin_protocol_pix48dir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pidgin_protocol_pix48DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pidgin_protocol_pix48dir)/$$f'"; \ - $(pidgin_protocol_pix48DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pidgin_protocol_pix48dir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pidgin_protocol_pix48dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pidgin_protocol_pix48dir)" || exit $$?; \ done uninstall-pidgin_protocol_pix48DATA: @$(NORMAL_UNINSTALL) - @list='$(pidgin_protocol_pix48_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pidgin_protocol_pix48dir)/$$f'"; \ - rm -f "$(DESTDIR)$(pidgin_protocol_pix48dir)/$$f"; \ - done + @list='$(pidgin_protocol_pix48_DATA)'; test -n "$(pidgin_protocol_pix48dir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pidgin_protocol_pix48dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pidgin_protocol_pix48dir)" && rm -f $$files tags: TAGS TAGS: @@ -300,13 +390,17 @@ 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -314,7 +408,7 @@ check: check-am all-am: Makefile $(DATA) installdirs: - for dir in "$(DESTDIR)$(pidgin_protocol_pix16dir)" "$(DESTDIR)$(pidgin_protocol_pix22dir)" "$(DESTDIR)$(pidgin_protocol_pix48dir)"; do \ + for dir in "$(DESTDIR)$(pidgin_emblemsdir)" "$(DESTDIR)$(pidgin_protocol_pix16dir)" "$(DESTDIR)$(pidgin_protocol_pix22dir)" "$(DESTDIR)$(pidgin_protocol_pix48dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -337,6 +431,7 @@ 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" @@ -355,28 +450,41 @@ html: html-am +html-am: + info: info-am info-am: -install-data-am: install-pidgin_protocol_pix16DATA \ +install-data-am: install-pidgin_emblemsDATA \ + install-pidgin_protocol_pix16DATA \ install-pidgin_protocol_pix22DATA \ install-pidgin_protocol_pix48DATA 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 @@ -395,7 +503,8 @@ ps-am: -uninstall-am: uninstall-pidgin_protocol_pix16DATA \ +uninstall-am: uninstall-pidgin_emblemsDATA \ + uninstall-pidgin_protocol_pix16DATA \ uninstall-pidgin_protocol_pix22DATA \ uninstall-pidgin_protocol_pix48DATA @@ -407,16 +516,19 @@ 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-pidgin_protocol_pix16DATA \ + install-pdf-am install-pidgin_emblemsDATA \ + install-pidgin_protocol_pix16DATA \ install-pidgin_protocol_pix22DATA \ install-pidgin_protocol_pix48DATA 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 uninstall-pidgin_protocol_pix16DATA \ + uninstall uninstall-am uninstall-pidgin_emblemsDATA \ + uninstall-pidgin_protocol_pix16DATA \ uninstall-pidgin_protocol_pix22DATA \ uninstall-pidgin_protocol_pix48DATA + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru gfire-0.8.3/pixmaps/Makefile.mingw gfire-0.9.4/pixmaps/Makefile.mingw --- gfire-0.8.3/pixmaps/Makefile.mingw 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/pixmaps/Makefile.mingw 2010-01-09 14:56:59.000000000 +0000 @@ -0,0 +1,19 @@ +GFIRE_DIR = .. +include ../mingw.mak + +.PHONY: all clean + +all: 16/gfire.png 22/gfire.png 48/gfire.png + +clean: + +install: all + mkdir -p ${WIN32_INSTALL_DIR}/pixmaps/pidgin/protocols/16 + mkdir -p ${WIN32_INSTALL_DIR}/pixmaps/pidgin/protocols/22 + mkdir -p ${WIN32_INSTALL_DIR}/pixmaps/pidgin/protocols/48 + cp 16/gfire.png ${WIN32_INSTALL_DIR}/pixmaps/pidgin/protocols/16/ + cp 22/gfire.png ${WIN32_INSTALL_DIR}/pixmaps/pidgin/protocols/22/ + cp 48/gfire.png ${WIN32_INSTALL_DIR}/pixmaps/pidgin/protocols/48/ + mkdir -p ${WIN32_INSTALL_DIR}/pixmaps/pidgin/emblems/16 + cp emblems/voip.png ${WIN32_INSTALL_DIR}/pixmaps/pidgin/emblems/16/ + cp emblems/game-voip.png ${WIN32_INSTALL_DIR}/pixmaps/pidgin/emblems/16/ \ No newline at end of file diff -Nru gfire-0.8.3/po/cs.po gfire-0.9.4/po/cs.po --- gfire-0.8.3/po/cs.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/cs.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1203 @@ +# Gfire Czech Translation +# Copyright (C) 2009 Gfire Team +# This file is distributed under the same license as the Gfire package. +# Petr Procházka , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2009-09-26 23:56+0100\n" +"Last-Translator: Petr Procházka \n" +"Language-Team: none\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Rozšířená nastavení" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Základní nastavení" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Přidat hru" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Detekce spustitelného souboru:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Upravit nebo odebrat hru" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Hra :" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Spustit soubor:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Prefix při spuštění:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Správa her:" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "" + +#: ../data/servers.glade.h:2 +#, fuzzy +msgid "Port:" +msgstr "Port" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Prohlížeč serverů" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Přátelé přátel" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s nemusel dostat tuto zprávu:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, fuzzy, c-format +msgid "Playing %s now!" +msgstr "Hraje %s" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "" + +#: ../src/gf_buddies.c:1099 +#, fuzzy, c-format +msgid "Playing %s - %s" +msgstr "Hraje %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Hraje %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "P2P spojení není dostupné" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "Nelze navázat spojení. P2P přenos souborů a zpráv nelze uskutečnit." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +#, fuzzy +msgid "Moderator" +msgstr "Monitor" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +#, fuzzy +msgid "Unknown" +msgstr "neznámé" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "" + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "" + +#: ../src/gf_chat.c:366 +#, fuzzy, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Váš stav se změnil." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Dnešní zpráva se změnila na:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, fuzzy, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Váš stav se změnil." + +#: ../src/gf_chat.c:462 +#, fuzzy, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "Váš stav se změnil." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Právě chatuješ v %s." + +#: ../src/gf_chat.c:499 +#, fuzzy, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Dnešní zpráva:\n" +"%s." + +#: ../src/gf_chat.c:582 +#, fuzzy, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Váš stav se změnil." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "" + +#: ../src/gf_chat.c:604 +#, fuzzy +msgid "Friends only" +msgstr "Přátelé" + +#: ../src/gf_chat.c:610 +#, fuzzy, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Váš stav se změnil." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "" + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "" + +#: ../src/gf_chat.c:629 +#, fuzzy, c-format +msgid "This room's password has been changed." +msgstr "Váš stav se změnil." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "" + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "" + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "" + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "" + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "" + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "" + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "" + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "" + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "" + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "" + +#: ../src/gf_chat.c:1131 +#, fuzzy +msgid "Join" +msgstr "Datum registrace" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Zrušit" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "" + +#: ../src/gf_chat_proto.c:517 +#, fuzzy +msgid "Unknown error" +msgstr "neznámé" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Hledání uživatelů Xfire" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "" +"Sem prosím zadejte uživatelské jméno nebo e-mail hledaného uživatele Xfire" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Např.: gill123, Gill Bates nebo gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Hledat" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Uživatelské jméno" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Křestní jméno" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Příjmení" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Výsledky hledání" + +#: ../src/gf_games.c:46 +#, fuzzy, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Hra byla úspěšně upravena." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +#, fuzzy +msgid "New Gfire Game List Version" +msgstr "Nová verze seznamu her: %s" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Správa her: chyba" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Hru nelze přidat" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "" + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Správa her: hra byla přidána" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Hra byla úspěšně přidána." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Správa her: upozornění" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Hra byla úpěšně přidána" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "" +"Tato hra už byla přidána, pokud chcete, můžete upravit její konfiguraci." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Prosím zkuste to znovu. Je třeba vyplnit všechna pole." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Data pro spuštění hry nebyla nalezena" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "" +"Zdá se, že tato ještě není ve vašem seznamu. Nejprve ji přidejte prosím!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Správa her: hra byla upravena" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Hra byla upravena" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Hra byla úspěšně upravena." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Hru nelze upravit" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Hru nelze odstranit" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "" + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Správa her: hra byla odstraněna" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Hra odstraněna" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Hra byla úspěšně odstraněna." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "Prosím zkuste to znovu. Hru, kterou chcete odstranit je třeba označit." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Byl jste odpojen." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Chyba při čtení ze socketu." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Uživatelské jméno nebo heslo není správné." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Chyba verze protokolu, správná hodnota je %d. Nastavení na novou hodnotu " +"proběhne automaticky." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Účet byl přihlášen na jiném počítači." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Hra" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Server" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "neznámé" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Stav" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Přátelé" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "V průběhu inicializace protokolu došlo k chybě." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "Zpráva nemohla být odeslána. Příjemce není v seznamu kontaktů." + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Zpráva nemohla být odeslána. Příjemce je offline" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +#, fuzzy +msgid "Xfire Invitation Message" +msgstr "Správa vysílání v síti Xfire:" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "" + +#: ../src/gf_purple.c:587 +#, fuzzy +msgid "Xfire Buddy Removal" +msgstr "Smazání Xfire kontaku bylo odepřeno" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Přidat do seznamu" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Připojit se do hry ..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Připojit se na VoIP ..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Xfire profil" + +#: ../src/gf_purple.c:716 +#, fuzzy, c-format +msgid "Launch %s" +msgstr "Parametry při spuštění:" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Změnit přezdívku" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Web mého profilu" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Hledání přátel" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Znovu načíst konfuguraci her" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "O programu" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Skupinový chat Xfire" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "MotD změna se nezdařila" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "MotD obsahuje víc než 200 znaků." + +#: ../src/gf_purple.c:1006 +#, fuzzy +msgid "Friends of friends group name restored" +msgstr "Skupina - Přátelé přátel" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +#, fuzzy +msgid "Group name restored" +msgstr "Hra odstraněna" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Verze" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Ukázat přátelům, že jim píši" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Automatická detekce ingame stavu " + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Upozornit v případě změny stavu na ingame" + +#: ../src/gf_purple.c:1258 +#, fuzzy +msgid "Enable server detection" +msgstr "Použít serverovou detekci" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Použít P2P vlastnosti Xfire" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "" + +#: ../src/gf_purple.c:1269 +#, fuzzy +msgid "Show Friends of Friends" +msgstr "Skupina - Přátelé přátel" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Plugin Xfire protokolu" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +#, fuzzy +msgid "New Gfire Version" +msgstr "Verze Gfire: %s" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Připojuji se" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Socket nelze vytvořit." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Login odeslán" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Nejsem u počítače" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Jsem zaneprázdněn!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Chyba" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Načítání dat o herní sestavě se nezdařilo!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Data o herní sestavě, která byla přijata, nejsou platná!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss Herní sestava:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Výrobce" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Procesor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Paměť" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Grafická karta" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Zvuková karta" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Základní deska" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Pevný disk" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Monitor" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Klávesnice" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Myš" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Podložka pod myš" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Reproduktory" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Počítačová skříň" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Operační systém" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Načítání dat profilu se nezdařilo!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Data profilu, která byla přijata nejsou platná!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss Profil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Skutečné jméno" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Věk" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Pohlaví" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Muž" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Žena" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Zaměstnání" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Země" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Město" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Herní styl" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Záliby" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Přátelé" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Datum registrace" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Přezdívka" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Offline" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Dodatečné informace o hře:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss Klany:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Vypršel čas čekání na spojení" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Herní stav" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Váš stav se změnil." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Data o přihlášení, která byla přijata, nejsou platná!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Vysílání v síti Xfire" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Správa vysílání v síti Xfire:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +#, fuzzy +msgid "Server Browser: error" +msgstr "Prohlížeč serverů" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Změnit Xfire přezdívku" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Pokud pole nevyplníte, vaše současná přezdívka bude smazána." + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Gfire XML byl opakovaně načten" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Opakuji načítání gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "" +"Operace nebyla provedena. Soubor nebyl nalezen nebo neměl správný obsah." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Opakované načtení proběhlo úspěšně." + +#: ../src/gf_menus.c:152 +#, fuzzy, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Verze Gfire:\t\t%s\n" +"Verze seznamu her:\t%s" + +#: ../src/gf_menus.c:157 +#, fuzzy, c-format +msgid "Gfire Version: %s" +msgstr "Verze Gfire: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "O Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Xfire Plugin pro Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Zavřít" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Webová stránka" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Verze Gfire: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Popis nebyl zadán" + +#~ msgid "Not Removing %s" +#~ msgstr "Nebude smazán %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "Účet je nastaven tak, aby vaše kontakty nebyli mazány i ze seznamu na " +#~ "serveru\n" +#~ "Kontak bude obnoven při příštím přihlášení." + +#~ msgid "Don't delete buddies from server" +#~ msgstr "Nemazat kontakty ze seznamu na serveru" + +#~ msgid "Connect option:" +#~ msgstr "Možnosti připojení:" + +#~ msgid "Required argument:" +#~ msgstr "Potřebný argument:" + +#~ msgid "Use detection" +#~ msgstr "Použít detekci" + +#~ msgid "Ping" +#~ msgstr "Ping" + +#~ msgid "Players" +#~ msgstr "Hráči" + +#~ msgid "Server IP" +#~ msgstr "IP serveru" + +#~ msgid "Server name" +#~ msgstr "Název serveru" + +#~ msgid "bookmark-new" +#~ msgstr "Nová záložka" + +#~ msgid "%s [Xfire Chat]" +#~ msgstr "%s [Xfire Chat]" + +#~ msgid "Please try again. An error occured while adding the game." +#~ msgstr "Prosím zkuste to znovu. V průběhu přidávání hry se vyskytla chyba." + +#~ msgid "Please try again. An error occured while editing the game." +#~ msgstr "Prosím zkuste to znovu. V průběhu úpravy hry se vyskytla chyba." + +#~ msgid "Please try again. An error occured while removing the game." +#~ msgstr "" +#~ "Prosím zkuste to znovu. V průběhu odstraňování hry se vyskytla chyba." + +#~ msgid "Incompatible games configuration" +#~ msgstr "Nekompatibilní konfigurace hry" + +#~ msgid "" +#~ "Your current games configuration is incompatible with this version of " +#~ "Gfire. Please remove it and try again." +#~ msgstr "" +#~ "Vaše současná konfigurace hry není kompatibilní s touto verzí Gfire. " +#~ "Prosím odstraňte ji a zkuste to znovu." + +#~ msgid "P2P Port Range min. (1024-65535)" +#~ msgstr "Rozsah P2P portu min. (1024-65535)" + +#~ msgid "P2P Port Range max. (1024-65535)" +#~ msgstr "Rozsah P2P portu max. (1024-65535)" + +#~ msgid "Reload Game ID List" +#~ msgstr "Znovu načíst ID seznam her" + +#~ msgid "Get Game ID List" +#~ msgstr "Získat ID seznam her" + +#~ msgid "Couldn't get the latest game config." +#~ msgstr "Nemohu načíst aktuální konfiguraci hry." + +#~ msgid "Reloading gfire_games.xml" +#~ msgstr "Opakuji načítání gfire_games.xml" + +#~ msgid "Gfire Game List Download" +#~ msgstr "Stáhnout seznam her pro Gfire" + +#~ msgid "Download failed" +#~ msgstr "Stahování se nezdařilo" + +#~ msgid "Download successful" +#~ msgstr "Úspěšně staženo" + +#~ msgid "Unable to write gfire_games.xml" +#~ msgstr "Nelze zapsat gfire_games.xml" diff -Nru gfire-0.8.3/po/de.po gfire-0.9.4/po/de.po --- gfire-0.8.3/po/de.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/de.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1262 @@ +# Gfire German Translation +# Copyright (C) 2009 Gfire Team +# This file is distributed under the same license as the Gfire package. +# Gfire Team , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-04-26 21:42+0100\n" +"Last-Translator: Oliver Ney \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: German\n" +"X-Poedit-Country: GERMANY\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Erweiterte Einstellungen" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Grundeinstellungen" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Spiel hinzufügen" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Datei für Erkennung:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Spiel ändern oder hinzufügen" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Spiel:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Datei für Start:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Startprefix:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Spiele verwalten" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Nutze die gleiche Datei" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "IP Adresse:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Server Browser" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Freunde von Freunden spielen" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s hat diese Nachricht vielleicht nicht empfangen:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Spielt jetzt %s!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "Hat aufgehört zu spielen!" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Spielt %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Spielt %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "P2P Verbindung nicht möglich" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Wir sind nicht in der Lage eine Verbindung zum Buddy herzustellen. " +"Dateitransfer und P2P Chatten wird nicht möglich sein." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Rechtlos (stumm)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normal" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Power-User" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderator" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Admin" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Unbekannt" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Du hast momentan das Recht \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Teilnehmer wurde gekickt." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Der Name dieses Chat-Raums wurde auf \"%s\" geändert." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Heutige Nachricht geändert in:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Deine Rechte wurden auf \"%s\" geändert." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "%ss Rechte wurden auf \"%s\" geändert." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Du chattest nun in %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Heutige Nachricht:\n" +"%s" + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Die Standardberechtigung in diesem Raum wurde auf \"%s\" geändert." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Öffentlich" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Nur Freunde" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Die Sichtbarkeit dieses Raumes wurde auf \"%s\" geändert." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "Dieser Raum ist jetzt passwortgeschützt." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "Dieser Raum ist nicht länger passwortgeschützt." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Das Passwort dieses Raumes wurde geändert." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "Dieser Raum ist jetzt stumm geschaltet." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "Dieser Raum ist nicht länger stumm geschaltet." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "Beitritts- und Verlassensnachrichten werden nun angezeigt." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "Beitritts- und Verlassensnachrichten werden nicht länger angezeigt." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Unbekanntes Argument: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Neuer und alter Name sind identisch. Bitte beachte, dass Chat-Raum Namen " +"nicht zwischen Groß- und Kleinschreibung unterscheiden." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Unbekannte Sichtbarkeit: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Es ist dir nicht gestattet, Berechtigungen zu vergeben/zu entziehen." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Unbekannter Teilnehmer: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Du kannst deine eigene Berechtigung nicht ändern." + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Dir ist nicht gestattet, diese Berechtigung zu vergeben." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Unbekannte Berechtigung: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Es ist dir nicht erlaubt, Teilnehmer zu kicken." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Du kannst dich nicht selbst kicken!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Dir ist nicht gestattet, die Standardberechtigung zu ändern." + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Dir ist nicht gestattet, diese Standardberechtigung zu setzen." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Speichere den aktuellen Chat-Raum in Xfire. Dies " +"speichert alle Chat-Raum Einstellungen und Berechtigungen. Bei "" +"yes" wirst du gefragt, ob du den Raum in deiner Buddy Liste speichern " +"möchtest. Wenn du diese Anfrage abbrichst, wird die Speicherung NICHT " +"durchgeführt." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <neuer-chat-name%gt;:
Ändert den aktuellen Namen für diesen " +"Chat-Raum.

Benötigt "Admin" Berechtigungen." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<neues-passwort>]:
Ändert das aktuelle Passwort für " +"diesen Raum. "/password" löscht das aktuelle Passwort.

Benötigt "Admin" Berechtigungen." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibility <public|friends>:
Ändert die aktuelle Sichtbarkeit " +"dieses Chat-Raumes.

Benötigt "Admin" Berechtigungen." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Setzt, ob Teilnehmer mit weniger als Moderator-" +"Rechten in diesem Raum reden dürfen.

Benötigt "" +"Moderator" oder höhere Berechtigungen." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Setzt, ob "<Teilnehmer> " +"beigetreten" und "<Teilnehmer> hat den Raum verlassen"-" +"Nachrichten in diesem Raum angezeigt werden sollen.

Benötigt " +""Moderator" oder höhere Berechtigungen." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <nutzername> <muted|normal|power|moderator|admin>:" +"
Setzt nutzernames Berechtigung. Nur Admins dürfen anderen " +"Teilnehmern die "Admin"-Berechtigung geben.
Bitte beachte, " +"dass du deine eigenen Berechtigungen nicht ändern kannst.

Benötigt "Moderator" oder höhere Berechtigungen." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <nutzername>:
Kickt nutzername aus dem Chat-Raum.

Benötigt "Moderator" oder höhere Berechtigungen." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Setzt die " +"Standardberechtigung in diesem Chat-Raum. Neue Teilnehmer, die diesen Raum " +"betreten, werden diese Berechtigung haben.

Benötigt "" +"Moderator" oder höhere Berechtigungen." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" +"Du hast versucht einen Chat-Raum mit einem ungültigen Passwort zu betreten, " +"bitte versuche es noch einmal." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Ungültiges Passwort" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" +"Du hast versucht einen Chat-Raum zu betreten, der durch ein Passwort " +"gesichert wird. Bitte versuche es noch einmal." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Passwort benötigt" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Beitreten" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Abbrechen" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Fehler beim Chat-Raum-Betreten" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Unbekannter Fehler" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Unbekannter Fehler beim Beitreten. Du könntest aus diesem Raum verbannt " +"worden sein oder du bist bereits in 5 Chat-Räumen." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Xfire Freundessuche" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "" +"Bitte gib hier einen Xfire Nutzernamen, Namen oder eine e-Mail Adresse ein:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Zum Beispiel: gill123, Gill Bates oder gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Suche" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Nutzername" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Vorname" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Nachname" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Suchergebnisse" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Die Game List wurde auf Version %s aktualisiert." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Neue Game List Version" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Spiele verwalten: Fehler" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Konnte das Spiel nicht hinzufügen" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Solch ein Spiel gibt es nicht, bitte versuche es noch einmal." + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Spiele verwalten: Spiel hinzugefügt" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Das Spiel wurde erfolgreich hinzugefügt." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Spiele verwalten: Warnung" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Spiel bereits hinzugefügt" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "" +"Dieses Spiel ist bereits hinzugefügt, du kannst es konfigurieren, wenn du " +"willst." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Bitte versuche es nochmal. Achte darauf, alle Felder auszufüllen." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Spielkonfiguration nicht gefunden" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "" +"Wie es scheint, wurde dieses Spiel noch nicht hinzugefügt. Bitte füge es " +"erst hinzu!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Spiele verwalten: Spiel geändert" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Spiel geändert" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Das Spiel wurde erfolgreich geändert." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Konnte das Spiel nicht ändern." + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Konnte das Spiel nicht entfernen" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Solch ein Spiel gibt es nicht, bitte versuche es noch einmal." + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Spiele verwalten: Spiel entfernt" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Spiel entfernt" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Das Spiel wurde erfolgreich entfernt." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "" +"Bitte versuche es noch einmal. Achte darauf ein zu löschendes Spiel " +"auszuwählen." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Verbindung von Xfire geschlossen." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Fehler beim Lesen des Sockets." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Passwort oder Nutzername falsch." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Falsche Protokollversion, benötigt wird %d. Automatisch auf neuen Wert " +"gesetzt." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Du hast dich woanders angemeldet." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Xfire Gemeinschafts Seite" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Spiel" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Server" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "unbekannt" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Status" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Gemeinsame Freunde" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Protokollinitialisierung fehlgeschlagen" + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "" +"Nachricht konnte nicht gesendet werden. Buddy nicht in der Kontaktliste" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Nachricht konnte nicht gesendet werden. Buddy ist offline" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Xfire Einladungsnachricht" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" +"Bitte gib die Nachricht ein, die du deinem Freund mit dieser Einladung " +"schicken möchtest:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Bitte nimm mich in deine Freundesliste auf!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Einladen mit einer Nachricht" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Einladen ohne eine Nachricht" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Entfernen eines Xfire Buddys" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Du hast einen Buddy entfernt, welcher nicht auf deiner Freundesliste ist. Er " +"wird beim nächsten Login wiederhergestellt." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Als Freund hinzufügen" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Spiel beitreten..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "VoIP beitreten..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Xfire Profil" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Starte %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Nicknamen ändern" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Mein Profil" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Freundessuche" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Spielkonfiguration neu laden" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "Über Gfire" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Raum:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Passwort:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Xfire Gruppenchat" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "MotD Änderung fehlgeschlagen" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "Die MotD enthält mehr als 200 Zeichen." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Freunde von Freunde-Gruppenname wiederhergestellt" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Gruppenname wiederhergestellt" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Du hast Xfires \"Freunde von Freunden\"-Gruppenname geändert. " +"Unglücklicherweise mussten wir den Namen wiederherstellen. " + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Clan-Gruppen-Name wiederhergestellt" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"Du hast den Gruppenamen eines Xfire Clans geändert. Unglücklicherweise " +"mussten wir den Namen wiederherstellen. " + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Version" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Buddies sehen, wenn ich tippe" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Erkenne meinen Ingame-Status" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Ändere meinen Status auch für andere Protokolle" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Benachrichtige mich, wenn mein Status ingame ist" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Nutze Servererkennung" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Nutze Xfires P2P Features" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Zeige Benachrichtigungen bei verschiedenen Ereignissen" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Zeige Freunde von Freunden" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Xfire Protokoll Plugin" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s ist jetzt verfügbar.\n" +"Besuche die Gfire Website für weitere Infos!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Neue Gfire Version" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s ist jetzt verfügbar.\n" +"Besuche die Gfire Website für weitere Infos!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Verbinde" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Konnte Socket nicht erstellen" + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Login gesendet" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Away From Keyboard (Nicht am Computer)" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Ich bin beschäftigt!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Fehler" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Empfangen der Gamerig-Daten fehlgeschlagen!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Ungültige Gamerig-Daten empfangen!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss Gaming Rig:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Hersteller" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Prozessor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Speicher" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Grafikkarte" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Soundkarte" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Mainboard" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Festplatte" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Monitor" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Tastatur" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Maus" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Mauspad" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Lautsprecher" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Gehäuse" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Betriebssystem" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Empfangen der Profil-Daten fehlgeschlagen!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Ungültige Profil-Daten empfangen!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss Profil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Echter Name" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Alter" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Geschlecht" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Männlich" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Weiblich" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Tätigkeit" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Land" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Ort" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Spielstil" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Interessen" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Freunde" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Beitrittsdatum" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Nickname" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Offline" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Zusätzliche Spielinfos:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss Clans:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Zeitüberschreitung der Verbindung" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Ingame Status" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Dein Status wurde geändert." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Ungültige Login-Salt empfangen!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Xfire Systemmeldung" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Xfire Systemmeldung:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Zuletzt genutzte Server" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Favoriten" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Favoriten deiner Freunde" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Alle Server" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Server Browser: Fehler" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Konnte den Server nicht hinzufügen" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Du hast das Maximum der erlaubten Favoriten erreicht. Du kannst allerdings " +"alte Server löschen, um neue hinzuzufügen." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Konnte Favoriten nicht löschen" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"Der ausgewählte Server ist kein Favorit, kann daher nicht gelöscht werden." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Xfire Nicknamen ändern" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Lass das Feld leer, um deinen aktuellen Nicknamen zu löschen." + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Neu Laden einer Gfire XML Datei" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Lade gfire_game_config.xml neu" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "" +"Operation fehlgeschlagen. Datei nicht gefunden oder Inhalt war fehlerhaft." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Datei erfolgreich neu geladen." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Gfire Version: %s\n" +"Game List Version: %s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Gfire Version: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "Über Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Xfire Plugin für Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Schließen" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Website" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Bitte warte, bis eine Verbindung zu deinem Freund hergestellt wurde!" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Dateibeschreibung: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Keine Beschreibung eingegeben" + +#~ msgid "Not Removing %s" +#~ msgstr "Entferne nicht %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "Die Account Einstellung ist, Buddys nicht aus Xfire zu löschen.\n" +#~ "Der Buddy wird beim nächsten Login wiederhergestellt." + +#~ msgid "Don't delete buddies from server" +#~ msgstr "Entferne Buddies nicht vom Server" + +#~ msgid "Connect option:" +#~ msgstr "Verbindungsoption:" + +#~ msgid "Required argument:" +#~ msgstr "Benötigtes Argument:" + +#~ msgid "Use detection" +#~ msgstr "Nutze Erkennung" + +#~ msgid "Ping" +#~ msgstr "Ping" + +#~ msgid "Players" +#~ msgstr "Spieler" + +#~ msgid "Server IP" +#~ msgstr "Server IP" + +#~ msgid "Server name" +#~ msgstr "Server Name" + +#~ msgid "bookmark-new" +#~ msgstr "bookmark-new" + +#~ msgid "%s [Xfire Chat]" +#~ msgstr "%s [Xfire Chat]" + +#~ msgid "New Gfire version available" +#~ msgstr "Neue Gfire Version verfügbar" + +#~ msgid "" +#~ "The games list has been successfully updated to the latest version " +#~ "available." +#~ msgstr "" +#~ "Die Game List wurde erfolgreich auf die neuste Version aktualisiert." + +#~ msgid "Please try again. An error occured while adding the game." +#~ msgstr "" +#~ "Bitte versuche es noch einmal. Ein Fehler ist beim Hinzufügen aufgetreten." + +#~ msgid "Please try again. An error occured while editing the game." +#~ msgstr "" +#~ "Bitte versuche es nochmal. Ein Fehler trat beim Ändern des Spiels auf." + +#~ msgid "Please try again. An error occured while removing the game." +#~ msgstr "" +#~ "Bitte versuche es noch einmal. Ein Fehler trat beim Entfernen des Spiels " +#~ "auf." + +#~ msgid "Incompatible games configuration" +#~ msgstr "Inkompatible Spielkonfiguration" + +#~ msgid "" +#~ "Your current games configuration is incompatible with this version of " +#~ "Gfire. Please remove it and try again." +#~ msgstr "" +#~ "Deine aktuelle Spielkonfiguration ist inkompatibel mit dieser Version von " +#~ "Gfire. Bitte entferne sie und versuche es noch einmal." + +#~ msgid "P2P Port Range min. (1024-65535)" +#~ msgstr "P2P Portbereich min. (1024-65535)" + +#~ msgid "P2P Port Range max. (1024-65535)" +#~ msgstr "P2P Portbereich max. (1024-65535)" + +#~ msgid "Reload Game ID List" +#~ msgstr "Game List neu laden" + +#~ msgid "Get Game ID List" +#~ msgstr "Game List aktualisieren" + +#~ msgid "Couldn't get the latest game config." +#~ msgstr "Konnte die neuste Game List nicht empfangen." + +#~ msgid "Reloading gfire_games.xml" +#~ msgstr "Lade gfire_games.xml neu" + +#~ msgid "Gfire Game List Download" +#~ msgstr "Gfire Game List Download" + +#~ msgid "Download failed" +#~ msgstr "Download fehlgeschlagen" + +#~ msgid "Download successful" +#~ msgstr "Download erfolgreich" + +#~ msgid "Unable to write gfire_games.xml" +#~ msgstr "Konnte gfire_games.xml nicht schreiben" diff -Nru gfire-0.8.3/po/ee.po gfire-0.9.4/po/ee.po --- gfire-0.8.3/po/ee.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/ee.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1145 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-04-26 21:45+0100\n" +"Last-Translator: Oliver Ney \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Estonian\n" +"X-Poedit-Country: ESTONIA\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Keerulised sätted" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Lihtsad sätted" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Lisa Mäng" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Avastatud käivitaja:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Muuda või eemalda mäng" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Mäng:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Lae käivitaja:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Lae eesliide:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Halda mänge" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Kasuta sama faili" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "IP aadress:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Serveri Lehitseja" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Sõprade sõbrad mängivad mänge" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s ei pruukinud seda sõnumit saada: \n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Mängib nüüd %s !" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "Lõpetas mängimise!" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Mängib %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Mängib %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "P2P ühendus ei ole võimalik" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Meil ei ole võimalik sinu semuga ühendust luua. Faili saatmine ja P2P " +"sõnumid ei ole kasutatavad." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Õigusteta (hääletu)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normaalne" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Mõjukas-Kasutaja" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderaator" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Administraator" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Tundmatu" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Sul ei ole hetkel õigusi \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Semu on eemaldatud" + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Selle ruumi nimi on muudetud \"%s\" -ks." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Tänane teavitus on muudetud: \n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Sinu õigused on muudetud \"%s\" -ks." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "%s -i õigused on muudetud \"%s\" -ks." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Sa vestled nüüd %s" + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Tänane sõnum: \n" +"%s" + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Selle ruumi vaike õigused on muudetud \"%s\" -ks." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Avalik" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Ainult Sõbrad" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Selle ruumi nähtavus on muudetud \"%s\" -ks." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "See ruum on nüüd parooliga kaitstud." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "See ruum ei ole enam parooliga kaitstud." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Selle ruumi parool on muudetud." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "See ruum on nüüd vaigistatud." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "See ruum ei ole enam vaigistatud." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "Semu liitu-/lahkumise sõnumid kuvatakse nüüd." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "Semu liitu-/lahkumise sõnumeid ei kuvata enam." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Tundmatu argument: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Uus ja vana nimi on samad. Palun pane tähele et vestlus ruumis nimedel " +"puuduvad suur/väike-tähed." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Tundmatu nähtavus: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Sul ei ole lubatud lisada/eemaldada õigusi." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Tundmatu semu: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Sa ei saa muuta enda õigusi!" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Sul ei ole lubatud anda seda õigust." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Tundmatu õigus: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Sul ei ole lubatud eemaldada semusid." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Sa ei saa ennast eemaldada!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Sul ei ole lubatud muuta vaike õigust." + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Sul ei ole võimalik seada seda vaike õigust." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Salvesta hetke vestlus ruum Xfire-s. See haarab " +"kõiki vestlusruumi sätteid ja õigusi. %qout;yes" ,sult küsitakse " +"salvestada vestlusruum oma semude listi, kui seda veel seal ei ole. Kui sa " +"tühistad selle nõude, siis salvestust ei tehta." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <new-chat-name>:
Muudab ruumi nime.

nõuab " +""Admin" õigusi." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<new-password>]:
Muudab parooli selles ruumis. "/" +"password" tähendab parooli eemaldamist.

Nõuab "" +"Admin" õigusi." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibility <public|friends>.
Muudab ruumi nähtavust.

" +"Nõuab "Admin" õigusi." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Seab kas mitte-moderaatorid ja mitte-" +"administratoorid võivad selles ruumis rääkida.

Nõuab "" +"Moderator" või kõrgema õigusi." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Seab kas "<User>joined" ja " +""<User> left" sõnumid on selles ruumis näidatud.

" +"Nõuab "Moderator&Quot; või kõrgema õigusi." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <username> <muted|normal|power|moderator|admin>:
Seab username õiguse. Ainult administraatorid võivad kasutajatele " +""Admin" anda õigusi.
Palun pane tähele, et sa ei saa muuta " +"enda õigusi.

Nõuab "Moderator" või kõrgema õigusi." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <username>:
Eemaldab username kanalist.

" +"Nõuab "Moderator" või kõrgema õigusi." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Seab selle " +"ruumi vaike õigused. Uued semud kes ühinevad saavad need õigused.

Nõuab "Moderator" või kõrgema õigusi." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" +"Sa proovisin ühineda vestlus ruumiga, kasutades vale parooli. Palun proovi " +"uuesti." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Vale parool" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" +"Sa proovisin ühineda vestlus ruumiga, mis on parooliga kaitstud. Palun " +"proovi uuesti." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "parool on nõutud." + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Liitu" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Tühista" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Vestlus ruumi liitumise viga." + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Tundmatu viga" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Tundmatu liitumise viga. Sa võid olla blokeeritud sellest vestlus ruumist " +"või sa juba oled 5-s ruumis." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Xfire Sõbra otsing" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "Palun sisesta Xfire kasutajanimi, nimi või e-maili aadress siia:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Näide:gill123, Gill Bates või gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Otsing" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "kasutajanimi" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Eesnimi" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Perekonna nimi" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Otsingu tulemused" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Mängude nimekiri on uuendatud versioonile: %s" + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Uus Gfire mängude listi versioon" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Halda Mänge: viga" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Ei saanud mängu lisada" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Sellist mängu ei ole, palun proovi uuesti." + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Halda mänge: mäng lisatud" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "See mäng on edukalt lisatud." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Halda mänge: hoiatus" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Mäng on juba lisatud" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "See mäng on juba lisatud, sa saad seda konfigureerida, kui sa tahad." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Palun proovi uuesti. Kindlasti täida kõik lahtrid" + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Mängu käivitamise andmeid ei leitud" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "Seda mängu ei ole veel lisatud, palun lisa see ennem!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Halda mänge: mäng muudetud" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Mäng muudetud" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "See mäng on edukalt muudetud." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Ei saanud mängu muuta" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Ei saanud mängu eemaldada." + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Sellist mängu pole, palun proovi uuesti!" + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Halda mänge: mäng eemaldatud" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Mäng eemaldatud" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "See mäng o edukalt eemaldatud." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "" +"Palun proovi uuesti. Kindlasti jälgi et sa valiksid mängu mida eemdalda." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Ühendus suletud." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Socketi lugemise viga." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Parool ja kasutajanimi valed." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Protocol'i versioon ei klapi, peab olema %d. Automaatselt uuele ühikule " +"seadistatud." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Sa oled teisest kohast sisse loginud." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Xfire Kommuuni leht" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "mäng" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Server" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "Tundmatu" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Staatus" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "üldised sõbrad" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Protocoli tuvastamine ebaõnnestus." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "Sõnumit ei saanud saata. Semu ei ole kotaktide nimekirjas" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Sõnumit ei saanud saata. Semu on väljas" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Xfire kutse sõnum" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "Palun sisesta sõnum mida sa tahad saata oma semule kutsumiseks:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Palun lisa mid oma sõprade nimekirja!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Kutsu sõnumiga" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Kutsu ilma sõnumita" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Xfire semu eemaldamine" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Sa eemaldasid semu kes ei ole sinu sõprade nimekirjas. See taastatakse " +"järgmisel sisselogimisel." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Lisa Sõbraks" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Ühine Mängu..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Ühine VoIP-i..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Xfire profiil" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Käivita %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Muuda hüüdnime" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Minu profiili lehekülg" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Sõbra otsing" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Lae mängu seadistused uuesti" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "Programmist lähemalt" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Ruum:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Parool:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Xfire Grupi vestlus" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "Päeva sõnumi muutmine ebaõnnestus" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "päeva sõnum sisaldab rohkem kui 200 ühikut." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Sõprade sõprade grupi nimi taastatud" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Grupi nimi taastatud" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Sa muutsid Xfire Sõprade sõprade grupi nime. Kahjuks pidime me grupi nime " +"taastama." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Klanni rupi nimi taastatud" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "Sa muutsid Klanni grupi nime. Kahjuks pidime me grupi nime taastama." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Versioon" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Semud näevad kui ma trükin" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Avasta automaatselt mängusisene staatus" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Muuda mu staatust ka teiste protokollide jaoks" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Teavita mind kui mu staatus on mängusisene." + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "lülita serveri avastamine sisse" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Kasuta Xfire P2P võimalusi" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Näita teatud eventide teavitusi" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Näita Sõprade sõpru" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Xfire protokolli plugin" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u. %u. %u%s%s on nüüd saadaval.\n" +" Külasta Gfire kodulehte rohkema informatsiooni tarbeks!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Uus Gfire versioon" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u. %u. %u%s%s on nüüd saadaval.\n" +"Külasta Gfire kodulehte rohkema informatsiooni tarbeks!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Ühendan" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Ei saanud socketi't luua" + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Sisse logimine saadetud." + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(KE) Klaviatuurist eemal" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Hõivatud) Olen hõivatud!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Viga" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Mängumasina andmete otsing ebaõnnestus!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Vigased mängumasina andmed saabunud!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss Mängu masin:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Tehas" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Protsessor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Mälu" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Video kaart" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Heli kaart" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Emaplaat" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Kõvaketas" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Kuvar" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Klaviatuur" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Hiir" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Hiire matt" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Kõlarid" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Arvuti korpus" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Operatsiooni süsteem" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Saabunud profiili andmed ebõnnestusid!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Vigane profiili data saabunud!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profiil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss Profiil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Pärisnimi" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Vanus" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Sugu" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Meesoost" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Naissoost" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Amet" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Riik" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Asukoht" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Mängu stiil" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Huvid" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Sõbrad" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Ühinemis kuupäev" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Hüüdnimi" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Väljas" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Lisa mängu info:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss Klannid:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Ühendus katkes" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Mängusisene staatus" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Sinu staatus muutus." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Saabus vale sisselogimis info." + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Xfire süsteemi teade" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Xfire süsteemi teate sõnum:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Hiljutised serverid" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Lemmik serverid" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Sõprade lemmik serverid" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Kõik serverid" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Serveri lehitseja: viga" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Ei saa lemmik serverit lisada" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Su lemmik serverite limiit on täis. Sul on võimalus eemaldada servereid, et " +"lisada uusi." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Ei saa lemmik serverit eemaldada" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"Selekteeritud server ei ole sinu lemmik server ja seepärast ei saa seda " +"eemaldada." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Muuda Xfire hüüdnime" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Jättes tühjaks, tühistab su hetke hüüdnime" + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "Olgu" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Gfire XML taaslaadimine" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Taaslaen gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "Operatsioon ebaõnnestus: Faili ei leitud või sisu oli ebaõige." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Taaslaadimine õnnestus." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Gfire versioon: %s\n" +"Mängu nimekirja versioon: %s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Gfire versioon: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "Lähemalt Gfire-st" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Xfire-i plugin Pidgin-ile" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Sulge" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Kodulehekülg" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Palun oota kuni ühendus sinu semuga on loodud!" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Faili kirjeldus: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Kirjeldust ei sisestatud" diff -Nru gfire-0.8.3/po/es.po gfire-0.9.4/po/es.po --- gfire-0.8.3/po/es.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/es.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1228 @@ +# Gfire Spanish Translation +# Copyright (C) 2009 Gfire Team +# This file is distributed under the same license as the Gfire package. +# Beyecixramd , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-04-26 21:45+0100\n" +"Last-Translator: Oliver Ney \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Spanish\n" +"X-Poedit-Country: SPAIN\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Configuración avanzada" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Configuración básica" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Añadir un juego" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Detección del ejecutable:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Editar o borrar un juego" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Juego:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Ejecutable:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Prefijo de inicio:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Administrar juegos" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Usar el mismo archivo" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "Dirección IP:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Puerto:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Navegador de servidores" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Amigos de amigos jugando" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"Puede que %s no haya recibido este mensaje:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Jugando a %s!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "Sin juegos activos" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Jugando a %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Jugando a %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "Conexión P2P no posible" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"No ha sido posible establecer una conexión con este contacto. La " +"transferencia de archivos y mensajería P2P no estará disponible." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Sin permisos (silenciado)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normal" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Power-User" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderador" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Admin" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Desconocido" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Tu categoría actual es \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Contacto expulsado." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "El nuevo nombre de esta sala es \"%s\"." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Mensaje de hoy cambiado a:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Tu categoría ha sido cambiada a \"%s\"." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "La categoría de %s ahora es \"%s\"." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Ahora estás chateando %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Mensaje de hoy:\n" +"%s." + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "La categoría por defecto al unirse a este canal es ahora \"%s\"." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Público" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Sólo amigos" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "La visibilidad de esta sala ha cambiado a \"%s\"." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "La sala ahora tiene contraseña." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "La sala ya no tiene contraseña." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "La contraseña para esta sala ha cambiado." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "La sala ha sido silenciada." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "La sala ya no está silenciada." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "Los mensajes de unión y salida serán mostrados de ahora en adelante." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "" +"Los mensajes de unión y salida no serán mostrados de ahora en adelante." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Argumento desconocido: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "El nombre nuevo y el antiguo son idénticos." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Visibilidad desconocida: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "No se te permite cambiar las categorías." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Contacto desconocido :%s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "¡No puedes cambiar tu propia categoría!" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "No se te permite cambiar a esta categoría." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Categoría desconocida: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "No se te permite la expulsión de nadie." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "No te puedes expulsar a tí mismo." + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "No se te permite cambiar la categoría por defecto" + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "No puedes poner esa categoría por defecto." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Guardar la sala actual en Xfire. Esto preservará " +"las salas con sus privilegios. Si pulsas \"Sí\" se te preguntará si quieres " +"guardar la sala en caso de que no lo esté aún. Si declinas esta petición, la " +"operación de guardado NO se producirá." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <new-chat-name>:
Cambia el nombre de esta sala.

Requiere categoría de "Admin"." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<new-password>]:
Cambia la contraseña de esta sala. " +""/password" significará borrar la contraseña.

Requiere " +"categoría de "Admin"." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibilty <public|friends>:
Cambia la visibilidad de esta sala." +"

Requiere categoría de "Admin"." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Dice si las categorías inferiores a Moderator " +"deberían hablar en esta sala.

Requiere categoría de "" +"Moderator" o mayor." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Indica si los mensajes "<User> " +"joined" y "<User> left" deberían mostrarse en esta sala." +"

Requiere categoría de "Moderator" o mayor." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <username> <muted|normal|power|moderator|admin>:
Cambiar la categoría de username. Sólo los Admins pueden darle a " +"otras personas la categoría de "Admin".
Ten en cuenta que no " +"es posible cambiar la categoría de uno mismo.

Requiere categoría " +"de "Moderator" o mayor." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <username>:
Echa a username de la sala.

Requiere categoría de "Moderator" o mayor." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Ajustar la " +"categoría por defecto de la sala. Los nuevos usuarios que se unan tendrán " +"esta categoría.

Requiere categoría de "Moderator" o " +"mayor." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "La contraseña que has introducido no es correcta." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Contraseña incorrecta" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "Has intentado unirte a una sala que está protegida por contraseña." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Contraseña requerida" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Unirse" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Cancelar" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Error de unión a la sala" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Error desconocido" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Error desconocido. Puede que estés bloqueado de esta sala, o que estés en 5 " +"salas ya." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Búsqueda de amigos de Xfire" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "" +"Por favor, introduzca un nombre de usuario Xfire, nombre o dirección de " +"correo electrónico aquí:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Por ejemplo: tinus123, Tinus Lorvalds o tinus@lorvalds.org" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Buscar" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Nombre de usuario" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Nombre" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Apellido" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Resultados de la búsqueda" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "La lista de juegos ha sido actualizada a la versión %s." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Nueva versión de la lista de juegos" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Administrador de juegos: error" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "No se pudo añadir el juego" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "No existe un juego como tal, inténtalo de nuevo." + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Administrador de juegos: juego añadido" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "El juego se ha añadido con éxito." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Administrador de juegos: alerta" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "El juego ya ha sido añadido" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "Ya se ha añadido este juego, puedes configurarlo si quieres." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "" +"Por favor, inténtalo de nuevo. Asegúrate de que rellenas todos los campos." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Datos para iniciar el juego no encontrados" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "Este juego no se ha añadido aún, por favor ¡Añádelo primero!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Administrador de juegos: juego editado" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Juego editado" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "El juego se ha editado con éxito." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "No se pudo editar el juego" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "No se pudo eliminar el juego" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "No existe ese juego." + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Administrador de juegos: juego eliminado" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Juego eliminado" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "El juego se ha eliminado con éxito." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "" +"Por favor, inténtalo de nuevo. Asegúrate de seleccionar un juego para " +"eliminar." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "El equipo remoto cerró la conexión." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Error de lectura local." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Usuario o contraseña incorrectos." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "La versión del protocolo no coincide, debería ser %d. Reconfigurado." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Has iniciado sesión en otro sitio." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Sitio comunitario de Xfire" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Juego" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Servidor" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "desconocido" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Estado" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Amigos en común" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Error de inicio del protocolo." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "" +"Mensaje no enviado. El usuario no se encuentra en la lista de contactos" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Mensaje no enviado. Usuario desconectado" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Mensaje de invitación de Xfire" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "Escribe el texto que deseas enviar a este contacto con la invitación:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Añádeme a tu lista de amigos!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Invitar con un mensaje" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Invitar sin mensaje" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Eliminación de contacto de Xfire" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Has eliminado un contacto que no existe en tu lista de amigos, por lo que " +"será restaurado en el próximo inicio de sesión." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Añadir como amigo" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Unirse al juego ..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Unirse a VoIP ..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Perfil Xfire" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Iniciar %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Cambiar apodo" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Mi perfil" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Búsqueda de amigos" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Actualizar configuración de juegos" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "Información sobre Gfire" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Sala:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Contraseña:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Charla grupal de Xfire" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "Error al cambiar MdD (MotD)" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "El MdD (MotD) contiene más de 200 caracteres." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Nombre del grupo de amigos de amigos restaurado" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Nombre del grupo restaurado" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"No se ha podido cambiar el nombre del grupo del amigo de tu amigo, por lo " +"que el nombre antiguo ha sido restaurado." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Nombre del clan restaurado" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"No se ha podido cambiar el nombre del clan, por lo que el nombre antiguo ha " +"sido restaurado." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Puerto" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Versión" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Los contactos pueden ver cuando escribo" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Detección automática de estado" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Cambiar mi estado en todos los demás protocolos" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Notificarme si mi estado es ingame" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Activar detección de servidores" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Usar funcionalidades Peer-to-Peer de Xfire" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Mostrar notificaciones para ciertos eventos" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Mostrar amigos de amigos" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Plugin de protocolo Xfire" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s ya ha salido!.\n" +"Visita www.gfire.org para más información." + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Nueva versión de Gfire" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s ya ha salido!.\n" +"Visita www.gfire.org para más información." + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Conectando" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "No se pudo establecer la conexión." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Datos de inicio de sesión enviados" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Lejos Del Teclado" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) ¡Estoy ocupado!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Error" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "¡Error al recopilar los datos del ordenador!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "¡Los datos del ordenador que han sido recibidos son inválidos!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "Equipo de %s:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Empresa" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Procesador" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Memoria" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Tarjeta gráfica" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Tarjeta de sonido" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Placa base" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Disco duro" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Pantalla" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Teclado" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Ratón" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Superficie del ratón" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Altavoces" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Caja del ordenador" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Sistema operativo" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "¡Error al descargar datos del perfil!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "¡Datos erróneos de perfil recibidos!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Perfil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "Perfil de %s:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Nombre real" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Edad" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Sexo" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Masculino" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Femenino" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Ocupación" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "País" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Lugar" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Estilo de juego" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Intereses" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Amigos" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Fecha de unión" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Apodo" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Desconectado" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Información adicional:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "Clanes de %s:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Tiempo de conexion expirado" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Estado ingame" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Tu estado ha sido cambiado." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "¡Datos de inicio de sesión inváildos!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Transmisión del sistema Xfire" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Mensaje del sistema Xfire:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Servidores recientes" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Servidores favoritos" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Los servidores favoritos de amigos" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Todos los servidores" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/D" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Error en el navegador de servidores" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "No se pueden marcar más servidores favoritos!" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"No puedes marcar más servidores como favoritos, pero puedes eliminar " +"servidores ya marcados como favoritos para añadir nuevos." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "No se puede borrar un servidor marcado como favorito" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"El servidor seleccionado no está marcado como favorito, por lo tanto no se " +"puede borrar." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Cambiar apodo de Xfire" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Si lo dejas en blanco, borrará tu apodo actual" + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Actualizar XML de Gfire" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Actualizando gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "Error. Archivo no encontrado o contenido incorrecto." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Actualización completada con éxito." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Versión de Gfire: %s\n" +"Versión de la lista de juegos: %s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Versión de Gfire : %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "Información sobre Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Plugin de Xfire para Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Cerrar" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Sitio web (en inglés)" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki (en inglés)" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Aún no te has conectado a este contacto, espera, por favor." + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Descripción del Archivo: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "No se ha introducido ninguna descripción" + +#~ msgid "Not Removing %s" +#~ msgstr "No se ha eliminado a %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "La configuración de la cuenta se ha ajustado para no eliminar contactos\n" +#~ "El usuario será restablecido en el siguiente inicio de sesión" + +#~ msgid "Don't delete buddies from server" +#~ msgstr "No eliminar los contactos del servidor" + +#~ msgid "Connect option:" +#~ msgstr "Opciones de conexión:" + +#~ msgid "Required argument:" +#~ msgstr "Argumento requerido:" + +#~ msgid "Use detection" +#~ msgstr "Utilizar detección" + +#~ msgid "Ping" +#~ msgstr "Ping" + +#~ msgid "Players" +#~ msgstr "Jugadores" + +#~ msgid "Server IP" +#~ msgstr "IP del servidor" + +#~ msgid "Server name" +#~ msgstr "Nombre del servidor" + +#~ msgid "bookmark-new" +#~ msgstr "memorizar-nuevo" + +#~ msgid "%s [Xfire Chat]" +#~ msgstr "%s [Charla Xfire]" + +#~ msgid "Please try again. An error occured while adding the game." +#~ msgstr "Por favor, inténtalo de nuevo. Ocurrió un error al añadir el juego." + +#~ msgid "Please try again. An error occured while editing the game." +#~ msgstr "Por favor, inténtelo de nuevo. Ocurrió un error al editar el juego." + +#~ msgid "Please try again. An error occured while removing the game." +#~ msgstr "" +#~ "Por favor, inténtalo de nuevo. Ocurrió un error al eliminar el juego." + +#~ msgid "Incompatible games configuration" +#~ msgstr "Configuración de juegos incompatible" + +#~ msgid "" +#~ "Your current games configuration is incompatible with this version of " +#~ "Gfire. Please remove it and try again." +#~ msgstr "" +#~ "La configuración de juegos actual es incompatible con esta versión de " +#~ "Gfire. Por favor, elimínala e intenta de nuevo." + +#~ msgid "Reload Game ID List" +#~ msgstr "Actualizar lista de juegos" + +#~ msgid "Get Game ID List" +#~ msgstr "Descargar lista de juegos" + +#~ msgid "Reloading gfire_games.xml" +#~ msgstr "Actualizando gfire_games.xml" + +#~ msgid "Gfire Game List Download" +#~ msgstr "Descargar lista de juegos de Gfire" + +#~ msgid "Download failed" +#~ msgstr "Descarga fallida" + +#~ msgid "Download successful" +#~ msgstr "Descarga completada con éxito" + +#~ msgid "Unable to write gfire_games.xml" +#~ msgstr "No se pudo modificar el fichero gfire_games.xml" diff -Nru gfire-0.8.3/po/fr.po gfire-0.9.4/po/fr.po --- gfire-0.8.3/po/fr.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/fr.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1160 @@ +# French translations for Gfire package. +# Copyright (C) 2010 THE Gfire'S COPYRIGHT HOLDER +# This file is distributed under the same license as the Gfire package. +# Warren Dumortier , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0 Beta\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-03-07 14:43+0100\n" +"Last-Translator: Warren Dumortier \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Language: fr\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Paramètres avancés" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Paramètres basiques" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Ajouter un jeu" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Exécutable de détection:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Modifier ou supprimer un jeu" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Jeu:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Exécutable de lancement:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Préfixe de lancement:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Gérer les jeux" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Utiliser le même fichier exécutable" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "Adresse IP:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Serveurs" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Amis d'amis en train de jouer" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s n'a probablement pas reçu ce message:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Joue à %s!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "A arrêté de jouer!" + +#: ../src/gf_buddies.c:1099 +#, fuzzy, c-format +msgid "Playing %s - %s" +msgstr "Joue à %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Joue à %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "Connexion P2P impossible" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Nous ne sommes pas en mesure d'établir une connexion avec votre contact. Le " +"transfert de fichiers et la messagerie P2P ne seront pas disponibles." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Péon (muet)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normal" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Expérimenté" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Modérateur" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Admin" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Inconnu" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Vous avez actuellement la permission \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Le contact a été kické." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Le nom de cette salle a changé: \"%s\"." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "Message du jour changé: %s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Votre permission a été changée: \"%s\"." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "La permission de %s a été changée: \"%s\"." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Vous chattez maintenant dans %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "Message du jour: %s" + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Les permissions par défaut de cette salle ont été changées: \"%s\"." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Publique" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Amis uniquement" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "La visibilité de cete salle a été changée: \"%s\"." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "Cette salle est désormais protégée par un mot de passe." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "Cette salle n'est désormais plus protégée par un mot de passe." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Le mot de passe de cette salle a été changé." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "Cette salle est désormais silencieuse." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "Cette salle n'est désormais plus silencieuse." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "Les messages de (dé)connexion seront désormais affichés." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "Les messages de (dé)connexion seront désormais cachées." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Argument inconnu: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Le nouveau et l'ancien nom sont identiques. Veuillez noter que les salles de " +"tchat ne respectent pas la case." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Visibilité inconnue: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Vous n'êtes pas autorisé à accorder / révoquer des permissions." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Contact inconnu: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Vous ne pouvez pas changer vos propres permissions!" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Vous n'êtes pas autorisé à donner cette permission." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Permission inconnue: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Vous n'êtes pas autorisé à kicker des contacts." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Vous ne pouvez pas vous kicker!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Vous n'êtes pas autorisé à changer la permission par défaut." + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Vous n'êtes pas autorisé à changer cette permission par défaut." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Sauvegarde cette salle de tchat sur Xfire. Ceci " +"préserve tous les paramètres et permissions de la salle. En choisissant " +""yes", vous serez demandé à sauvergarder la salle dans votre liste " +"de contacts si ce n'est pas déjà le cas. Si vous refusez, la sauvegarde de " +"la salle ne se fera pas." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <new-chat-name>:
Change le nom de cette salle.

" +"Permission réquise: "Admin"." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<new-password>]:
Change le mot de passe de cette salle. " +""/password" effacere le mot de passe actuel.

Permission " +"réquise: "Admin"." + +#: ../src/gf_chat.c:1005 +#, fuzzy +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"password <public|friends>:
Change la visibilité de la salle.

Permission réquise: "Admin"." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Définit si oui ou non les non-modérateurs et " +"non-admins peuvent parler dans la salle.

Permission réquite: " +""Modérateur" ou plus élevé." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Définit si oui ou non les messages " +"concernant les (dé)connexions de contacts sont affichés dans la salle.

Permission réquise: "Modérateur" ou plus élevé." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <username> <muted|normal|power|moderator|admin>:
Définit la permission de username. Seul les admins peuvent donner " +"d'autres utilisateurs la permission "Admin".
Veuillez noter " +"que vous ne pouvez pas modifier votre permission.

Permission " +"réquise: "Modérateur" ou plus élevé." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <username>:
Kicke username de la salle.

Permission réquise: "Modérateur" ou plus élevé." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Change la " +"permission par défaut de cette salle de tchat. Tout nouveau contact qui " +"réjoint cette salle recevra cette permission.

Permission réquise: " +""Modérateur" ou plus élevé." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" +"Vous avez essayé de rejoindre une salle de tchat avec un mot de passe " +"incorrect. Veuillez réessayer." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Mot de passe incorrect" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" +"Vous avez essayé de rejoindre une salle de tchat protégée par un mot de " +"passe. Veuillez réessayer." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Mot de passe réquis" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Rejoindre" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Annuler" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Rejoindre une salle de tchat: erreur" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Erreur inconnue" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Rejoindre un salle de tchat: erreur inconnue. Vous êtes peut être bloqué de " +"la salle ou déjà dans 5 salles différentes." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Recherche d'amis" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "" +"Veuillez entrer un nom d'utilisateur Xfire, un nom ou une adresse e-mail ici:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Par exemple: gill123, Gill Bates or gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Rechercher" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Nom d'utilisateur" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Prénom" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Nom" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Résultats de la recherche" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "La liste des jeux a été mise à jour: %s." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Nouvelle liste des jeux Gfire" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Gérer les jeux: erreur" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Impossible d'ajouter le jeu" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Ce jeu n'existe pas, veuillez réessayer." + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Gérer les jeux: jeu ajouté" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Le jeu a été ajouté avec succès." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Gérer les jeux: avertissement" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Jeu déjà ajouté" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "Ce jeu est déjà ajouté, vous pouvez le modifier si vous voulez." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Veuillez réessayer. Contrôlez que vous remplissez tous les champs." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Données de lancement du jeu introuvables" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "Ce jeu ne semble pas être ajouté, veuillez l'ajouter d'abord!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Gérer les jeux: jeu modifié" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Jeu modifié" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Le jeu a été modifié avec succès." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Impossible de modifier le jeu" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Impossible d'enlever le jeu" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Ce jeu est introuvable, veuillez réessayer!" + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Gérer les jeux: jeu supprimé" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Jeu enlevé" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Le jeu a été enlevé avec succès." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "Veuillez réessayer. Contrôlez que vous sélectionnez un jeu à enlever." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Connexion fermée par le serveur distant." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Errur de lecture sur le socket." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Mot de passe ou nom d'utilisateur incorrect." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Mauvaise version du protocol détectée (devrait être %d). La nouvelle version " +"a été changée automatiquement." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Vous vous êtes connecté depuis un autre emplacement." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Communauté Xfire" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Jeu" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Serveur" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "inconnu" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Statut" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Amis communs" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Echec de l'initialisation du protocol." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "Le message n'a pas pu être envoyé. Le contact n'est pas dans la liste" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Le message n'a pas pu être envoyé. Le contact est hors ligne" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Message d'invitation Xfire" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" +"Veuillez entrer le message que vous souhaitez ajouter à l'invitation du " +"contact:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Ajoutez-moi à votre liste d'amis!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Inviter avec message" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Inviter sans message" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Suppression de contact refusée" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Ajouter comme ami" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Rejoindre le jeu..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Rejoindre le VoIP ..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Profil Xfire" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Lancer %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Modifier pseudo" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Mon profil" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Recherche d'amis" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Actualiser la configuration des jeux" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "A propos" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Salle:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Mot de passe:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Salle de tchat Xfire" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "Echec lors du changement du message du jour" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "Le message du jour contient plus de 200 caractères." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Nom de groupe des amis d'amis rétabli" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Nom de groupe rétabli" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Vous avez renommé le nom de groupe des amis d'amis. Malheureusement nous " +"avons du retéblir le nom du groupe." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Nom de groupe du clan rétabli" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"Vous avez renommé le nom de groupe d'un clan Xfire. Malheureusement nous " +"avons du rétablir le nom du groupe." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Version" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Mes contacts peuvent voir quand j'écris un message" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Activer la détection des jeux" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Changer mon état également pour les autres protocoles" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Notifier quand mon statut est en jeu" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Activer la détection des serveurs" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Activer les fonctions P2P de Xfire" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Activer les notifications" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Afficher les amis d'amis" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Plugin pour le protocol Xfire" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u est maintenant disponible.\n" +"Visitez le site web de Gfire pour plus d'informations!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Nouvelle version de Gfire" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u est maintenant disponible.\n" +"Visitez le site web de Gfire pour plus d'informations!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Connexion en cours" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Impossible de créer le socket." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Connexion: envoyée" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Absent(e)" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Occupé!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Erreur" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Echer lors de la réception de la gaming rig!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Données de gaming rig invalides reçues!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "Gaming rig de %s:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Fabricant" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Processeur" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Mémoire" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Carte graphique" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Carte son" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Carte mère" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Disque dur" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Moniteur" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Clavier" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Souris" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Tapis de souris" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Haut-parleurs" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Boîtier PC" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Système d'exploitation" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Echec lors de la réception des données de profil!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Données de profil invalides reçues!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "Profil de %s" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Nom réel" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Age" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Sexe" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Homme" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Femme" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Occupation" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Pays" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Location" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Style de jeu" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Intérêts" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Amis" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Membre depuis" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Pseudo" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Hors ligne" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Informations de jeu additionnelles:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "Clans de %s:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "La connexion a expiré" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Statut en jeu" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Votre statut a été changé." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Un login salt invalide a été reçu!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Système de broadcast Xfire" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Message de système de broadcast Xfire:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Serveurs récents" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Serveurs favoris" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Serveurs favoris des amis" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Tous les serveurs" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Serveurs: erreur" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Impossible d'ajouteur le serveur favori" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Vous avez atteint la limite des serveurs favoris, vous pouvez encore enlever " +"d'autres serveurs favoris pour en ajouter de nouveaux." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Impossible de supprimer le serveur favori" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"Le serveur sélectionné n'est pas un favori et ne peut donc pas être supprimé." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Modifier le pseudo Xfire" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Laisser vide effacera votre pseudo actuel." + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Actualiser la configuration XML" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Actualisation de gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "" +"Echec lors de l'opération. Le fichier n'a pas été trouvé ou le contenu est " +"incorrect." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "L'actualisation s'est déroulée avec succès." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Version:\t\t%s\n" +"Liste de jeux:\t\t%s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Gfire:\t\t%s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "A propos de Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Plugin Xfire pour Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Fermer" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Site web" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Veuillez attendre qu'une connexion avec votre contact soit établie!" + +#: ../src/gf_p2p_dl_proto.c:320 +#, fuzzy, c-format +msgid "File Description: %s" +msgstr "Gfire:\t\t%s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "" + +#~ msgid "Not Removing %s" +#~ msgstr "Ne peut supprimer %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "Vos options de compte ne suppriment pas vos contacts.\n" +#~ "Le contact sera rétabli lors de votre prochaine connexion" + +#~ msgid "Don't delete buddies from server" +#~ msgstr "Ne pas supprimer les contacts du serveur" diff -Nru gfire-0.8.3/po/Makefile.in.in gfire-0.9.4/po/Makefile.in.in --- gfire-0.8.3/po/Makefile.in.in 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/Makefile.in.in 2011-03-23 19:57:04.000000000 +0000 @@ -0,0 +1,217 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# Copyright (C) 2004-2008 Rodney Dawes +# +# This file may be copied and used freely without restrictions. It may +# be used in projects which are not available under a GNU Public License, +# but which still want to provide support for the GNU gettext functionality. +# +# - Modified by Owen Taylor to use GETTEXT_PACKAGE +# instead of PACKAGE and to look for po2tbl in ./ not in intl/ +# +# - Modified by jacob berkman to install +# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize +# +# - Modified by Rodney Dawes for use with intltool +# +# We have the following line for use by intltoolize: +# INTLTOOL_MAKEFILE + +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +datarootdir = @datarootdir@ +libdir = @libdir@ +DATADIRNAME = @DATADIRNAME@ +itlocaledir = $(prefix)/$(DATADIRNAME)/locale +subdir = po +install_sh = @install_sh@ +# Automake >= 1.8 provides @mkdir_p@. +# Until it can be supposed, use the safe fallback: +mkdir_p = $(install_sh) -d + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist +GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot + +ALL_LINGUAS = @ALL_LINGUAS@ + +PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) + +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) + +USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) + +POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) + +DISTFILES = Makefile.in.in POTFILES.in $(POFILES) +EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS + +POTFILES = \ +# This comment gets stripped out + +CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) + +.SUFFIXES: +.SUFFIXES: .po .pox .gmo .mo .msg .cat + +.po.pox: + $(MAKE) $(GETTEXT_PACKAGE).pot + $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && gencat $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: $(CATALOGS) +all-no: + +$(GETTEXT_PACKAGE).pot: $(POTFILES) + $(GENPOT) + +install: install-data +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $$dir; \ + if test -r $$lang.gmo; then \ + $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $(srcdir)/$$lang.gmo as" \ + "$$dir/$(GETTEXT_PACKAGE).mo"; \ + fi; \ + if test -r $$lang.gmo.m; then \ + $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + if test -r $(srcdir)/$$lang.gmo.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ + $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $(srcdir)/$$lang.gmo.m as" \ + "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + true; \ + fi; \ + fi; \ + done + +# Empty stubs to satisfy archaic automake needs +dvi info ctags tags CTAGS TAGS ID: + +# Define this as empty until I found a useful application. +install-exec installcheck: + +uninstall: + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ + rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ + done + +check: all $(GETTEXT_PACKAGE).pot + rm -f missing notexist + srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m + if [ -r missing -o -r notexist ]; then \ + exit 1; \ + fi + +mostlyclean: + rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp + rm -f .intltool-merge-cache + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES stamp-it + rm -f *.mo *.msg *.cat *.cat.m *.gmo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f Makefile.in.in + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: $(DISTFILES) + dists="$(DISTFILES)"; \ + extra_dists="$(EXTRA_DISTFILES)"; \ + for file in $$extra_dists; do \ + test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ + done; \ + for file in $$dists; do \ + test -f $$file || file="$(srcdir)/$$file"; \ + ln $$file $(distdir) 2> /dev/null \ + || cp -p $$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(GETTEXT_PACKAGE).pot + tmpdir=`pwd`; \ + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + echo "$$lang:"; \ + result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ + if $$result; then \ + if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.gmo failed!"; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi; \ + done + +Makefile POTFILES: stamp-it + @if test ! -f $@; then \ + rm -f stamp-it; \ + $(MAKE) stamp-it; \ + fi + +stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gfire-0.8.3/po/Makefile.mingw gfire-0.9.4/po/Makefile.mingw --- gfire-0.8.3/po/Makefile.mingw 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/Makefile.mingw 2010-01-09 14:57:00.000000000 +0000 @@ -0,0 +1,24 @@ +GFIRE_DIR = .. +# All personal changes usually go into this file +include ../mingw.mak + +.SUFFIXES: .po .gmo + +CATALOGS = $(patsubst %.po,%.gmo,$(wildcard *.po)) +LINGUAS = $(patsubst %.po,%,$(wildcard *.po)) + +.po.gmo: + rm -f $@ && ${GMSGFMT} -o $@ $^ + +.PHONY: all clean + +all: $(CATALOGS) + +clean: + rm -f *.gmo + +install: all + list='${LINGUAS}'; for lang in $$list; do \ + mkdir -p ${WIN32_INSTALL_DIR}/locale/$$lang/LC_MESSAGES; \ + cp $$lang.gmo ${WIN32_INSTALL_DIR}/locale/$$lang/LC_MESSAGES/gfire.mo; \ + done \ No newline at end of file diff -Nru gfire-0.8.3/po/pl.po gfire-0.9.4/po/pl.po --- gfire-0.8.3/po/pl.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/pl.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1255 @@ +# Gfire Polish Translation +# Copyright (C) 2010 Gfire Team +# This file is distributed under the same license as the Gfire package. +# Gfire Team , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-05-01 22:24+0200\n" +"Last-Translator: Andrzej Kardaś \n" +"Language-Team: Polish <>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Polish\n" +"X-Poedit-Country: POLAND\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Ustawienia zaawansowane" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Ustawienia podstawowe" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Dodaj grę" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Plik do wykrywania:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Edytuj lub usuń grę" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Gra:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Plik do uruchomienia:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Prefiks uruchamiania:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Zarządzaj grami" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Użyj tego samego pliku" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "Adres IP:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Przeglądarka Serwerów" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - grający Znajomi moich Znajomych" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s mógł / mogła nie otrzymać tej wiadomości:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Aktualnie gra w %s!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "Przestał grać!" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Gra w %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Gra w %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "Połączenie P2P nie możliwe" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Nie możemy nawiązać połączenia z twoim znajomym. Transfer plików i " +"wiadomości P2P nie będą możliwe." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Nieupoważniony (wyciszony)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normal" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Power-User" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderator" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Admin" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Nieznany" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Obecnie masz uprawnienie \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Znajomy został usunięty." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Nazwa pokoju rozmów została zmieniona na \"%s\"." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Dzisiejsza wiadomość została zmieniona na:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Twoje uprawnienia zostały zmienione na \"%s\"." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "Uprawnienia %s zostały zmienione na \"%s\"." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Aktualnie czatujesz w %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Dzisiejsza wiadomość:\n" +"%s" + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Domyślne uprawnienia tego pokoju rozmów zostały zmienione na \"%s\"." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Publiczne" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Tylko znajomi" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Widoczność tego pokoju rozmów została zmieniona na \"%s\"." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "Ten pokój rozmów jest teraz chroniony hasłem." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "Ten pokój rozmów przestał być chroniony hasłem." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Hasło tego pokoju rozmów zostało zmienione." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "Ten pokój rozmów został wyciszony." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "Ten pokój rozmów przestał być wyciszony." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "" +"Informacje o dołączaniu / opuszczaniu tego znajomego będą teraz wyświetlane." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "" +"Informacje o dołączaniu / opuszczaniu tego znajomego nie będą wyświetlane." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Nieznany argument: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Nowa i stara nazwa są identyczne. Pamiętaj, że wielkość znaków w nazwach " +"pokojów rozmów nie jest uwzględniana." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Nieznana widoczność: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Nie wolno ci dodawać ani odbierać żadnych uprawnień." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Nieznany znajomy: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Nie możesz zmienić własnych uprawnień." + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Nie wolno ci przyznać tego uprawnienia." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Nieznane uprawnienie: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Nie wolno ci usuwać znajomych." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Nie możesz sam się usunąć!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Nie wolno ci zmieniać domyślnych uprawnień." + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Nie wolno ci ustawić domyślnych uprawnień." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Zapisz obecny pokój rozmów w Xfire. Zachowa to " +"wszystkie ustawienia i uprawnienia pokoju rozmów. Jeśli odpowiesz "" +"yes", zostaniesz zapytany czy zachować pokój rozmów na swojej liście " +"znajomych pod warunkiem, że nie już tam zapisany. Jeśli odpowiesz "" +"no" zapis NIE zostanie przeprowadzony." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <nowa-nazwa-pokoju-rozmów%gt;:
Zmienia aktualną nazwę tego " +"pokoju rozmów.

Wymaga uprawnień "Admin"" + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<nowe-hasło>]:
Zmienia aktualne hasło tego pokoju " +"rozmów. "/password" usunie aktualne hasło.

Wymaga " +"uprawnień "Admin"." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibility <public|friends>:
Zmienia aktualną widoczność tego " +"pokoju rozmów.

Wymaga uprawnień "Admin"." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Określa czy nie moderatorzy i nie admini mogą " +"rozmawiać w tym pokoju rozmów.

Wymaga uprawnień "" +"Moderator".lub wyższych." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Określa czy informacje o dołączaniu "" +"<Użytkownika> i opuszczaniu "<Użytkownika> powinny być " +"wyświetlane w tym pokoju rozmów".

Wymaga uprawnień "" +"Moderator" lub wyższych." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <nutzername> <muted|normal|power|moderator|admin>:" +"
Określa uprawnienia nazwy użytkownika Tylko Admini mogą " +"przydzielać innym użytkownikom uprawnienia "Admin".
Zapamiętaj, że nie możesz zmieniać własnych uprawnień.

Wymaga " +"uprawnień "Moderator" lub wyższych." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <nazwa użytkownika>:
Usuwa użytkownika z pokoju " +"rozmów

Wymaga uprawnień "Moderator" lub wyższych." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Określa " +"domyślnie uprawnienia tego pokoju rozmów. Nowi znajomi, którzy przyłączą się " +"do tego pokoju otrzymają te uprawnienia..

Wymaga uprawnień "" +"Moderator" lub wyższych." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" +"Spróbowałeś dołączyć do pokoju rozmów używając niewłaściwego hasła. Proszę " +"spróbuj ponownie." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Nieprawidłowe hasło" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" +"Próbowałeś dołączyć do pokoju rozmów, który jest chroniony hasłem. Proszę " +"spróbuj ponownie" + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Wymagane hasło" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Dołącz" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Anuluj" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Błąd dołączania do pokoju rozmów" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Nieznany błąd" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Nieznany błąd dołączania. Możesz być zablokowane w tym pokoju rozmów lub " +"dołączyłeś już do 5 innych pokojów." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Wyszukiwanie znajomych Xfire" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "" +"Proszę wprowadź nazwę użytkownika Xfire, imię, nazwisko lub adres email " +"tutaj:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Na przykład: gill123, Gill Bates lub gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Szukaj" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Nazwa użytkownika" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Imię" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Nazwisko" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Wyniki wyszukiwania" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Lista Gier została zaktualizowana do wersji %s ." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Nowa wersja Listy Gier Gfire" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Zarządzenie Grami: błąd" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Nie można dodać gry" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Nie ma takiej gry, spróbuj ponownie" + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Zarządzenie Grami: dodano grę" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Gra została poprawnie dodana." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Zarządzanie Grami: ostrzeżenie " + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Gra jest już dodana" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "Ta gra jest już dodana, możesz ją skonfigurować jeśli chcesz" + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Spróbuj ponownie. Upewnij się, że wypełniłeś wszystkie pola" + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Dane uruchomienia gry nie znalezione" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "" +"Wygląda na to, że ta gra nie jest jeszcze dodana, proszę najpierw ją dodaj." + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Zarządzanie Grami: gra poddana edycji" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Gra poddana edycji" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Gra została poprawnie poddana edycji" + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Nie można edytować gry." + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Nie można usunąć gry" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Nie ma takiej gry, spróbuj ponownie!" + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Zarządzanie Grami: gra usunięta" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Gra usunięta" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Gra została poprawnie usunięta" + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "Proszę spróbuj ponownie. Upewnij się, że zaznaczyłeś grę do usunięcia" + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Połączenie zostało zamknięte przez Xfire" + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Błąd odczytu gniazda." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Hasło i nazwa użytkownika niepoprawne." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Niezgodność wersji protokołu, musi być %d. Auto ustawione na nową wartość." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Zalogowałeś się z innej lokalizacji." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Strona społeczności Xfire" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Gra" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Serwer" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "nieznane" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Status" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Wspólni znajomi" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Inicjowanie protokołu nieudane" + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "" +"Wiadomość nie może zostać wysłana. Znajomy nie znajduje się na liście " +"kontaktów" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Wiadomość nie może zostać wysłana. Znajomy jest odłączony." + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Wiadomość powitalna Xfire" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" +"Wprowadź wiadomość jaką chcesz przesłać twojemu znajomemu wraz z zaproszeniem" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Proszę dodaj mnie do listy swoich znajomych!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Zaproś wiadomością" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Zaproś bez wiadomości" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Usuwanie znajomego Xfire" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Usunąłeś kontakt który nie znajduje sie na twojej liście znajomych, zostanie " +"on przywrócony przy następnym logowaniu." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Dodaj jako znajomego" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Dołącz do Gry..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Dołącz do VoIP..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Profil Xfire" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Uruchom %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Zmień pseudonim" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Mój profil" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Szukaj znajomych" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Przeładuj Konfigurację Gier" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "O programie Gfire" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Pokój:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Hasło:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Czat grupowy Xfire" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "Zmiana wiadomości dnia nie powiodła się" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "Wiadomość dnia zawiera więcej niż 200 znaków" + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Przywrócono nazwę grupy znajomych twoich znajomych" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Przywrócono nazwę grupy" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Zmieniłeś nazwę grupy \"Znajomi twoich znajomych\". Niestety musimy " +"przywrócić tę nazwę." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Przywrócono nazwę Klanu" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"Zmieniłeś nazwę klanu Xfire. Niestety musimy przywrócić tę nazwę grupy." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Wersja" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Znajomi widzą kiedy piszę na klawiaturze " + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Automatycznie wykrywa status w grze" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Zmień mój status także dla innych protokołów" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Powiadom mnie kiedy mój status zmieni się na W Grze" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Włącz wykrywanie serwerów" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Używaj funkcji P2P Xfire" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Wyświetlaj powiadomienia dla określonych zdarzeń" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Pokaż Znajomych twoich Znajomych" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Wtyczka protokołu Xfire" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s jest dostępny\n" +"Odwiedź stronę Gfire aby uzyskać więcej informacji!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Nowa Wersja Gfire" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Odwiedź stronę Gfire aby uzyskać więcej informacji!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Podłączanie" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Nie można stworzyć gniazda." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Wysłano login" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Away From Keyboard" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Jestem zajęty!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Błąd" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Pobieranie danych komputera gracza (gamerig) nieudane!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Otrzymano nieprawidłowe dane komputera gracza (gamerig)!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss Komputer Gracza:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Wytwórca" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Procesor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Pamięć" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Karta Graficzna" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Karta Dzwiękowa" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Płyta Główna" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Dysk Twardy" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Monitor" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Klawiatura" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Mysz" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Podkładka pod Mysz" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Głośniki" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Obudowa" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "System Operacyjny" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Pobieranie danych profilu nieudane!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Odebrano niepoprawne dane profilu!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss Profil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Prawdziwe Imię / Nazwisko" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Wiek" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Płeć" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Mężczyzna" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Kobieta" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Zawód" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Kraj" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Lokalizacja" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Styl Grania" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Zainteresowania" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Znajomi" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Data dołączenia" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Pseudonim" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Offline" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Dodatkowe informacje o grze:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss Klany:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Przekroczono limit czasu połączenia" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Status W Grze" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Twój status uległ zmianie." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Otrzymano nieprawidłowe dane logowania!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Transmisja Systemu Xfire" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Transmisja Systemu Xfire Wiadomość:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Ostatnio używane serwery" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Ulubione serwery" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Ulubione serwery znajomych" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Wszystkiej serwery" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Przeglądarka Serwerów: błąd" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Nie można dodać ulubionego serwera" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Osiągnąłeś limit ulubionych serwerów, ale możesz usunąć niektóre ulubione " +"serwery aby dodać nowe." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Nie można usunąć ulubionego serwera" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"Zaznaczony serwer nie jest ulubionym serwerem i dlatego nie może zostać " +"usunięty" + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Zmień pseudonim Xfire" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Pozostawienie pustego skasuje aktualny pseudonim." + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Przeładowany plik Gfire XML" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Przeładowywanie gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "" +"Operacja nie powiodła się. Nie znaleziono pliku lub jego zawartość jest " +"nieprawidłowa." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Przeładowanie zakończone powodzeniem." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Wersja Gfire: %s\n" +"Wersja Listy Gier: %s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Wersja Gfie: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "O programie Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Wtyczka Xfire dla Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Zamknij" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Strona Internetowa" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Poczekaj, aż połączenie z twoim znajomym zostanie ustanowione!" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Opis Pliku: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Nie wprowadzono opisu" + +#~ msgid "Not Removing %s" +#~ msgstr "Nie usuwam %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "Ustawienia konta zabraniają usuwania znajomych\n" +#~ "Ten znajomy zostanie przywrócony przy następnym logowaniu" + +#~ msgid "Don't delete buddies from server" +#~ msgstr "Nie usuwaj znajomych z serwera" + +#~ msgid "Connect option:" +#~ msgstr "Opcje połączenia:" + +#~ msgid "Required argument:" +#~ msgstr "Wymagany argument:" + +#~ msgid "Use detection" +#~ msgstr "Użyj wykrywania" + +#~ msgid "Ping" +#~ msgstr "Ping" + +#~ msgid "Players" +#~ msgstr "Gracze" + +#~ msgid "Server IP" +#~ msgstr "IP Serwera" + +#~ msgid "Server name" +#~ msgstr "Nazwa Serwera" + +#~ msgid "bookmark-new" +#~ msgstr "nowy-odnośnik" + +#~ msgid "%s [Xfire Chat]" +#~ msgstr "%s [Czat Xfire]" + +#~ msgid "New Gfire version available" +#~ msgstr "Nowa wersja GFire jest dostępna" + +#~ msgid "" +#~ "The games list has been successfully updated to the latest version " +#~ "available." +#~ msgstr "Lista gier została zaktualizowana do ostaniej wersji z powodzeniem." + +#~ msgid "Please try again. An error occured while adding the game." +#~ msgstr "Proszę spróbuj ponownie. Pojawił się błąd podczas dodawania gry." + +#~ msgid "Please try again. An error occured while editing the game." +#~ msgstr "Proszę spróbuj ponownie. Pojawił się bład podczas edyji gry." + +#~ msgid "Please try again. An error occured while removing the game." +#~ msgstr "Proszę spróbuj ponownie. Pojawił się błąd podczas usuwania gry" + +#~ msgid "Incompatible games configuration" +#~ msgstr "Niekompatybilna konfiguracja gier" + +#~ msgid "" +#~ "Your current games configuration is incompatible with this version of " +#~ "Gfire. Please remove it and try again." +#~ msgstr "" +#~ "Twoja konfiguracja gier jest niekompatybilna z nową wersją Gfire. Proszę " +#~ "usuń ją i spróbuj ponownie." + +#~ msgid "P2P Port Range min. (1024-65535)" +#~ msgstr "Minimalny zakres portów P2P. (1024-65535)" + +#~ msgid "P2P Port Range max. (1024-65535)" +#~ msgstr "Maksymalny zakres portów P2P. (1024-65535)" + +#~ msgid "Reload Game ID List" +#~ msgstr "Przeładuj Listę Identyfikatorów Gier" + +#~ msgid "Get Game ID List" +#~ msgstr "Pobierz Listę Identyfikatorów Gier" + +#~ msgid "Couldn't get the latest game config." +#~ msgstr "Nie mogę pobrać ostatniej konfiguracji gier." + +#~ msgid "Reloading gfire_games.xml" +#~ msgstr "Przeładowuję gfire_games.xml" + +#~ msgid "Gfire Game List Download" +#~ msgstr "Pobranie Listy Gier Gfire" + +#~ msgid "Download failed" +#~ msgstr "Pobieranie nieudane" + +#~ msgid "Download successful" +#~ msgstr "Pobieranie zakończone powodzeniem" + +#~ msgid "Unable to write gfire_games.xml" +#~ msgstr "Nie moża zapisać gfire_games.xml" diff -Nru gfire-0.8.3/po/POTFILES.in gfire-0.9.4/po/POTFILES.in --- gfire-0.8.3/po/POTFILES.in 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/POTFILES.in 2010-03-08 17:38:29.000000000 +0000 @@ -0,0 +1,38 @@ +[encoding: UTF-8] +data/games.glade +data/servers.glade + +src/gf_base.h +src/gf_buddies.c +src/gf_buddies_proto.c +src/gf_chat.c +src/gf_chat_proto.c +src/gf_friend_search.c +src/gf_friend_search_proto.c +src/gf_games.c +src/gf_network.c +src/gf_protocol.c +src/gf_purple.c +src/gfire.c +src/gfire_proto.c +src/gf_server_browser.c +src/gf_server_browser_proto.c +src/gf_menus.c +src/gf_util.c +src/gf_server_detection.c +src/gf_server_detection_linux.c +src/gf_server_detection_win.c +src/gf_game_detection.c +src/gf_game_detection_linux.c +src/gf_game_detection_win.c +src/gf_p2p.c +src/gf_p2p_session.c +src/gf_p2p_im_handler.c +src/gf_p2p_dl_handler.c +src/gf_p2p_dl_proto.c +src/gf_file_chunk.c +src/gf_filetransfer.c +src/gf_groups.c +src/gf_groups_proto.c +src/gf_ipc_proto.c +src/gf_ipc_server.c diff -Nru gfire-0.8.3/po/ro.po gfire-0.9.4/po/ro.po --- gfire-0.8.3/po/ro.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/ro.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1151 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-04-26 21:43+0100\n" +"Last-Translator: Oliver Ney \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Setari avansate" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Setari de baza" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Adauga joc" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Executabil detectat:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Editeaza sau sterge un joc" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Joc:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Executabil de lansare:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Prefix lansare:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Administreaza Jocuri" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Foloseste acelasi fisier" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "Adresa IP:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Explorator de servere" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Prietenii Prietenilor care se joaca" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"Este posibil ca %s sa nu fi receptionat mesajul:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Joaca %s acum!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "S-a oprit din jucat!" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Joaca %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Joaca %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "Conexiune P2P imposibila" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Nu am putut stabili o conexiune cu prietenul tau. Transferul de fisiere si " +"mesageria P2P nu vor fi posibile." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Fara permisiune (mut)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normal" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Power-User" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderator" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Admin" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Necunoscut" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Momentan ai permisiunea \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Prietenul a fost inlaturat." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Numele camerei a fost schimbat in \"%s\"." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Mesajul zilei a fost schimbat in:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Permisiunea ta a fost schimbata in \"%s\"." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "Permisiunea lui %s a fost schimbata in \"%s\"." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Acum vorbesti in %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Mesajul zilei:\n" +"%s" + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Permisiunea implicita a camerei a fost schimbata in \"%s\"." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Public" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Doar prieteni" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Vizibilitatea camerei a fost schimbata in \"%s\"." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "Camera e acum protejata prin parola." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "Camera nu mai este protejata prin parola." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Parola acestei camere a fost schimbata." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "Camera este acum silentioasa." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "Camera nu mai este silentioasa." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "Notificarile despre prietenii care intra/ies vor fi afisate de acum." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "Notificarile despre prietenii care intra/ies nu vor mai fi afisate." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Argument necunoscut: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Numele nou si cel vechi sunt identice. Retine, numele camerelor de chat nu " +"fac diferenta intre minuscule si majuscule." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Vizibilitate necunoscuta: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Nu ai dreptul sa atribui/revoci nicio permisiune." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Prieten necunoscut: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Nu iti poti schimba propria permisiune!" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Nu ai dreptul sa atribui aceasta permisiune." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Permisiune necunoscuta: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Nu ai dreptul sa inlaturi prieteni." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Nu ai dreptul sa te auto-inlaturi!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Nu ai dreptul sa schimbi permisiunea implicita." + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Nu ai dreptul sa setezi permisiunea implicita." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Salveaza camera de chat in Xfire. Astfel, vor fi " +"memorate toate setarile si privilegiile camerei de chat. Daca alegi "" +"yes", vei fi rugat sa salvezi camera de chat in lista ta de prieteni, " +"daca nu e salvata deja. Daca alegi sa nu salvezi, setarile nu vor fi " +"memorate." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <nume-nou-camera>:
Schimba numele curent al camerei de " +"chat.

Necesita permisiunea "Admin"." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<parola-noua>]:
Schimba parola curenta pentru camera." +""/password" rezulta in stergerea parolei curente.

Necesita permisiunea "Admin"." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibilty <public|friends>:
Schimba vizibilitatea curenta a " +"camerei de chat.

Necesita permisiunea de "Admin"" + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Seteaza daca non-Moderatorii si non-Adminii pot " +"sa vorbeasca in camera de chat.

Necesita permisiunea "" +"Moderator" sau mai mare." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Seteaza daca mesajele "<User> " +"joined" and "<User> left" vor fi afisate in camera.

Necesita permisiunea "Moderator" sau mai mare." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <utilizator> <muted|normal|power|moderator|admin>:" +"
Seteaza permisiunea utilizatorului. Doar adminii pot acorda " +"altor utilizatori permisiunea "Admin".
Retine, nu iti poti " +"schimba propria permisiune.

Necesita permisiunea "" +"Moderator" sau mai mare." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <utilizator>:
Inlatura utilizatorul din camera.

Necesita permisiunea "Moderator" sau mai mare." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Seteaza " +"permisiunea implicita a acestei camere. Noii prieteni care acceseaza camera " +"vor avea aceasta permisiune

Necesita permisiunea "" +"Moderator" sau mai mare." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" +"Ai incercat sa accesezi o camera de chat folosind o parola incorecta. " +"Incearca din nou." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Parola gresita" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" +"Ai incercat sa accesezi o camera de chat protejata prin parola. Incearca din " +"nou." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Parola necesara" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Intra" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Anuleaza" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Eroare la accesarea camerei de chat" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Eroare necunoscuta" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Eroare necunoscuta la accesarea camerei. Este posibil sa ai accesul blocat " +"la aceasta camera sau te afli deja in 5 camere de chat." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Cauta prieten Xfire" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "Introdu un username de Xfire, un nume sau o adresa de e-Mail:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "De exemplu: gill123, Gill Bates sau gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Cauta" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Nume utilizator" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Prenume" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Nume" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Rezultatele cautarii" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Lista de jocuri a fost actualizata la versiunea: %s." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Versiune noua a Gfire Game List" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Administreaza Jocuri: eroare" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Nu am putut adauga jocul" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Acest joc nu exista, incearca din nou." + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Administreaza Jocuri: jocul a fost adaugat" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Jocul a fost adaugat cu succes." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Administreaza Jocuri: atentie" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Jocul e deja in lista" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "Jocul a fost adaugat deja, il poti configura daca doresti." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Incearca din nou. Ai grija sa completezi toate campurile." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Setarile necesare lansarii jocului nu au fost gasite" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "Se pare ca acest joc nu e in lista, te rugam sa-l adaugi intai!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Administreaza Jocuri: jocul a fost editat" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Jocul a fost editat" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Jocul a fost editat cu succes." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Nu am putut edita jocul" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Nu am putut sterge jocul" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Acest joc nu exista, incearca din nou!" + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Administreaza Jocuri: jocul a fost sters" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Jocul a fost sters" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Jocul a fost sters cu succes." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "" +"Incearca din nou. Verifica daca ai selectat un joc pe care doresti sa-l " +"stergi." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Conexiunea a fost inchisa de peer." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Eroare la citirea socket-ului." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Parola sau Username incorect." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Versiunea protocolului e eronata, trebuie sa fie %d. O noua valoare a fost " +"setata." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Te-ai logat din alta locatie." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Site-ul comunitatii Xfire" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Joc" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Server" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "necunoscut" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Status" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Prieteni Comuni" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Initializarea protocolului a esuat." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "" +"Mesajul nu a putut fi transmis. Prietenul nu se afla in lista de contacte." + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Mesajul nu a putut fi transmis. Prietenul e deconectat" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Mesajul invitatiei Xfire" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" +"Introdu mesajul pe care doresti sa-l trimiti prietenului tau odata cu " +"aceasta invitatie:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Te rog sa ma adaugi la lista ta de prieteni!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Invita cu mesaj" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Invita fara mesaj" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Sterge prieten Xfire" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Ai sters un prieten care nu exista in lista ta de prieteni, va fi restaurat " +"la urmatoarea logare." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Adauga la prieteni" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Intra in joc ..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Intra in VoIP ..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Profil Xfire" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Deschide %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Schimba Nickname" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Pagina Profilului Meu" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Cauta prieten" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Reincarca configuratiile de jocuri" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "Despre" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Camera:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Parola:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Chat in grupul Xfire" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "Schimbarea MotD a esuat" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "MotD contine mai mult de 200 de caractere." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Numele grupului Prietenii Prietenilor a fost restaurat" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Numele grupului a fost restaurat" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Ai schimbat numele grupului Prietenii Prietenilor. Din pacate, a trebuit sa " +"restauram numele acestui grup." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Numele grupului Clanului a fost restaurat" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"Ai schimbat numele grupului unui clan Xfire. Din pacate, a trebuit sa " +"restauram numele acestui grup." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Versiune" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Prietenii pot sa vada daca tastez" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Detecteaza automat cand sunt in joc" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Schimba-mi statusul si pentru alte protocoale, de asemenea." + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Anunta-ma cand statusul meu e \"In Joc\"" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Activeaza detectia serverelor" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Utilizeaza facilitatile P2P ale Xfire" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Afiseaza notificari pentru anumite evenimente" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Arata Prietenii Prietenilor" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Plugin pentru protocolul Xfire" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s e acum disponibil.\n" +"Viziteaza website-ul Gfire pentru mai multe informatii!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Versiune noua de Gfire" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s e acum disponibil.\n" +"Viziteaza website-ul Gfire pentru mai multe informatii!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Se conecteaza" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Nu am putut crea socket-ul." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Login trimis" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Plecat de la tastatura" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Sunt ocupat!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Eroare" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Accesarea detaliilor computerului a esuat!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Au fost receptionate detalii eronate despre computer!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss Computer:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Producator" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Procesor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Memorie" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Placa Video" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Placa de Sunet" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Placa de baza" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Hard Disk" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Monitor" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Tastatura" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Mouse" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Mousepad" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Boxe" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Carcasa" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Sistem de operare" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Accesarea datelor profilului a esuat!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Au fost receptionate date eronate despre profil!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss Profil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Nume Real" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Varsta" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Gen" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Barbat" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Femeie" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Ocupatie" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Tara" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Locatie" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Stilul de joc" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Interese" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Prieteni" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Data inregistrarii" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Nickname" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Offline" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Informatii aditionale joc:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss Clanuri:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Timpul alocat conexiunii a expirat" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Status \"In Joc\"" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Statusul tau a fost schimbat." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Eroare la autentificare!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Sistemul de emisie Xfire" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Mesaj de la sistemul de emisie Xfire:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Servere recente" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Servere favorite" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Serverele favorite ale prietenilor" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Toate serverele" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Explorator de servere: eroare" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Nu am putut sa adaug serverul" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Ai atins limita de servere favorite, insa poti sterge alte servere deja " +"existente, pentru a putea adauga altele noi." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Nu am putut sterge serverul favorit" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"Serverul selectat nu se regaseste in lista de servere favorite, astfel ca nu " +"poate fi sters." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Schimba nickname-ul Xfire" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Necompletarea campului va stergere nickname-ul actual." + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Reincarca Gfire XML" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Reincarc gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "Operatie esuata. Fisierul nu a fost gasit sau continutul e incorect." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Reincarcare reusita." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Versiune Gfire: %s\n" +"Versiune Lista de Jocuri: %s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Versiune Gfire: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "Despre Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Plugin Xfire pentru Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Inchide" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Website" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Asteapta pana cand este stabilita o conexiune cu prietenul tau!" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Descrierea fisierului: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Nicio descriere disponibila" diff -Nru gfire-0.8.3/po/sk.po gfire-0.9.4/po/sk.po --- gfire-0.8.3/po/sk.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/sk.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1227 @@ +# Gfire Slovakian Translation +# Copyright (C) 2009 Gfire Team +# This file is distributed under the same license as the Gfire package. +# Marek Niklíček , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-04-26 21:43+0100\n" +"Last-Translator: Oliver Ney \n" +"Language-Team: none\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Pokročilé nastavenia" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Základné nastavenia" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Pridať hru" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Detekcia spustiteľného súboru:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Upraviť alebo odstrániť hru" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Hra:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Spustiť súbor:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Prefix pri spustení:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Spravovať hry:" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Použiť ten istý súbor" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "IP adresa:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Serverový prehliadač" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-add" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Priatelia priateľov hrajú hry" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s nemusel dostať túto správu:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Hrá %s teraz!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "Prestal hrať!" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Hrá %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Hrá %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "P2P spojenie nie je možné" + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Nie je možné nadviazať spojenie s vaším kamarátom. Prenos súborov a P2P " +"doručovanie správ nie je možné." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Bez oprávnení (umlčaný)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normálny" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Pokročilý používateľ" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderátor" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Správca" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Neznámy" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Vaše súčasné oprávnenia \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Kamarát bol vyhodený." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Názov tejto miestnosti sa zmenil na \"%s\"." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Dnešná správa sa zmenila na:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Vaše oprávnenia sa zmenili na \"%s\"." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "%s's oprávnenia sa zmenili na \"%s\"." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Práve chatujete v %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Dnešná správa:\n" +"%s" + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Východiskové oprávnenia tejto miestnosti sa zmenili na \"%s\"." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Verejná" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Priatelia iba" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Viditeľnosť tejto miestnosti na zmenila na \"%s\"." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "Táto miestnosť je odteraz chránená heslom." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "Táto miestnosť odteraz už nie je chránená heslom." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Heslo tejto miestnosti sa zmenilo." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "Táto miestnosť je odteraz umlčaná." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "Táto miestnosť odteraz už nie je umlčaná." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "Odteraz sa zobrazia správy kamaráta o pripojení / odpojení." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "Odteraz sa nezobrazia správy kamaráta o pripojení / odpojení." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Neznámy argument: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Nové a staré meno je rovnaké. Prosím, uvedomte si, že názvy miestností " +"nerozlišujú veľkosť písma." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Neznáma viditeľnosť: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Nie ste oprávnený udeľovať / odobierať akékoľvek oprávnenia." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Neznámy kamarát: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Nemôžete zmeniť vlastné oprávnenia!" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Nie ste oprávnený udeliť toto oprávnenie." + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Neznáme oprávnenie: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Nie ste oprávnený vyhodzovať kamarátov." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Nemôžete vyhodiť sám seba!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Nie ste oprávnený zmeniť východiskové oprávnenie." + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Nie ste oprávnený zmeniť toto východiskové oprávnenie." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save <yes|no>:
Uložiť súčasnú miestnosť na Xfire. Toto ponechá " +"všetky nastavenia a privilégia miestností. On "yes", Budete " +"požiadaný uložiť miesnosť do vášho zoznamu, ak tam už nie je. Ak túto " +"žiadosť odmietnete, miestnosť sa neuloží." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename <new-chat-name>:
Zmení súčasné meno pre túto miestnosť.

Vyžaduje "Admin" oprávnenie." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password [<new-password>]:
Zmení súčasné heslo pre túto " +"miestnosť. "/password" odstráni súčasné heslo.

Vyžaduje " +""Admin" oprávnenie." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibilty <public|friends>:
Zmení súčasnú viditeľnosť tejto " +"miestnosti.

Vyžaduje "Admin" oprávnenie." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence <on|off>:
Nastaví, či ne-moderátori a ne-správcovia by " +"nemohli rozprávať v miestnosti.

Vyžaduje "Moderator" " +"alebo vyššie oprávnenie." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg <on|off>:
Nastaví, či "<User> joined" " +"a "<User> left" správy by sa mali v miestnosti zobrazovať." +"

Vyžaduje "Moderator" alebo vyššie oprávnenie." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission <username> <muted|normal|power|moderator|admin>:
Nastaví username's oprávnenie. Iba správcovia môžu udeliť ostatným " +"používateľom "Admin" oprávnenie.
Prosím, uvedomte si, že " +"nemôžete zmeniť svoje vlastné oprávnenie.

Vyžaduje "" +"Moderator" alebo vyššie oprávnenie." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick <username>:
Vyhodí username z kanalá.

Vyžaduje "Moderator" alebo vyššie oprávnenie." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission <muted|normal|power|moderator|admin>:
Nastaví " +"východiskové oprávnenie tejto miestnosti. Noví kamaráti, ktorí sa pripoja do " +"miestnosti, budú mať toto oprávnenie.

Vyžaduje "" +"Moderator" alebo vyššie oprávnenie." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "" +"Pokúsili ste sa pripojiť do miestnosti pomocou neplatného hesla. Prosim, " +"skúste to znovu." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Neplatné heslo" + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "" +"Pokúsili ste sa pripojiť do miestnosti, ktorá je chránená heslom. Prosím, " +"skúste to znovu." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Vyžadované heslo" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Pridať sa" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Zrušiť" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Chyba pripojenia do miestnosti" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Neznáma chyba" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Neznáma chyba pripojenia. Prístup do tejto miestnosti môže byť blokovaný, " +"alebo ste už v 5 miestnostiach." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Xfire Hľadanie priateľov" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "Prosím, napíšte sem Xfire používateľské meno alebo e-Mail adresu:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "Napríklad: gill123, Gill Bates alebo gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Hľadať" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Používateľské meno" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Krstné meno" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Priezvisko" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Výsledky hľadania" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Zoznam hier bol aktualizovaný na verziu: %s." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Nová verzia zoznamu hier" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Spravovať hry: chyba" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Nemôžem pridať hru" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Taká hra neexistuje, prosím skúste to znovu." + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Spravovať hry: hra bola pridaná" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Hra bola úspešne pridaná." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Spravovať hry: varovanie" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Hra už bola pridaná" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "Táto hra už bola pridaná. Ak chcete, môžete ju nakonfigurovať." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Prosím, skúste to znovu. Uistite sa, že ste vyplnili všetky polia." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Dáta na spustenie hry neboli nájdené." + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "" +"Vyzerá to tak, že táto hra ešte nebola pridaná. Najprv ju pridajte, prosím!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Spravovať hry: hra bola upravená" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Hra bola upravená" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Hra bola úspešne upravená." + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Nemôžem upraviť hru" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Nemôžem odstrániť hru" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Taká hra neexistuje, prosím skúste to znovu." + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Spravovať hry: hra bola odstránená" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Hra bola odstránená" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Hra bola úspešne odstránená." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "" +"Prosím, skúste to znovu. Uistite sa, že označíte hru, ktorú chcete odstrániť." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Spojenie ukončené účastníkom." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Chyba pri čítani zo socketu." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Heslo alebo používateľské meno je neplatné." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Chyba verzie protokolu, musí byť %d. Automaticky sa nastaví na novú hodnotu." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Prihlásili ste sa z iného miesta." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Xfire Stránka komunity" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Hra" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Server" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "neznámy" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Stav" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Priatelia" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Inicializácia protokolu zlyhala." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "Správa nemohla byť odoslaná. Kamarát nie je v zozname kontaktov" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Správa nemohla byť odoslaná. Kamarát je offline" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Xfire Pozvánka" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" +"Prosím, napíšte správu, ktorú chcete poslať vášmu kamarátovi s touto " +"pozvánkou:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Prosím, pridaj si ma do zoznamu priateľov!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Pozvať so správou" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Pozvať bez správy" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Xfire odstránenie kamaráta" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Odstránili ste kamaráta, ktorý nie je vo vašom zozname priateľov. Bude " +"obnovený po ďalšom prihlásení." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Pridať ako priateľa" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Pridať sa do hry ..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Pridať sa do VoIP ..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Xfire profil" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Spustiť %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Zmeniť prezývku" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Moja profilová stránka" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Hľadanie priateľov" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Znovu načítať konfiguráciu hry" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "O Gfire" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Room:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Password:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Xfire skupinový chat" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "MotD zmena zlyhala" + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "MotD obsahuje viac než 200 znakov." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "Názov skupiny Priatelia priateľov obnovený" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Názov skupiny obnovený" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Premenovali ste názov Xfire skupiny FoF. Bohužiaľ, museli sme obnoviť názov " +"tejto skupiny." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Názov skupiny klanu obnovený" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"Premenovali ste názov Xfire skupiny klanu. Bohužiaľ, museli sme obnoviť " +"názov tejto skupiny." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Verzia" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Kamaráti môžu vidieť, kedy píšem" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Automatická detekcia pre herný stav (ingame)" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Zmeniť môj stav tiež pre iné protokoly" + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Upozorni ma, keď môj stav je herný (ingame)" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Povoliť serverovú detekciu" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Použiť Xfire P2P funkcie" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Zobrazovať upozornenia pre určité udalosti" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Zobraziť Priatelia priateľov" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Xfire Protocol Plugin" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s je teraz dostupný.\n" +"Navštívte webstránku Gfire pre viac informácií!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Nová Gfire verzia: %s" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s je teraz dostupný.\n" +"Navštívte webstránku Gfire pre viac informácií!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Pripájam sa" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Nemôžem vytvoriť socket." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Login poslaný" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Som mimo počítača" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Som zaneprázdnený!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Chyba" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Získavanie dát o hernej zostave zlyhalo!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Prijaté dáta hernej zostavy sú neplatné!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss Herná zostava:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Výrobca" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Procesor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Pamäť" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Grafická karta" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Zvuková karta" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Základná doska" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Pevný disk" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Monitor" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Klávesnica" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Myš" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Podložka pod myš" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Reproduktory" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Počítačová skrinka" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Operačný systém" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Získavanie dát o profile zlyhalo!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Prijaté dáta o profile sú neplatné!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss Profil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Skutočné meno" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Vek" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Pohlavie" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Muž" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Žena" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Zamestnanie" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Krajina" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Miesto" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Štýl hrania" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Záujmy" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Priatelia" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Dátum zaregistrovania" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Prezývka" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Offline" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Dodatočné informácie o hre:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss Klany:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Čas spojenia vypršal" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Herný stav" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Váš stav sa zmenil." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Prijatá neplatná informácia o prihlásení!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Xfire Systémový rozhlas" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Xfire Správa systémového rozhlasu:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Nedávne servery" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Obľúbené servery" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Obľúbené servery priateľov" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Všetky servery" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Serverový prehliadač: chyba" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Nemôžem pridať obľúbený server" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Dosiahli ste limit obľúbených serverov. Avšak, stále môžete odstraniť " +"obľúbené servery, aby ste mohli pridať nové." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Nemôžem odstrániť obľúbený server" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "Označený server nie je obľúbený a preto nemôže byť odstránený." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Zmeniť Xfire prezývku" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Nechať prázdne znamená vyčistiť vašu súčasnú prezývku" + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "OK" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Znovu načitanie Gfire XML" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Znovu načítanie gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "Operácia zlyhala. Súbor nebol nájdený alebo obsah nebol správny." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Znovu načítanie bolo úspešné." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Verzia Gfire: %s\n" +"Verzia zoznamu hier: %s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Verzia Gfire: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "O Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Xfire Plugin pre Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Zavrieť" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Webstránka" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Prosím čakajte, kým sa nadviaže spojenie s vaším kamarátom!" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Popisovač súborov: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Nezadaný žiadny popis" + +#~ msgid "Not Removing %s" +#~ msgstr "Nevymaže sa %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "Nastavenie účtu je nastavené na nevymazávanie kamarátov\n" +#~ "Kamarát bude obnovený pri vašom opätovnom prihlásení" + +#~ msgid "Don't delete buddies from server" +#~ msgstr "Nevymazať kamarátov zo servera" + +#~ msgid "Connect option:" +#~ msgstr "Možnosti pripojenia:" + +#~ msgid "Required argument:" +#~ msgstr "Potrebný argument:" + +#~ msgid "Use detection" +#~ msgstr "Použiť detekciu" + +#~ msgid "Ping" +#~ msgstr "Ping" + +#~ msgid "Players" +#~ msgstr "Hráči" + +#~ msgid "Server IP" +#~ msgstr "IP servera" + +#~ msgid "Server name" +#~ msgstr "Názov servera" + +#~ msgid "bookmark-new" +#~ msgstr "záložka-nová" + +#~ msgid "%s [Xfire Chat]" +#~ msgstr "%s [Xfire Chat]" + +#~ msgid "Please try again. An error occured while adding the game." +#~ msgstr "Prosím, skúste to znovu. Kým ste pridávali hru, vyskytla sa chyba." + +#~ msgid "Please try again. An error occured while editing the game." +#~ msgstr "Prosím, skúste to znovu. Kým ste upravovali hru, vyskytla sa chyba." + +#~ msgid "Please try again. An error occured while removing the game." +#~ msgstr "" +#~ "Prosím, skúste to znovu. Kým ste odstraňovali hru, vyskytla sa chyba." + +#~ msgid "Incompatible games configuration" +#~ msgstr "Nekompatibilná konfigurácia hier" + +#~ msgid "" +#~ "Your current games configuration is incompatible with this version of " +#~ "Gfire. Please remove it and try again." +#~ msgstr "" +#~ "Váša súčasná konfigurácia hier nie je kompatibilná s touto verziou Gfire. " +#~ "Prosím, odstráňte ju a skúste to znovu." + +#~ msgid "Reload Game ID List" +#~ msgstr "Znovu načítať ID zoznam hier" + +#~ msgid "Get Game ID List" +#~ msgstr "Získať ID zoznam hier" + +#~ msgid "Reloading gfire_games.xml" +#~ msgstr "Znovu načítam gfire_games.xml" + +#~ msgid "Gfire Game List Download" +#~ msgstr "Stiahnuť zoznam hier pre Gfire" + +#~ msgid "Download failed" +#~ msgstr "Sťahovanie zlyhalo" + +#~ msgid "Download successful" +#~ msgstr "Sťahovanie úspešné" + +#~ msgid "Unable to write gfire_games.xml" +#~ msgstr "Nemôžem zapísať gfire_games.xml" diff -Nru gfire-0.8.3/po/sv.po gfire-0.9.4/po/sv.po --- gfire-0.8.3/po/sv.po 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/po/sv.po 2010-06-15 21:40:59.000000000 +0000 @@ -0,0 +1,1229 @@ +# Gfire Swedish Translation +# Copyright (C) 2009 Gfire Team +# This file is distributed under the same license as the Gfire package. +# Rizzly/Erynhenwe , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Gfire 0.9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-15 23:06+0200\n" +"PO-Revision-Date: 2010-04-26 21:42+0100\n" +"Last-Translator: Oliver Ney \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Swedish\n" +"X-Poedit-Country: SWEDEN\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../data/games.glade.h:1 +msgid "Advanced settings" +msgstr "Avancerade inställningar" + +#: ../data/games.glade.h:2 +msgid "Basic settings" +msgstr "Grundläggande inställningar" + +#: ../data/games.glade.h:3 +msgid "Add a game" +msgstr "Lägg till ett spel" + +#: ../data/games.glade.h:4 +msgid "Detection Executable:" +msgstr "Igenkänningsfil:" + +#: ../data/games.glade.h:5 +msgid "Edit or remove a game" +msgstr "Redigera eller ta bort ett spel" + +#: ../data/games.glade.h:6 +msgid "Game:" +msgstr "Spel:" + +#: ../data/games.glade.h:7 +msgid "Launch Executable:" +msgstr "Körningsfil:" + +#: ../data/games.glade.h:8 +msgid "Launch prefix:" +msgstr "Startprefix:" + +#: ../data/games.glade.h:9 ../src/gf_purple.c:754 +msgid "Manage Games" +msgstr "Hantera Spel" + +#: ../data/games.glade.h:10 +msgid "Use same file" +msgstr "Använd samma fil" + +#: ../data/servers.glade.h:1 +msgid "IP Address:" +msgstr "IP-adress:" + +#: ../data/servers.glade.h:2 +msgid "Port:" +msgstr "Port:" + +#. Server browser +#: ../data/servers.glade.h:3 ../src/gf_purple.c:758 +msgid "Server Browser" +msgstr "Serverbläddrare" + +#: ../data/servers.glade.h:4 +msgid "gtk-add" +msgstr "gtk-lägg till" + +#: ../src/gf_base.h:115 +msgid "Xfire - Friends of Friends playing games" +msgstr "Xfire - Kompisar till kompisar som spelar" + +#: ../src/gf_buddies.c:520 +#, c-format +msgid "" +"%s may have not received this message:\n" +"%s" +msgstr "" +"%s kanske inte har mottagit detta meddelande:\n" +"%s" + +#: ../src/gf_buddies.c:813 +#, c-format +msgid "Playing %s now!" +msgstr "Spelar %s nu!" + +#: ../src/gf_buddies.c:820 +msgid "Stopped playing!" +msgstr "Slutade spela!" + +#: ../src/gf_buddies.c:1099 +#, c-format +msgid "Playing %s - %s" +msgstr "Spelar %s - %s" + +#: ../src/gf_buddies.c:1100 ../src/gf_game_detection.c:147 +#: ../src/gf_game_detection.c:218 +#, c-format +msgid "Playing %s" +msgstr "Spelar %s" + +#: ../src/gf_buddies.c:1491 +msgid "P2P Connection not possible" +msgstr "P2P-anslutning misslyckades." + +#: ../src/gf_buddies.c:1491 +msgid "" +"We're not able to establish a connection to your buddy. File transfer and " +"P2P messaging will not be possible." +msgstr "" +"Kan inte etablera en anslutning med din kompis. Filöverföring och P2P-" +"meddelanden kommer inte att fungera." + +#: ../src/gf_chat.c:226 ../src/gf_chat.c:424 ../src/gf_chat.c:559 +msgid "Permissionless (muted)" +msgstr "Privilegielös (tystad)" + +#: ../src/gf_chat.c:231 ../src/gf_chat.c:429 ../src/gf_chat.c:563 +msgid "Normal" +msgstr "Normalanvändare" + +#: ../src/gf_chat.c:236 ../src/gf_chat.c:434 ../src/gf_chat.c:567 +msgid "Power-User" +msgstr "Superanvändare" + +#: ../src/gf_chat.c:241 ../src/gf_chat.c:439 ../src/gf_chat.c:571 +msgid "Moderator" +msgstr "Moderator" + +#: ../src/gf_chat.c:246 ../src/gf_chat.c:444 ../src/gf_chat.c:575 +msgid "Admin" +msgstr "Administratör" + +#: ../src/gf_chat.c:251 ../src/gf_chat.c:449 ../src/gf_chat.c:579 +#: ../src/gf_chat.c:607 ../src/gf_games.c:220 +msgid "Unknown" +msgstr "Okänd" + +#: ../src/gf_chat.c:260 +#, c-format +msgid "You currently have the permission \"%s\"." +msgstr "Du har för närvarande privilegiet \"%s\"." + +#: ../src/gf_chat.c:311 +msgid "Buddy has been kicked." +msgstr "Kompisen har blivit utslängd." + +#: ../src/gf_chat.c:366 +#, c-format +msgid "This room's name has been changed to \"%s\"." +msgstr "Det här rummets namn har ändrats till \"%s\"." + +#: ../src/gf_chat.c:401 +#, c-format +msgid "" +"Today's message changed to:\n" +"%s" +msgstr "" +"Dagens meddelande ändrade till:\n" +"%s" + +#: ../src/gf_chat.c:456 +#, c-format +msgid "Your permission has been changed to \"%s\"." +msgstr "Dina privilegier har ändrats till \"%s\"." + +#: ../src/gf_chat.c:462 +#, c-format +msgid "%s's permission has been changed to \"%s\"." +msgstr "%ss privilegier har ändrats till \"%s\"." + +#. Join message +#: ../src/gf_chat.c:492 +#, c-format +msgid "You are now chatting in %s." +msgstr "Du chattar nu i %s." + +#: ../src/gf_chat.c:499 +#, c-format +msgid "" +"Today's message:\n" +"%s" +msgstr "" +"Dagens meddelande:\n" +"%s." + +#: ../src/gf_chat.c:582 +#, c-format +msgid "This room's default permission has been changed to \"%s\"." +msgstr "Det här rummets privilegier har ändrats till \"%s\"." + +#: ../src/gf_chat.c:601 +msgid "Public" +msgstr "Publikt" + +#: ../src/gf_chat.c:604 +msgid "Friends only" +msgstr "Endast kompisar" + +#: ../src/gf_chat.c:610 +#, c-format +msgid "This room's visibility has been changed to \"%s\"." +msgstr "Det här rummets synlighet har ändrats till \"%s\"." + +#: ../src/gf_chat.c:625 +#, c-format +msgid "This room is now password protected." +msgstr "Rummet är nu lösenordsskyddat." + +#: ../src/gf_chat.c:627 +#, c-format +msgid "This room is no longer password protected." +msgstr "Rummet är inte längre lösenordsskyddat." + +#: ../src/gf_chat.c:629 +#, c-format +msgid "This room's password has been changed." +msgstr "Lösenordet till det här rummet har ändrats." + +#: ../src/gf_chat.c:649 +#, c-format +msgid "This room is now silenced." +msgstr "Rummet är nu tystat." + +#: ../src/gf_chat.c:651 +#, c-format +msgid "This room is no longer silenced." +msgstr "Rummet är inte längre tystat." + +#: ../src/gf_chat.c:671 +#, c-format +msgid "Buddy join-/leave-messages will be displayed now." +msgstr "" +"Meddelanden när kompisar deltar/lämnar kommer att visas i fortsättningen." + +#: ../src/gf_chat.c:673 +#, c-format +msgid "Buddy join-/leave-messages will no longer be displayed." +msgstr "Meddelanden när kompisar deltar/lämnar kommer inte att visas längre." + +#: ../src/gf_chat.c:725 ../src/gf_chat.c:789 ../src/gf_chat.c:810 +#, c-format +msgid "Unknown argument: %s" +msgstr "Okänt argument: %s" + +#: ../src/gf_chat.c:734 +msgid "" +"New and old name are identical. Please note that chat room names have no " +"case." +msgstr "" +"Det nya och det gamla namnet är identiska. Kom ihåg att rum kan inte ha " +"versaler." + +#: ../src/gf_chat.c:768 +#, c-format +msgid "Unknown visibility: %s" +msgstr "Okänd synlighet: %s" + +#: ../src/gf_chat.c:819 +msgid "You are not allowed to grant/revoke any permissions." +msgstr "Du har inte tillåtelse att lägga till/ta bort privilegier." + +#: ../src/gf_chat.c:838 ../src/gf_chat.c:907 +#, c-format +msgid "Unknown buddy: %s" +msgstr "Okänd kompis: %s" + +#: ../src/gf_chat.c:844 +msgid "You can't change your own permission!" +msgstr "Du kan inte ändra dina egna privilegier!" + +#: ../src/gf_chat.c:859 ../src/gf_chat.c:868 +msgid "You are not allowed to grant this permission." +msgstr "Du har inte tillåtelse att lägga till det här privilegiet. " + +#: ../src/gf_chat.c:875 ../src/gf_chat.c:957 +#, c-format +msgid "Unknown permission: %s" +msgstr "Okänt privilegie: %s" + +#: ../src/gf_chat.c:888 +msgid "You are not allowed to kick buddies." +msgstr "Du har inte tillåtelse att slänga ut dina kompisar." + +#: ../src/gf_chat.c:913 +msgid "You can't kick yourself!" +msgstr "Du kan inte slänga ut dig själv!" + +#: ../src/gf_chat.c:926 +msgid "You are not allowed to change the default permission." +msgstr "Du har inte tillåtelse att ändra standardprivilegierna" + +#: ../src/gf_chat.c:941 ../src/gf_chat.c:950 +msgid "You are not allowed to set this default permission." +msgstr "Du har inte tillåtelse att verkställa standardprivilegiet." + +#: ../src/gf_chat.c:983 +msgid "" +"save <yes|no>:
Save the current chat room on Xfire. This " +"preserves all of the chat rooms settings and privileges. On "yes", " +"you will be asked to save the chat room to your buddy list if it is not " +"already there. If you decline this request the save will NOT be performed." +msgstr "" +"save :
Spara det nuvarande rummet på Xfire. Det här bevarar " +"alla rummets inställningar och privilegier. Om du väljer \"Ja\", kommer du " +"att bli tillfrågad att spara rummet i din kompislista om det inte redan " +"finns där. Om du avböjer kommer ditt rum INTE att sparas." + +#: ../src/gf_chat.c:992 +msgid "" +"rename <new-chat-name>:
Changes the current name for this room." +"

Requires "Admin" permission." +msgstr "" +"rename :
Ändrar namnet på det här rummet.

Kräver \"Administratör\"-privilegier." + +#: ../src/gf_chat.c:998 +msgid "" +"password [<new-password>]:
Changes the current password for this " +"room. "/password" results in removing the current password.

Requires "Admin" permission." +msgstr "" +"password []:
Ändrar det nuvarande lösenordet till det " +"här rummet. \"/Password\" tar bort det nuvarande lösenordet.

Kräver \"Administratör\"-privilegier." + +#: ../src/gf_chat.c:1005 +msgid "" +"visibilty <public|friends>:
Changes the current visibility for " +"this room.

Requires "Admin" permission." +msgstr "" +"visibility :
Ändrar synligheten för rummet.

Kräver \"Administratör\"-privilegier." + +#: ../src/gf_chat.c:1012 +msgid "" +"silence <on|off>:
Sets whether non-Moderators and non-Admins " +"should not be able to talk in this room.

Requires "" +"Moderator" or higher permission." +msgstr "" +"silence :
Välj om icke-moderatorer och icke-administratörer ska " +"kunna prata i det här rummet.

Kräver \"Moderator\" eller högre " +"privilegie." + +#: ../src/gf_chat.c:1019 +msgid "" +"userjoinmsg <on|off>:
Set whether "<User> joined" " +"and "<User> left" messages should be displayed in this room." +"

Requires "Moderator" or higher permission." +msgstr "" +"userjoinmsg :
Välj om \" deltar\"- eller \" lämnade" +"\" -meddelanden ska visas.

Kräver \"Moderator\" eller högre " +"privilegie." + +#: ../src/gf_chat.c:1027 +msgid "" +"permission <username> <muted|normal|power|moderator|admin>:
Set username's permission. Only admins may give other users the " +""Admin" permission.
Please note, that you can't change your " +"own permission.

Requires "Moderator" or higher " +"permission." +msgstr "" +"permission :
Ändra " +"användarnamns privilegier. Endast administratörer kan ge användare " +"\"Administratör\"s-privilegier.
Notera att du inte kan ändra din egna " +"privilegier.

Kräver \"Moderator\" eller högre privilegie." + +#: ../src/gf_chat.c:1036 +msgid "" +"kick <username>:
Kicks username from the channel.

Requires "Moderator" or higher permission." +msgstr "" +"kick :
Slänger ut användarnamn från rummet.

Kräver \"Moderator\" eller högre privilegie." + +#: ../src/gf_chat.c:1043 +msgid "" +"def_permission <muted|normal|power|moderator|admin>:
Set this " +"room's default permission. New buddies who join this room will have this " +"permission

Requires "Moderator" or higher permission." +msgstr "" +"def_permission :
Ändra det här " +"rummets standardprivilegier. Nya kompisar som deltar i det här rummet får " +"den här privilegienivån

Kräver \"Moderator\" eller högre " +"privilegie." + +#: ../src/gf_chat.c:1117 +msgid "" +"You attempted to join a chat room using an invalid password. Please try " +"again." +msgstr "Du försökte att delta i ett rum som är lösenordsskyddat, försök igen." + +#: ../src/gf_chat.c:1118 +msgid "Invalid password" +msgstr "Felaktigt lösenord." + +#: ../src/gf_chat.c:1122 +msgid "" +"You attempted to join a chat room that is password protected. Please try " +"again." +msgstr "Du försökte att delta i ett rum som är lösenordsskyddat, försök igen." + +#: ../src/gf_chat.c:1123 +msgid "Password required" +msgstr "Lösenord krävs" + +#: ../src/gf_chat.c:1131 +msgid "Join" +msgstr "Delta" + +#: ../src/gf_chat.c:1132 ../src/gf_friend_search.c:66 ../src/gf_menus.c:123 +msgid "Cancel" +msgstr "Avbryt" + +#: ../src/gf_chat_proto.c:517 +msgid "Chat room join error" +msgstr "Rumdeltagningsfel" + +#: ../src/gf_chat_proto.c:517 +msgid "Unknown error" +msgstr "Okänt fel" + +#: ../src/gf_chat_proto.c:518 +msgid "" +"Unknown join error. You might be blocked from this chat room or are already " +"in 5 rooms." +msgstr "" +"Okänt deltagningsfel. Du kan var blockerad från det här rummet, eller så är " +"du redan i 5 rum." + +#: ../src/gf_friend_search.c:64 ../src/gf_friend_search.c:106 +msgid "Xfire Friend Search" +msgstr "Xfire-kompissökning" + +#: ../src/gf_friend_search.c:64 +msgid "Please enter a Xfire username, name or e-Mail address here:" +msgstr "Var vänlig mata in Xfire-användarnamnm, namn eller e-postadress här:" + +#: ../src/gf_friend_search.c:65 +msgid "For example: gill123, Gill Bates or gill@bates.net" +msgstr "T.ex: gill123, Gill Bates eller gill@bates.net" + +#: ../src/gf_friend_search.c:66 +msgid "Search" +msgstr "Sök" + +#: ../src/gf_friend_search.c:81 +msgid "Username" +msgstr "Användarnamn" + +#: ../src/gf_friend_search.c:82 +msgid "First Name" +msgstr "Förnamn" + +#: ../src/gf_friend_search.c:83 +msgid "Last Name" +msgstr "Efternamn" + +#: ../src/gf_friend_search.c:106 +msgid "Search results" +msgstr "Sökresultat" + +#: ../src/gf_games.c:46 +#, c-format +msgid "The Games List has been updated to version: %s." +msgstr "Spellistan har blivit uppdaterad till version: %s." + +#: ../src/gf_games.c:50 ../src/gf_games.c:53 ../src/gf_games.c:54 +msgid "New Gfire Game List Version" +msgstr "Ny version av spellista: %s" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1306 ../src/gf_games.c:1382 +#: ../src/gf_games.c:1408 ../src/gf_games.c:1423 ../src/gf_games.c:1437 +msgid "Manage Games: error" +msgstr "Hantera spel: fel" + +#: ../src/gf_games.c:1270 ../src/gf_games.c:1307 +msgid "Couldn't add game" +msgstr "Kunde inte lägga till spel" + +#: ../src/gf_games.c:1271 +msgid "There's no such game, please try again." +msgstr "Spelet finns inte, var vänlig försök igen!" + +#: ../src/gf_games.c:1287 +msgid "Manage Games: game added" +msgstr "Hantera spel: spel tillagt" + +#: ../src/gf_games.c:1288 +msgid "The game has been successfully added." +msgstr "Spelet har blivit tillagt." + +#: ../src/gf_games.c:1292 ../src/gf_games.c:1363 +msgid "Manage Games: warning" +msgstr "Hantera spel: varning" + +#: ../src/gf_games.c:1292 +msgid "Game already added" +msgstr "Spelet är redan tillagt" + +#: ../src/gf_games.c:1293 +msgid "This game is already added, you can configure it if you want." +msgstr "Det här spelet är redan tillagt, du kan konfigurera det om du vill." + +#: ../src/gf_games.c:1307 ../src/gf_games.c:1383 +msgid "Please try again. Make sure you fill in all fields." +msgstr "Var vänlig försök igen. Se till att alla fält är ifyllda." + +#: ../src/gf_games.c:1363 +msgid "Game launch data not found" +msgstr "Spelstartsdata hittades inte" + +#: ../src/gf_games.c:1364 ../src/gf_games.c:1424 +msgid "This game is not yet added as it seems, please add it first!" +msgstr "" +"Det här spelet verkar inte vara tillagt än, var vänlig lägg till det först!" + +#: ../src/gf_games.c:1378 +msgid "Manage Games: game edited" +msgstr "Hantera spel: spelet redigerat" + +#: ../src/gf_games.c:1378 +msgid "Game edited" +msgstr "Spelet redigerat" + +#: ../src/gf_games.c:1378 +msgid "The game has been successfully edited." +msgstr "Spelet har blivit redigerat" + +#: ../src/gf_games.c:1383 +msgid "Couldn't edit game" +msgstr "Kunde inte redigera spelet" + +#: ../src/gf_games.c:1409 ../src/gf_games.c:1424 ../src/gf_games.c:1438 +msgid "Couldn't remove game" +msgstr "Kunde inte ta bort spelet" + +#: ../src/gf_games.c:1409 +msgid "No such game, please try again!" +msgstr "Spelet finns inte, var vänlig försök igen!" + +#: ../src/gf_games.c:1433 +msgid "Manage Games: game removed" +msgstr "Hantera spel: spel borttaget" + +#: ../src/gf_games.c:1434 +msgid "Game removed" +msgstr "Spel borttaget" + +#: ../src/gf_games.c:1434 +msgid "The game has been successfully removed." +msgstr "Spelet har blivit borttaget." + +#: ../src/gf_games.c:1438 +msgid "Please try again. Make sure you select a game to remove." +msgstr "Var vänlig försök igen. Se till att du har valt ett spel att ta bort." + +#: ../src/gf_network.c:129 ../src/gf_network.c:163 +msgid "Connection closed by peer." +msgstr "Anslutning stängd av användaren." + +#: ../src/gf_network.c:138 ../src/gf_network.c:172 +msgid "Socket read failure." +msgstr "Fel vid inläsning av anslutning." + +#: ../src/gf_network.c:210 +msgid "Password or Username Incorrect." +msgstr "Lösenord eller användarnamn är inkorrekt." + +#: ../src/gf_network.c:251 +#, c-format +msgid "Protocol version mismatch, needs to be %d. Auto set to new value." +msgstr "" +"Protokollversionen stämmer inte, den måste vara %d. Ställer in det nya " +"värdet automatiskt." + +#: ../src/gf_network.c:297 +msgid "You have signed on from another location." +msgstr "Du har loggat in från någon annanstans." + +#. Community site +#: ../src/gf_purple.c:156 +msgid "Xfire Community Site" +msgstr "Xfires communitysida" + +#: ../src/gf_purple.c:279 ../src/gfire.c:1174 +msgid "Game" +msgstr "Spel" + +#: ../src/gf_purple.c:285 ../src/gf_purple.c:1237 ../src/gfire.c:1180 +msgid "Server" +msgstr "Server" + +#: ../src/gf_purple.c:315 ../src/gfire.c:1199 +msgid "unknown" +msgstr "okänd" + +#: ../src/gf_purple.c:330 ../src/gfire.c:1163 ../src/gfire.c:1166 +msgid "Status" +msgstr "Status" + +#: ../src/gf_purple.c:340 ../src/gfire.c:1212 +msgid "Common Friends" +msgstr "Gemensamma kompisar" + +#: ../src/gf_purple.c:403 +msgid "Protocol initialization failed." +msgstr "Protokollinitiering misslyckades." + +#: ../src/gf_purple.c:436 +msgid "Message could not be sent. Buddy not in contact list" +msgstr "Meddelandet kunde inte skickas. Vännen finns inte i kontaktlistan" + +#: ../src/gf_purple.c:449 +msgid "Message could not be sent. Buddy offline" +msgstr "Meddelandet kunde inte skickas. Kontakten är frånkopplad" + +#. Request the invitation message +#: ../src/gf_purple.c:555 +msgid "Xfire Invitation Message" +msgstr "Xfire-inbjudningsmeddelande" + +#: ../src/gf_purple.c:556 +msgid "Please enter the message you want to send your buddy with this invite:" +msgstr "" +"Mata in det meddelande du vill skicka till din kompis tillsammans med din " +"inbjudan:" + +#: ../src/gf_purple.c:557 +msgid "Please add me to your friends list!" +msgstr "Snälla, lägg till mig i din kompislista!" + +#: ../src/gf_purple.c:558 +msgid "Invite with a message" +msgstr "Bjud in med meddelande" + +#: ../src/gf_purple.c:559 +msgid "Invite without a message" +msgstr "Bjud in utan meddelande" + +#: ../src/gf_purple.c:587 +msgid "Xfire Buddy Removal" +msgstr "Borttagning av Xfire-kompis" + +#: ../src/gf_purple.c:588 +msgid "" +"You have removed a buddy which is not on your friends list, it will be " +"restored on the next login." +msgstr "" +"Du har försökt att ta bort en kompis som inte är i din kompislista, " +"kontakten kommer att återställas vid nästa inloggning." + +#: ../src/gf_purple.c:643 +msgid "Add as friend" +msgstr "Lägg till som kompis" + +#: ../src/gf_purple.c:658 +msgid "Join Game ..." +msgstr "Delta i spelet..." + +#: ../src/gf_purple.c:674 +msgid "Join VoIP ..." +msgstr "Delta i VoIP..." + +#: ../src/gf_purple.c:684 +msgid "Xfire Profile" +msgstr "Xfire-profil" + +#: ../src/gf_purple.c:716 +#, c-format +msgid "Launch %s" +msgstr "Starta %s" + +#. General things +#: ../src/gf_purple.c:735 +msgid "Change Nickname" +msgstr "Ändra smeknamn" + +#: ../src/gf_purple.c:738 +msgid "My Profile Page" +msgstr "Min profilsida" + +#: ../src/gf_purple.c:742 +msgid "Friend Search" +msgstr "Kompissökning" + +#. Game configuration +#: ../src/gf_purple.c:747 +msgid "Reload Game Config" +msgstr "Ladda om spelkonfiguration" + +#. About +#: ../src/gf_purple.c:770 +msgid "About" +msgstr "Om" + +#: ../src/gf_purple.c:824 +msgid "_Room:" +msgstr "_Rum:" + +#: ../src/gf_purple.c:830 +msgid "_Password:" +msgstr "_Lösenord:" + +#: ../src/gf_purple.c:919 +msgid "Xfire Groupchat" +msgstr "Xfire-gruppchatt" + +#: ../src/gf_purple.c:919 +msgid "MotD change failed" +msgstr "Ändring av dagens meddelande misslyckades." + +#: ../src/gf_purple.c:920 +msgid "The MotD contains more than 200 characters." +msgstr "Ditt dagsmeddelande innehåller mer än 200 tecken." + +#: ../src/gf_purple.c:1006 +msgid "Friends of friends group name restored" +msgstr "\"Kompisar till kompisar\"-gruppnamn återställt" + +#: ../src/gf_purple.c:1006 ../src/gf_purple.c:1024 +msgid "Group name restored" +msgstr "Gruppnamnet återställt" + +#: ../src/gf_purple.c:1006 +msgid "" +"You have renamed Xfire's FoF group name. Unfortunately we had to restore " +"this groups name." +msgstr "" +"Du har ändrat Xfires \"kompisar till kompisar\"-gruppnamn. Tyvärr var vi " +"tvungna att återställa gruppens namn." + +#: ../src/gf_purple.c:1024 +msgid "Clan's group name restored" +msgstr "Klanens gruppnamn är återställt" + +#: ../src/gf_purple.c:1024 +msgid "" +"You have renamed the group name of a Xfire clan. Unfortunately we had to " +"restore this groups name." +msgstr "" +"Du har ändrat gruppnamnet för Xfire-klanen. Tyvärr var vi tvungna att " +"återställa gruppens namn." + +#: ../src/gf_purple.c:1240 +msgid "Port" +msgstr "Port" + +#: ../src/gf_purple.c:1243 +msgid "Version" +msgstr "Version" + +#: ../src/gf_purple.c:1246 +msgid "Buddies can see if I'm typing" +msgstr "Kontakter kan se om jag skriver" + +#: ../src/gf_purple.c:1249 +msgid "Auto detect for ingame status" +msgstr "Automatisk igenkänning för spelstatus" + +#: ../src/gf_purple.c:1252 +msgid "Change my status for other protocols as well" +msgstr "Ändra min status även för andra protokoll " + +#: ../src/gf_purple.c:1255 +msgid "Notify me when my status is ingame" +msgstr "Notifiera mig när min spelstatus ändras" + +#: ../src/gf_purple.c:1258 +msgid "Enable server detection" +msgstr "Använd serverigenkänning" + +#: ../src/gf_purple.c:1261 +msgid "Use Xfires P2P features" +msgstr "Använder Xfires p2p-funktioner" + +#: ../src/gf_purple.c:1265 +msgid "Display notifications for certain events" +msgstr "Visa notifieringar för vissa händelser" + +#: ../src/gf_purple.c:1269 +msgid "Show Friends of Friends" +msgstr "Visa kompisar till kompisar" + +#: ../src/gf_purple.c:1272 +msgid "Xfire" +msgstr "Xfire" + +#: ../src/gf_purple.c:1273 ../src/gf_purple.c:1274 +msgid "Xfire Protocol Plugin" +msgstr "Xfire-insticksmodul" + +#: ../src/gfire.c:179 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s är nu tillgänglig.\n" +"Besök Gfires webbplats för mer information!" + +#: ../src/gfire.c:184 ../src/gfire.c:195 +msgid "New Gfire Version" +msgstr "Ny Gfire-version" + +#. FIXME: implement a way to disable this notification +#: ../src/gfire.c:190 +#, c-format +msgid "" +"Gfire %u.%u.%u%s%s is now available.\n" +"Visit the Gfire website for more information!" +msgstr "" +"Gfire %u.%u.%u%s%s är nu tillgänglig.\n" +"Besök Gfires webbplats för mer information!" + +#: ../src/gfire.c:336 +msgid "Connecting" +msgstr "Ansluter" + +#: ../src/gfire.c:342 +msgid "Couldn't create socket." +msgstr "Kunde skapa anslutning." + +#: ../src/gfire.c:488 +msgid "Login sent" +msgstr "Inloggningsinformation skickad" + +#. TRANSLATORS: Keep "(AFK)" as is! +#. Suggestion: Use Xfires original AFK message here +#: ../src/gfire.c:514 +msgid "(AFK) Away From Keyboard" +msgstr "(AFK) Borta från tangenbordet" + +#. TRANSLATORS: Keep "(Busy)" as is! +#: ../src/gfire.c:521 +msgid "(Busy) I'm busy!" +msgstr "(Busy) Jag är upptagen!" + +#: ../src/gfire.c:792 ../src/gfire.c:801 ../src/gfire.c:971 ../src/gfire.c:980 +msgid "Error" +msgstr "Fel" + +#: ../src/gfire.c:792 +msgid "Retrieving gamerig data failed!" +msgstr "Hämtning av data om speldator misslyckades!" + +#: ../src/gfire.c:801 +msgid "Invalid gamerig data received!" +msgstr "Felaktig data om speldator mottogs!" + +#: ../src/gfire.c:816 +#, c-format +msgid "%ss Gaming Rig:" +msgstr "%ss speldator:" + +#: ../src/gfire.c:826 +msgid "Manufacturer" +msgstr "Tillverkare" + +#: ../src/gfire.c:835 +msgid "Processor" +msgstr "Processor" + +#: ../src/gfire.c:844 +msgid "Memory" +msgstr "Minne" + +#: ../src/gfire.c:853 +msgid "Video Card" +msgstr "Grafikkort" + +#: ../src/gfire.c:862 +msgid "Sound Card" +msgstr "Ljudkort" + +#: ../src/gfire.c:871 +msgid "Mainboard" +msgstr "Moderkort" + +#: ../src/gfire.c:880 +msgid "Hard Drive" +msgstr "Hårddisk" + +#: ../src/gfire.c:889 +msgid "Monitor" +msgstr "Skärm" + +#: ../src/gfire.c:898 +msgid "Keyboard" +msgstr "Tangentbord" + +#: ../src/gfire.c:907 +msgid "Mouse" +msgstr "Mus" + +#: ../src/gfire.c:916 +msgid "Mouse Surface" +msgstr "Musmatta" + +#: ../src/gfire.c:925 +msgid "Speakers" +msgstr "Högtalare" + +#: ../src/gfire.c:934 +msgid "Computer Case" +msgstr "Datorchassi" + +#: ../src/gfire.c:943 +msgid "Operating System" +msgstr "Operativsystem" + +#: ../src/gfire.c:971 +msgid "Retrieving profile data failed!" +msgstr "Hämtning av profildata misslyckades!" + +#: ../src/gfire.c:980 +msgid "Invalid profile data received!" +msgstr "Felaktig profildata mottogs!" + +#: ../src/gfire.c:985 +msgid "Profile" +msgstr "Profil" + +#: ../src/gfire.c:995 +#, c-format +msgid "%ss Profile:" +msgstr "%ss profil:" + +#: ../src/gfire.c:1005 +msgid "Real Name" +msgstr "Riktigt namn" + +#: ../src/gfire.c:1014 +msgid "Age" +msgstr "Ålder" + +#: ../src/gfire.c:1023 +msgid "Gender" +msgstr "Kön" + +#: ../src/gfire.c:1023 +msgid "Male" +msgstr "Man" + +#: ../src/gfire.c:1023 +msgid "Female" +msgstr "Kvinna" + +#: ../src/gfire.c:1032 +msgid "Occupation" +msgstr "Sysselsättning" + +#: ../src/gfire.c:1041 +msgid "Country" +msgstr "Land" + +#: ../src/gfire.c:1050 +msgid "Location" +msgstr "Område" + +#: ../src/gfire.c:1059 +msgid "Gaming Style" +msgstr "Spelstil" + +#: ../src/gfire.c:1068 +msgid "Interests" +msgstr "Intressen" + +#: ../src/gfire.c:1077 +msgid "Friends" +msgstr "Kompisar" + +#: ../src/gfire.c:1086 +msgid "Join Date" +msgstr "Registreringsdatum" + +#: ../src/gfire.c:1148 +msgid "Nickname" +msgstr "Smeknamn" + +#: ../src/gfire.c:1166 +msgid "Offline" +msgstr "Frånkopplad" + +#: ../src/gfire.c:1222 +msgid "Additional game info:" +msgstr "Ytterligare information om spelet:" + +#: ../src/gfire.c:1238 +#, c-format +msgid "%ss Clans:" +msgstr "%ss klaner:" + +#: ../src/gfire.c:1322 +msgid "Connection timed out" +msgstr "Anslutningstidsfrist har gått ut" + +#: ../src/gfire.c:1433 +msgid "Ingame status" +msgstr "Spelstatus" + +#: ../src/gfire.c:1434 +msgid "Your status has been changed." +msgstr "Din status har ändrats." + +#: ../src/gfire_proto.c:437 +msgid "Received invalid login salt!" +msgstr "Mottog felaktig inloggningssaltning!" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast" +msgstr "Xfire-systemmeddelande" + +#: ../src/gfire_proto.c:712 +msgid "Xfire System Broadcast Message:" +msgstr "Systemmeddelande från Xfire:" + +#: ../src/gf_server_browser.c:575 +msgid "Recent servers" +msgstr "Nyligen besökta servrar" + +#: ../src/gf_server_browser.c:578 +msgid "Favorite servers" +msgstr "Favoritservrar" + +#: ../src/gf_server_browser.c:581 +msgid "Friends' favorite servers" +msgstr "Kompisars favoritservrar" + +#: ../src/gf_server_browser.c:584 +msgid "All servers" +msgstr "Alla servrar" + +#: ../src/gf_server_browser.c:606 +msgid "N/A" +msgstr "N/A" + +#: ../src/gf_server_browser.c:650 ../src/gf_server_browser.c:793 +msgid "Server Browser: error" +msgstr "Serverbläddrare: fel" + +#: ../src/gf_server_browser.c:650 +msgid "Can't add favorite server" +msgstr "Kan inte lägga till favoritserver" + +#: ../src/gf_server_browser.c:651 +msgid "" +"You've reached the limit of favorite servers, you can however still remove " +"favorite servers in order to add new ones." +msgstr "" +"Du har nått gränsen för antalet tillåtna favoritservrar, du kan dock ta bort " +"gamla favoritservrar för att skapa nya." + +#: ../src/gf_server_browser.c:793 +msgid "Can't remove favorite server" +msgstr "Kan inte ta bort favoritserver" + +#: ../src/gf_server_browser.c:794 +msgid "" +"The selected server is not a favorite server and thereby can't be removed." +msgstr "" +"Den valda servern är inte en favoritserver och kan därför inte tas bort." + +#: ../src/gf_menus.c:122 +msgid "Change Xfire nickname" +msgstr "Ändra Xfire-användarnamn" + +#: ../src/gf_menus.c:122 +msgid "Leaving empty will clear your current nickname." +msgstr "Om fältet lämnas tomt kommer ditt nuvarande smeknamn att försvinna." + +#: ../src/gf_menus.c:123 +msgid "OK" +msgstr "Ok" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Gfire XML Reload" +msgstr "Omladdning av gfire-xml" + +#: ../src/gf_menus.c:129 ../src/gf_menus.c:131 +msgid "Reloading gfire_game_config.xml" +msgstr "Laddar om gfire_game_config.xml" + +#: ../src/gf_menus.c:129 +msgid "Operation failed. File not found or content was incorrect." +msgstr "" +"Processen misslyckades. Filen hittades inte, eller så var innehållet " +"felaktigt." + +#: ../src/gf_menus.c:131 +msgid "Reloading was successful." +msgstr "Omladdningen lyckades." + +#: ../src/gf_menus.c:152 +#, c-format +msgid "" +"Gfire Version: %s\n" +"Game List Version: %s" +msgstr "" +"Gfire-version: %s\n" +"Version av spellista:%s" + +#: ../src/gf_menus.c:157 +#, c-format +msgid "Gfire Version: %s" +msgstr "Gfire-version: %s" + +#: ../src/gf_menus.c:160 +msgid "About Gfire" +msgstr "Om Gfire" + +#: ../src/gf_menus.c:160 +msgid "Xfire Plugin for Pidgin" +msgstr "Xfire-insticksmodul för Pidgin" + +#: ../src/gf_menus.c:161 +msgid "Close" +msgstr "Stäng" + +#: ../src/gf_menus.c:162 +msgid "Website" +msgstr "Hemsida" + +#: ../src/gf_menus.c:163 +msgid "Wiki" +msgstr "Wiki" + +#: ../src/gf_p2p_session.c:412 +msgid "Please wait until a connection with your buddy has been established!" +msgstr "Vänta medan anslutningen med din vän etableras" + +#: ../src/gf_p2p_dl_proto.c:320 +#, c-format +msgid "File Description: %s" +msgstr "Filbeskrivning: %s" + +#: ../src/gf_p2p_dl_proto.c:320 +msgid "No description entered" +msgstr "Ingen beskrivning specifierad" + +#~ msgid "Not Removing %s" +#~ msgstr "Tar inte bort %s" + +#~ msgid "" +#~ "Account settings are set to not remove buddies\n" +#~ "The buddy will be restored on your next login" +#~ msgstr "" +#~ "Kontoinställningarna är inställda så att du inte kan ta bort kontakter\n" +#~ "Kontakten kommer att återställas vid nästa inloggning" + +#~ msgid "Don't delete buddies from server" +#~ msgstr "Ta inte bort kontakter från servern" + +#~ msgid "Connect option:" +#~ msgstr "Anslutningsalternativ:" + +#~ msgid "Required argument:" +#~ msgstr "Fordrat argument:" + +#~ msgid "Use detection" +#~ msgstr "Använd igenkänning" + +#~ msgid "Ping" +#~ msgstr "Ping" + +#~ msgid "Players" +#~ msgstr "Spelare" + +#~ msgid "Server IP" +#~ msgstr "Server IP" + +#~ msgid "Server name" +#~ msgstr "Servernamn" + +#~ msgid "bookmark-new" +#~ msgstr "Nytt bokmärke" + +#~ msgid "%s [Xfire Chat]" +#~ msgstr "%s [Xfire-chatt]" + +#~ msgid "Please try again. An error occured while adding the game." +#~ msgstr "" +#~ "Var vänlig försök igen. Ett fel uppstod när spelet skulle läggas till." + +#~ msgid "Please try again. An error occured while editing the game." +#~ msgstr "Var vänlig försök igen. Ett fel uppstod medan du redigerade spelet." + +#~ msgid "Please try again. An error occured while removing the game." +#~ msgstr "Var vänlig försök igen. Ett fel uppstod när spelet skulle tas bort." + +#~ msgid "Incompatible games configuration" +#~ msgstr "Okompatibel spelkonfiguration" + +#~ msgid "" +#~ "Your current games configuration is incompatible with this version of " +#~ "Gfire. Please remove it and try again." +#~ msgstr "" +#~ "Din nuvarande spelkonfiguration är inte kompatibel med den här versionen " +#~ "av Gfire. Var vänlig radera den och försök igen." + +#~ msgid "Reload Game ID List" +#~ msgstr "Ladda om listan för spel-ID" + +#~ msgid "Get Game ID List" +#~ msgstr "Hämta listan för spel-ID" + +#~ msgid "Reloading gfire_games.xml" +#~ msgstr "Laddar om gfire_games.xml" + +#~ msgid "Gfire Game List Download" +#~ msgstr "Ladda ner Gfire-spellista" + +#~ msgid "Download failed" +#~ msgstr "Nedladdning misslyckades" + +#~ msgid "Download successful" +#~ msgstr "Nedladdning lyckades" + +#~ msgid "Unable to write gfire_games.xml" +#~ msgstr "Kunde inte skriva till gfire-games.xml" diff -Nru gfire-0.8.3/pre_config.h.in gfire-0.9.4/pre_config.h.in --- gfire-0.8.3/pre_config.h.in 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/pre_config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* pre_config.h.in. Generated from configure.ac by autoheader. */ - - -#ifndef _GFIRE_CONFIG_H -#define _GFIRE_CONFIG_H - - -/* Define if debugging is enabled. */ -#undef DEBUG - -/* Gfire Version */ -#undef GFIRE_VERSION - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if we've found pidgin. */ -#undef HAVE_PIDGIN - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -#endif diff -Nru gfire-0.8.3/README gfire-0.9.4/README --- gfire-0.8.3/README 2009-08-19 16:47:43.000000000 +0000 +++ gfire-0.9.4/README 2011-03-23 18:09:20.000000000 +0000 @@ -3,8 +3,7 @@ About ===== -Gfire 0.8.3 will need Pidgin 2.5.0 or higher because of all the new -features that are implemented. To compile it from source, it will be +Gfire 0.9.4 will need Pidgin 2.5.0 or higher. To compile it from source, it will be for most users easy as running: ./configure --prefix=/usr diff -Nru gfire-0.8.3/src/gf_base.h gfire-0.9.4/src/gf_base.h --- gfire-0.8.3/src/gf_base.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_base.h 2011-03-14 20:26:27.000000000 +0000 @@ -0,0 +1,150 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_BASE_H +#define _GF_BASE_H + +// Check for a BSD-type OS +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__APPLE__) +# define GF_OS_BSD +#endif + +// Globally required headers //////////////////////////////////////// +#ifdef _WIN32 +# include +# define _WIN32_WINNT WindowsXP +# define WINVER WindowsXP +# include "gfire_config_win.h" +# include "internal.h" +# undef _ +#else +# ifdef HAVE_CONFIG_H +# include "gfire_config.h" +# endif // HAVE_CONFIG_H +# include +# include +# include +# include +# include +#endif // _WIN32 + +// Compareable Gfire version +#define GFIRE_VERSION ((GFIRE_VERSION_MAJOR << 16) | (GFIRE_VERSION_MINOR << 8) | GFIRE_VERSION_PATCH) + +// Standard libraries +#include +#include +#include +#include + +// Glib +#include +#include +#include +#include + +#ifdef HAVE_GTK + #include + #include +#endif // HAVE_GTK + +// Libpurple +#include "core.h" +#include "util.h" +#include "server.h" +#include "notify.h" +#include "plugin.h" +#include "account.h" +#include "accountopt.h" +#include "blist.h" +#include "conversation.h" +#include "debug.h" +#include "prpl.h" +#include "proxy.h" +#include "util.h" +#include "version.h" +#include "request.h" +#include "cipher.h" +#include "xmlnode.h" +#include "privacy.h" +#include "cmds.h" +#include "savedstatuses.h" +#include "dnsquery.h" +#include "network.h" + +// Gfire debugging macros +#include "gf_debug.h" + +#include "gf_util.h" + +// Internationalization ///////////////////////////////////////////// +#ifdef ENABLE_NLS + #include +#else +# define _(string) (const char*)(string) +# define N_(string) _(string) +#endif // ENABLE_NLS + +#ifndef G_GNUC_NULL_TERMINATED +# if __GNUC__ >= 4 +# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) +# else +# define G_GNUC_NULL_TERMINATED +# endif /* __GNUC__ >= 4 */ +#endif // G_GNUC_NULL_TERMINATED + +// Global definitions //////////////////////////////////////////////// +#define GFIRE_PRPL_ID "prpl-xfire" +#define GFIRE_WEBSITE "http://gfireproject.org" +#define GFIRE_WIKI "http://my-trac.assembla.com/gfire/wiki" +#define GFIRE_DEFAULT_GROUP_NAME "Xfire" +#define GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME _("Xfire - Friends of Friends playing games") +#define GFIRE_CLAN_GROUP_FORMATTING "%s [%s]" // long name, short name +#define GFIRE_GAMES_XML_URL "http://gfireproject.org/files/gfire_games_v2.xml" +#define GFIRE_CURRENT_VERSION_XML_URL "http://gfireproject.org/files/gfire_version.xml" +#define XFIRE_HEADER_LEN 5 +#define XFIRE_USERID_LEN 4 +#define XFIRE_CLANID_LEN 4 +#define XFIRE_SID_LEN 16 +#define XFIRE_GAMEID_LEN 4 +#define XFIRE_GAMEPORT_LEN 4 +#define XFIRE_GAMEIP_LEN 4 +#define XFIRE_CHATID_LEN 21 +#define XFIRE_SERVER "cs.xfire.com" +#define XFIRE_PORT 25999 +#define XFIRE_PROTO_VERSION 132 +#define XFIRE_CONNECT_STEPS 3 +#define XFIRE_TIMEOUT_TIME 240 // See gfire_keep_alive for more info +#define XFIRE_PROFILE_URL "http://www.xfire.com/profile/" +#define XFIRE_COMMUNITY_URL "http://www.xfire.com/communities/%s/" // community tag +#define XFIRE_XML_INFO_URL "http://www.xfire.com/xml/%s/%s/" // username, info-type +#define XFIRE_AVATAR_URL "http://screenshot.xfire.com/avatar/%s.jpg?%u" // username, revision number +#define XFIRE_GALLERY_AVATAR_URL "http://media.xfire.com/xfire/xf/images/avatars/gallery/default/%03u.gif" // avatar id +#define XFIRE_COMMUNITY_AVATAR_URL "http://screenshot.xfire.com/clan_logo/160/%s.jpg?v=%d" // long community name, random number +#define XFIRE_SEND_TYPING_TIMEOUT 10 +#define XFIRE_SEND_ACK_TIMEOUT 15 +#define XFIRE_SEND_ACK_P2P_TIMEOUT 2 +#define XFIRE_NAT_SERVER1 "nat1.xfire.com" +#define XFIRE_NAT_SERVER2 "nat2.xfire.com" +#define XFIRE_NAT_SERVER3 "nat3.xfire.com" +#define XFIRE_NAT_PORT 9856 + +#endif // _GF_BASE_H diff -Nru gfire-0.8.3/src/gf_buddies.c gfire-0.9.4/src/gf_buddies.c --- gfire-0.8.3/src/gf_buddies.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_buddies.c 2011-03-14 20:26:22.000000000 +0000 @@ -0,0 +1,1946 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_network.h" +#include "gf_buddies_proto.h" +#include "gf_buddies.h" +#include "gf_p2p_im_handler.h" + +static im_sent *gfire_im_sent_create(guint32 p_imindex, const gchar *p_msg) +{ + im_sent *ret = g_malloc0(sizeof(im_sent)); + if(!ret) + return NULL; + + ret->imindex = p_imindex; + if(p_msg) + ret->msg = g_strdup(p_msg); + else + ret->msg = g_strdup(""); + + GTimeVal gtv; + g_get_current_time(>v); + ret->time = gtv.tv_sec; + + return ret; +} + +static void gfire_im_sent_free(im_sent *p_data) +{ + if(!p_data) + return; + + if(p_data->msg) g_free(p_data->msg); + g_free(p_data); +} + +static gfire_buddy_clan_data *gfire_buddy_clan_data_create(gfire_clan *p_clan, const gchar *p_alias, gboolean p_default) +{ + if(!p_clan) + return NULL; + + gfire_buddy_clan_data *ret = g_malloc0(sizeof(gfire_buddy_clan_data)); + if(!ret) + goto error; + + ret->clan = p_clan; + ret->is_default = p_default; + + if(p_alias && strlen(p_alias) > 0) + { + ret->clan_alias = g_strdup(p_alias); + if(!ret->clan_alias) + { + g_free(ret); + goto error; + } + } + + return ret; + +error: + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_clan_data_create: Out of memory!\n"); + return NULL; +} + +static void gfire_buddy_clan_data_free(gfire_buddy_clan_data *p_data) +{ + if(!p_data) + return; + + if(p_data->clan_alias) g_free(p_data->clan_alias); + + g_free(p_data); +} + +static game_client_data *gfire_game_client_data_create(const gchar *p_key, const gchar *p_value) +{ + game_client_data *ret = g_malloc0(sizeof(game_client_data)); + if(!ret) + goto error; + + if(p_key) + ret->key = g_strdup(p_key); + + if(p_value) + ret->value = g_strdup(p_value); + + return ret; + +error: + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_game_client_data_create: Out of memory!\n"); + return NULL; +} + +static void gfire_game_client_data_free(game_client_data *p_data) +{ + if(!p_data) + return; + + if(p_data->key) + g_free(p_data->key); + + if(p_data->value) + g_free(p_data->value); + + g_free(p_data); +} + +GList *gfire_game_client_data_parse(const gchar *p_datastring) +{ + if(!p_datastring) + return NULL; + + static const gchar delimit_pairs[] = {0x02, 0x00}; + static const gchar delimit_values[] = {0x01, 0x00}; + + GList *ret = NULL; + + gchar **pieces = g_strsplit(p_datastring, delimit_pairs, 0); + if(!pieces) + return NULL; + + int i; + for(i = 0; i < g_strv_length(pieces); i++) + { + if(!pieces[i] || pieces[i][0] == 0) + continue; + + gchar **pair = g_strsplit(pieces[i], delimit_values, 2); + if(!pair) + continue; + else if(g_strv_length(pair) != 2) + { + g_strfreev(pair); + continue; + } + + game_client_data *gcd = gfire_game_client_data_create(pair[0], pair[1]); + if(!gcd) + { + g_strfreev(pair); + continue; + } + + ret = g_list_append(ret, gcd); + g_strfreev(pair); + } + + g_strfreev(pieces); + return ret; +} + +gfire_buddy *gfire_buddy_create(guint32 p_userid, const gchar *p_name, const gchar *p_alias, gfire_buddy_type p_type) +{ + if(!p_name) + return NULL; + + gfire_buddy *ret = g_malloc0(sizeof(gfire_buddy)); + if(!ret) + goto error; + + ret->sid = g_malloc0(XFIRE_SID_LEN); + if(!ret->sid) + { + gfire_buddy_free(ret); + goto error; + } + + ret->userid = p_userid; + ret->type = p_type; + ret->hasP2P = GFP2P_UNKNOWN; + + ret->name = g_strdup(p_name); + if(!ret->name) + { + gfire_buddy_free(ret); + goto error; + } + + ret->lost_ims_timer = g_timeout_add_seconds(XFIRE_SEND_ACK_TIMEOUT, (GSourceFunc)gfire_buddy_check_pending_ims_cb, ret); + ret->lost_p2p_ims_timer = g_timeout_add_seconds(XFIRE_SEND_ACK_P2P_TIMEOUT, (GSourceFunc)gfire_buddy_check_pending_p2p_ims_cb, ret); + ret->status = PURPLE_STATUS_AVAILABLE; + + gfire_buddy_set_alias(ret, p_alias); + +#ifdef USE_NOTIFICATIONS + GTimeVal cur_time; + g_get_current_time(&cur_time); + ret->creation_time = cur_time.tv_sec; +#endif // USE_NOTIFICATIONS + + return ret; + +error: + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_create: Out of memory!\n"); + return NULL; +} + +void gfire_buddy_free(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return; + + if(p_buddy->p2p) + { + gfire_p2p_connection_remove_session(gfire_get_p2p(p_buddy->gc->proto_data), p_buddy->p2p); + gfire_p2p_session_free(p_buddy->p2p, TRUE); + } + + if(p_buddy->p2p_request_timeout) + purple_timeout_remove(p_buddy->p2p_request_timeout); + g_source_remove(p_buddy->lost_ims_timer); + g_source_remove(p_buddy->lost_p2p_ims_timer); + + if(p_buddy->prpl_buddy && gfire_buddy_is_friend_of_friend(p_buddy)) + purple_blist_remove_buddy(p_buddy->prpl_buddy); + + if(p_buddy->alias) g_free(p_buddy->alias); + if(p_buddy->status_msg) g_free(p_buddy->status_msg); + if(p_buddy->name) g_free(p_buddy->name); + if(p_buddy->sid) g_free(p_buddy->sid); + + GList *cur_clan_data = p_buddy->clan_data; + for(; cur_clan_data; cur_clan_data = g_list_next(cur_clan_data)) + gfire_buddy_clan_data_free((gfire_buddy_clan_data*)cur_clan_data->data); + + GList *cur_pim_data = p_buddy->pending_ims; + for(; cur_pim_data; cur_pim_data = g_list_next(cur_pim_data)) + gfire_im_sent_free((im_sent*)cur_pim_data->data); + + cur_pim_data = p_buddy->pending_p2p_ims; + for(; cur_pim_data; cur_pim_data = g_list_next(cur_pim_data)) + gfire_im_sent_free((im_sent*)cur_pim_data->data); + + if(p_buddy->common_buddies) + gfire_list_clear(p_buddy->common_buddies); + + while(p_buddy->game_client_data) + { + gfire_game_client_data_free(p_buddy->game_client_data->data); + p_buddy->game_client_data = g_list_delete_link(p_buddy->game_client_data, p_buddy->game_client_data); + } + + g_list_free(p_buddy->clan_data); + g_list_free(p_buddy->pending_ims); + g_list_free(p_buddy->pending_p2p_ims); + gfire_list_clear(p_buddy->missing_ims); + + g_free(p_buddy); +} + +gboolean gfire_buddy_is_friend(const gfire_buddy *p_buddy) +{ + return (p_buddy && (p_buddy->type == GFBT_FRIEND)); +} + +gboolean gfire_buddy_is_clan_member(const gfire_buddy *p_buddy) +{ + return (p_buddy && (p_buddy->type == GFBT_CLAN)); +} + +gboolean gfire_buddy_is_friend_of_friend(const gfire_buddy *p_buddy) +{ + return (p_buddy && (p_buddy->type == GFBT_FRIEND_OF_FRIEND)); +} + +gboolean gfire_buddy_is_by_userid(const gfire_buddy *p_buddy, guint32 p_userid) +{ + if(!p_buddy) + return FALSE; + + return (p_userid == p_buddy->userid); +} + +gboolean gfire_buddy_is_by_sid(const gfire_buddy *p_buddy, const guint8 *p_sid) +{ + if(!p_buddy || !p_sid) + return FALSE; + + return (memcmp(p_buddy->sid, p_sid, XFIRE_SID_LEN) == 0); +} + +void gfire_buddy_send(gfire_buddy *p_buddy, const gchar *p_msg) +{ + if(!p_buddy || !p_msg) + return; + + p_buddy->im++; + + p_buddy->pending_ims = g_list_append(p_buddy->pending_ims, gfire_im_sent_create(p_buddy->im, p_msg)); + + /* in 2.0 the gtkimhtml stuff started escaping special chars: '&' is now "&"; + Xfire native clients don't handle it (and HTML at all). */ + gchar *no_html = purple_markup_strip_html(p_msg); + gchar *unescaped = purple_unescape_html(no_html); + g_free(no_html); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Sending IM to %s: %s\n", gfire_buddy_get_name(p_buddy), NN(unescaped)); + if(gfire_buddy_uses_p2p(p_buddy)) + { + gfire_p2p_im_handler_send_im(p_buddy->p2p, p_buddy->sid, p_buddy->im, unescaped); + p_buddy->pending_p2p_ims = g_list_append(p_buddy->pending_p2p_ims, gfire_im_sent_create(p_buddy->im, p_msg)); + } + else + { + guint16 packet_len = gfire_buddy_proto_create_send_im(p_buddy->sid, p_buddy->im, unescaped); + if(packet_len > 0) gfire_send(p_buddy->gc, packet_len); + + if(gfire_buddy_has_p2p(p_buddy)) + gfire_buddy_request_p2p(p_buddy, FALSE); + } + g_free(unescaped); +} + +void gfire_buddy_send_nop2p(gfire_buddy *p_buddy, const gchar *p_msg, guint32 p_imindex) +{ + if(!p_buddy || !p_msg) + return; + + /* in 2.0 the gtkimhtml stuff started escaping special chars: '&' is now "&"; + Xfire native clients don't handle it (and HTML at all). */ + gchar *no_html = purple_markup_strip_html(p_msg); + gchar *unescaped = purple_unescape_html(no_html); + g_free(no_html); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Resending IM over Xfire to %s: %s\n", gfire_buddy_get_name(p_buddy), NN(unescaped)); + + guint16 packet_len = gfire_buddy_proto_create_send_im(p_buddy->sid, p_imindex, unescaped); + if(packet_len > 0) gfire_send(p_buddy->gc, packet_len); + + g_free(unescaped); +} + +void gfire_buddy_got_im(gfire_buddy *p_buddy, guint32 p_imindex, const gchar *p_msg, gboolean p_p2p) +{ + if(!p_buddy || !p_msg || !p_buddy->gc) + return; + + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Received IM from %s: %s\n", gfire_buddy_get_name(p_buddy), p_msg); + + // Send ACK + if(p_p2p) + gfire_p2p_im_handler_send_ack(p_buddy->p2p, p_buddy->sid, p_imindex); + else + { + guint16 len = gfire_buddy_proto_create_ack(p_buddy->sid, p_imindex); + if(len > 0) gfire_send(p_buddy->gc, len); + } + + // We may have already received this message + if(p_buddy->highest_im > p_imindex) + { + GList *cur = p_buddy->missing_ims; + while(cur) + { + guint32 *imindex = (guint32*)cur->data; + // Missing imindex? + if(*imindex == p_imindex) + { + g_free(imindex); + p_buddy->missing_ims = g_list_delete_link(p_buddy->missing_ims, cur); + + break; + } + + cur = g_list_next(cur); + } + + // IM was already received, skip displaying + if(!cur) + return; + } + // This is the first message we receive, init highest_im to the buddy's client current value + else if(p_buddy->highest_im == 0) + { + p_buddy->highest_im = p_imindex; + } + // Received the last message twice + else if(p_buddy->highest_im == p_imindex) + { + return; + } + // Add missing indexes + else + { + guint32 i = p_buddy->highest_im + 1; + for(; i < p_imindex; i++) + { + guint32 *imindex = g_malloc(sizeof(guint32)); + *imindex = i; + p_buddy->missing_ims = g_list_append(p_buddy->missing_ims, imindex); + } + p_buddy->highest_im = p_imindex; + } + + // Show IM + PurpleAccount *account = purple_connection_get_account(p_buddy->gc); + // Only if buddy is not blocked + if(purple_privacy_check(account, gfire_buddy_get_name(p_buddy))) + { + gchar *escaped = gfire_escape_html(p_msg); + serv_got_im(p_buddy->gc, gfire_buddy_get_name(p_buddy), escaped, 0, time(NULL)); + g_free(escaped); + } +} + +void gfire_buddy_send_typing(gfire_buddy *p_buddy, gboolean p_typing) +{ + if(!p_buddy || !gfire_buddy_is_online(p_buddy)) + return; + + p_buddy->im++; + + if(gfire_buddy_uses_p2p(p_buddy)) + gfire_p2p_im_handler_send_typing(p_buddy->p2p, p_buddy->sid, p_buddy->im, p_typing); + else + { + guint16 packet_len = gfire_buddy_proto_create_typing_notification(p_buddy->sid, p_buddy->im, p_typing); + if(packet_len > 0) gfire_send(p_buddy->gc, packet_len); + } +} + +void gfire_buddy_got_typing(const gfire_buddy *p_buddy, gboolean p_typing) +{ + if(!p_buddy) + return; + + purple_debug_info("gfire", "%s %s.\n", gfire_buddy_get_name(p_buddy), p_typing ? "is now typing" : "stopped typing"); + + serv_got_typing(p_buddy->gc, gfire_buddy_get_name(p_buddy), XFIRE_SEND_TYPING_TIMEOUT, p_typing ? PURPLE_TYPING : PURPLE_NOT_TYPING); +} + +void gfire_buddy_got_im_ack(gfire_buddy *p_buddy, guint32 p_imindex) +{ + if(!p_buddy) + return; + + // Remove pending IM + GList *cur = p_buddy->pending_ims; + while(cur) + { + im_sent *ims = cur->data; + if(!ims) + { + cur = g_list_next(cur); + continue; + } + + if(ims->imindex == p_imindex) + { + gfire_im_sent_free(ims); + p_buddy->pending_ims = g_list_delete_link(p_buddy->pending_ims, cur); + + break; + } + + cur = g_list_next(cur); + } + + // Remove pending P2P IM + cur = p_buddy->pending_p2p_ims; + while(cur) + { + im_sent *ims = cur->data; + if(!ims) + { + cur = g_list_next(cur); + continue; + } + + if(ims->imindex == p_imindex) + { + gfire_im_sent_free(ims); + p_buddy->pending_p2p_ims = g_list_delete_link(p_buddy->pending_p2p_ims, cur); + + return; + } + + cur = g_list_next(cur); + } +} + +gboolean gfire_buddy_check_pending_ims_cb(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + GTimeVal gtv; + g_get_current_time(>v); + + GList *cur = p_buddy->pending_ims; + while(cur) + { + im_sent *ims = cur->data; + if(!ims) + { + cur = g_list_next(cur); + continue; + } + + if(gtv.tv_sec - ims->time > XFIRE_SEND_ACK_TIMEOUT) + { + gchar *warn = g_strdup_printf(_("%s may have not received this message:\n%s"), gfire_buddy_get_alias(p_buddy), ims->msg); + purple_conv_present_error(gfire_buddy_get_name(p_buddy), purple_buddy_get_account(p_buddy->prpl_buddy), warn); + g_free(warn); + + gfire_im_sent_free(ims); + p_buddy->pending_ims = g_list_delete_link(p_buddy->pending_ims, cur); + cur = p_buddy->pending_ims; + } + + cur = g_list_next(cur); + } + + return TRUE; +} + +gboolean gfire_buddy_check_pending_p2p_ims_cb(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + GTimeVal gtv; + g_get_current_time(>v); + + GList *cur = p_buddy->pending_p2p_ims; + while(cur) + { + im_sent *ims = cur->data; + if(!ims) + { + cur = g_list_next(cur); + continue; + } + + if(gtv.tv_sec - ims->time > XFIRE_SEND_ACK_P2P_TIMEOUT) + { + gfire_buddy_send_nop2p(p_buddy, ims->msg, ims->imindex); + gfire_im_sent_free(ims); + p_buddy->pending_p2p_ims = g_list_delete_link(p_buddy->pending_p2p_ims, cur); + cur = p_buddy->pending_p2p_ims; + } + + cur = g_list_next(cur); + } + + return TRUE; +} + +static gfire_buddy_clan_data *gfire_buddy_get_default_clan_data(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return NULL; + + GList *cur = p_buddy->clan_data; + for(; cur; cur = g_list_next(cur)) + { + if(((gfire_buddy_clan_data*)cur->data)->is_default) + return (gfire_buddy_clan_data*)cur->data; + } + + return NULL; +} + +guint32 gfire_buddy_get_default_clan(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return 0; + + gfire_buddy_clan_data *data = gfire_buddy_get_default_clan_data(p_buddy); + if(data) + return data->clan->id; + else + return 0; +} + +GList *gfire_buddy_get_clans_info(const gfire_buddy *p_buddy) +{ + if(!p_buddy || !p_buddy->clan_data) + return NULL; + + GList *ret = NULL; + GList *cur = p_buddy->clan_data; + for(; cur; cur = g_list_next(cur)) + { + ret = g_list_append(ret, ((gfire_buddy_clan_data*)cur->data)->clan); + if(((gfire_buddy_clan_data*)cur->data)->clan_alias) + ret = g_list_append(ret, g_strdup(((gfire_buddy_clan_data*)cur->data)->clan_alias)); + else + ret = g_list_append(ret, NULL); + } + + return ret; +} + +void gfire_buddy_prpl_add(gfire_buddy *p_buddy, gfire_group *p_group) +{ + if(!p_buddy || !p_buddy->gc || p_buddy->prpl_buddy) + return; + + PurpleGroup *group = NULL; + + PurpleBuddy *prpl_buddy = purple_find_buddy(purple_connection_get_account(p_buddy->gc), gfire_buddy_get_name(p_buddy)); + if(!prpl_buddy) + { + prpl_buddy = purple_buddy_new(purple_connection_get_account(p_buddy->gc), gfire_buddy_get_name(p_buddy), NULL); + if(!prpl_buddy) + { + purple_debug_error("gfire", "gfire_buddy_prpl_add: Creation of PurpleBuddy failed\n"); + return; + } + + if(gfire_buddy_is_friend(p_buddy)) + { + if(!p_group) + { + group = purple_find_group(GFIRE_DEFAULT_GROUP_NAME); + if(!group) + { + group = purple_group_new(GFIRE_DEFAULT_GROUP_NAME); + purple_blist_add_group(group, NULL); + } + } + else + group = gfire_group_get_group(p_group); + } + else if(gfire_buddy_is_clan_member(p_buddy)) + { + if(!p_buddy->clan_data) + return; + + group = gfire_clan_get_prpl_group(gfire_buddy_get_default_clan_data(p_buddy)->clan); + if(!group) + return; + } + else if(gfire_buddy_is_friend_of_friend(p_buddy)) + { + group = purple_find_group(GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME); + if(!group) + { + group = purple_group_new(GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME); + purple_blist_add_group(group, NULL); + purple_blist_node_set_bool((PurpleBlistNode*)group, "collapsed", TRUE); + } + } + + purple_blist_add_buddy(prpl_buddy, NULL, group, NULL); + + if(gfire_buddy_is_friend_of_friend(p_buddy)) + purple_blist_node_set_flags((PurpleBlistNode*)prpl_buddy, PURPLE_BLIST_NODE_FLAG_NO_SAVE); + else if(gfire_buddy_is_clan_member(p_buddy)) + purple_blist_node_set_bool((PurpleBlistNode*)prpl_buddy, "clanmember", TRUE); + } + else + { + // Move the buddy to the correct group + if(p_group) + { + if(purple_buddy_get_group(prpl_buddy) != gfire_group_get_group(p_group)) + purple_blist_add_buddy(prpl_buddy, NULL, gfire_group_get_group(p_group), NULL); + } + else if(gfire_buddy_is_friend(p_buddy)) + { + PurpleGroup *def = purple_find_group(GFIRE_DEFAULT_GROUP_NAME); + if(purple_buddy_get_group(prpl_buddy) != def) + { + if(!def) + { + def = purple_group_new(GFIRE_DEFAULT_GROUP_NAME); + purple_blist_add_group(def, NULL); + } + + purple_blist_add_buddy(prpl_buddy, NULL, def, NULL); + } + } + + p_buddy->avatarnumber = purple_blist_node_get_int((PurpleBlistNode*)prpl_buddy, "avatarnumber"); + p_buddy->avatartype = purple_blist_node_get_int((PurpleBlistNode*)prpl_buddy, "avatartype"); + } + + p_buddy->prpl_buddy = prpl_buddy; + + serv_got_alias(p_buddy->gc, gfire_buddy_get_name(p_buddy), gfire_buddy_get_alias(p_buddy)); +} + +void gfire_buddy_prpl_remove(gfire_buddy *p_buddy) +{ + if(!p_buddy || !p_buddy->prpl_buddy) + return; + + purple_blist_remove_buddy(p_buddy->prpl_buddy); + p_buddy->prpl_buddy = NULL; +} + +void gfire_buddy_prpl_move(gfire_buddy *p_buddy, PurpleGroup *p_group) +{ + if(!p_buddy || !p_buddy->prpl_buddy || !p_group) + return; + + purple_blist_add_buddy(p_buddy->prpl_buddy, NULL, p_group, NULL); +} + +static void gfire_buddy_update_status(gfire_buddy *p_buddy) +{ + if(!p_buddy || !p_buddy->prpl_buddy) + return; + + if(gfire_buddy_is_online(p_buddy)) + { + gchar *status_msg = gfire_buddy_get_status_text(p_buddy, FALSE); + if(status_msg) + { + purple_prpl_got_user_status(purple_buddy_get_account(p_buddy->prpl_buddy), gfire_buddy_get_name(p_buddy), + purple_primitive_get_id_from_type(p_buddy->status), "message", status_msg, NULL); + g_free(status_msg); + } + else + purple_prpl_got_user_status(purple_buddy_get_account(p_buddy->prpl_buddy), gfire_buddy_get_name(p_buddy), + purple_primitive_get_id_from_type(p_buddy->status), NULL); + } + else + purple_prpl_got_user_status(purple_buddy_get_account(p_buddy->prpl_buddy), gfire_buddy_get_name(p_buddy), + "offline", NULL); +} + +void gfire_buddy_set_session_id(gfire_buddy *p_buddy, const guint8 *p_sessionid) +{ + if(!p_buddy || !p_sessionid) + return; + + memcpy(p_buddy->sid, p_sessionid, XFIRE_SID_LEN); + + // Reset states + if(!gfire_buddy_is_online(p_buddy)) + { + // Remove offline FoF + if(gfire_buddy_is_friend_of_friend(p_buddy)) + { + gfire_remove_buddy((gfire_data*)purple_account_get_connection(purple_buddy_get_account(p_buddy->prpl_buddy))->proto_data, p_buddy, FALSE, TRUE); + return; + } + + // Reset games + gfire_game_data_reset(&p_buddy->game_data); + gfire_game_data_reset(&p_buddy->voip_data); + + // Reset status + if(p_buddy->status_msg) g_free(p_buddy->status_msg); + p_buddy->status_msg = NULL; + + // Close P2P + if(p_buddy->p2p) + { + gfire_p2p_connection_remove_session(gfire_get_p2p(p_buddy->gc->proto_data), p_buddy->p2p); + gfire_p2p_session_free(p_buddy->p2p, TRUE); + p_buddy->p2p = NULL; + } + p_buddy->p2p_requested = FALSE; + p_buddy->hasP2P = GFP2P_UNKNOWN; + if(p_buddy->p2p_request_timeout) + { + purple_input_remove(p_buddy->p2p_request_timeout); + p_buddy->p2p_request_timeout = 0; + } + + // Reset IM state + p_buddy->highest_im = 0; + gfire_list_clear(p_buddy->missing_ims); + p_buddy->missing_ims = NULL; + } + else + { + p_buddy->status = PURPLE_STATUS_AVAILABLE; + } + + gfire_buddy_update_status(p_buddy); +} + +void gfire_buddy_set_game_status(gfire_buddy *p_buddy, guint32 p_gameid, guint32 p_port, guint32 p_ip) +{ + if(!p_buddy) + return; + + #ifdef USE_NOTIFICATIONS + // Wait for 5 seconds on buddy creation, so we are not spammed by the initial game status + if(!p_buddy->show_game_status) + { + GTimeVal cur_time; + g_get_current_time(&cur_time); + + if((cur_time.tv_sec - p_buddy->creation_time) >= 5) + p_buddy->show_game_status = TRUE; + } + + if(p_buddy->prpl_buddy && p_buddy->show_game_status && gfire_buddy_is_friend(p_buddy) && + purple_account_get_bool(purple_buddy_get_account(p_buddy->prpl_buddy), "use_notify", TRUE) && + (p_buddy->game_data.id != p_gameid)) + { + if(p_gameid != 0) + { + gchar *game_name = gfire_game_name(p_gameid, TRUE); + gchar *msg = g_strdup_printf(_("Playing %s now!"), game_name); + gfire_notify_buddy(p_buddy->prpl_buddy, purple_buddy_get_contact_alias(p_buddy->prpl_buddy), msg); + g_free(game_name); + g_free(msg); + } + else + { + gchar *msg = g_strdup(_("Stopped playing!")); + gfire_notify_buddy(p_buddy->prpl_buddy, purple_buddy_get_contact_alias(p_buddy->prpl_buddy), msg); + g_free(msg); + } + } +#endif // USE_NOTIFICATIONS + + p_buddy->game_data.id = p_gameid; + p_buddy->game_data.port = p_port; + p_buddy->game_data.ip.value = p_ip; + + // Delete game client data + if(p_buddy->game_data.id <= 0) + { + while(p_buddy->game_client_data) + { + gfire_game_client_data_free(p_buddy->game_client_data->data); + p_buddy->game_client_data = g_list_delete_link(p_buddy->game_client_data, p_buddy->game_client_data); + } + } + + gfire_buddy_update_status(p_buddy); + + purple_debug(PURPLE_DEBUG_INFO, "gfire", "%s is playing %u on %d.%d.%d.%d:%d\n", + gfire_buddy_get_name(p_buddy), p_buddy->game_data.id, p_buddy->game_data.ip.octets[3], + p_buddy->game_data.ip.octets[2], p_buddy->game_data.ip.octets[1], + p_buddy->game_data.ip.octets[0], p_buddy->game_data.port); +} + +void gfire_buddy_set_game_client_data(gfire_buddy *p_buddy, GList *p_data) +{ + if(!p_buddy || !p_data) + return; + + while(p_buddy->game_client_data) + { + gfire_game_client_data_free(p_buddy->game_client_data->data); + p_buddy->game_client_data = g_list_delete_link(p_buddy->game_client_data, p_buddy->game_client_data); + } + + p_buddy->game_client_data = p_data; +} + +void gfire_buddy_set_voip_status(gfire_buddy *p_buddy, guint32 p_voipid, guint32 p_port, guint32 p_ip) +{ + if(!p_buddy) + return; + + p_buddy->voip_data.id = p_voipid; + p_buddy->voip_data.port = p_port; + p_buddy->voip_data.ip.value = p_ip; + + gfire_buddy_update_status(p_buddy); + + purple_debug(PURPLE_DEBUG_INFO, "gfire", "%s is using %d on %d.%d.%d.%d:%d\n", + gfire_buddy_get_name(p_buddy), p_buddy->voip_data.id, p_buddy->voip_data.ip.octets[3], + p_buddy->voip_data.ip.octets[2], p_buddy->voip_data.ip.octets[1], + p_buddy->voip_data.ip.octets[0], p_buddy->voip_data.port); +} + +gboolean gfire_buddy_is_playing(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + return (p_buddy->game_data.id > 0); +} + +gboolean gfire_buddy_is_talking(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + return (p_buddy->voip_data.id > 0); +} + +const gfire_game_data *gfire_buddy_get_game_data(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return NULL; + + return &p_buddy->game_data; +} + +const GList *gfire_buddy_get_game_client_data(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return NULL; + + return p_buddy->game_client_data; +} + +const gfire_game_data *gfire_buddy_get_voip_data(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return NULL; + + return &p_buddy->voip_data; +} + +gboolean gfire_buddy_is_available(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + return p_buddy->status == PURPLE_STATUS_AVAILABLE; +} + +gboolean gfire_buddy_is_away(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + return p_buddy->status == PURPLE_STATUS_AWAY; +} + +gboolean gfire_buddy_is_busy(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + return p_buddy->status == PURPLE_STATUS_UNAVAILABLE; +} + +void gfire_buddy_request_info(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return; + + GTimeVal gtv; + g_get_current_time(>v); + + if((gtv.tv_sec - p_buddy->get_info_block) > 300) + p_buddy->get_info_block = gtv.tv_sec; + else + return; + + purple_debug_misc("gfire", "requesting advanced info for %s\n", gfire_buddy_get_name(p_buddy)); + // Request advanced infoview + guint16 len = gfire_buddy_proto_create_advanced_info_request(p_buddy->userid); + if(len > 0) gfire_send(p_buddy->gc, len); +} + +gboolean gfire_buddy_got_info(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + return p_buddy->got_info; +} + +gboolean gfire_buddy_is_online(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return FALSE; + + // Create offline ID + guint8 offline_id[XFIRE_SID_LEN]; + memset(offline_id, 0, XFIRE_SID_LEN); + + return (memcmp(p_buddy->sid, offline_id, XFIRE_SID_LEN) != 0); +} + +gboolean gfire_buddy_is_clan_member_of(const gfire_buddy *p_buddy, guint32 p_clanid) +{ + if(!p_buddy) + return FALSE; + + GList *cur_data = p_buddy->clan_data; + while(cur_data) + { + if(gfire_clan_is(((gfire_buddy_clan_data*)cur_data->data)->clan, p_clanid)) + return TRUE; + + cur_data = g_list_next(cur_data); + } + + return FALSE; +} + +void gfire_buddy_set_alias(gfire_buddy *p_buddy, const gchar *p_alias) +{ + if(!p_buddy || !p_alias) + return; + + if(p_buddy->alias) g_free(p_buddy->alias); + + if(strlen(p_alias) == 0) + p_buddy->alias = NULL; + else + { + p_buddy->alias = g_strdup(p_alias); + gfire_strip_invalid_utf8(p_buddy->alias); + gfire_strip_character_range(p_buddy->alias, 0x01, 0x1F); + } + + if(p_buddy->prpl_buddy && + !(gfire_buddy_is_clan_member(p_buddy) && + gfire_buddy_get_default_clan_data(p_buddy) && + gfire_buddy_get_default_clan_data(p_buddy)->clan_alias)) + serv_got_alias(purple_account_get_connection(purple_buddy_get_account(p_buddy->prpl_buddy)), p_buddy->name, p_buddy->alias); +} + +const gchar *gfire_buddy_get_alias(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return NULL; + + if(gfire_buddy_is_clan_member(p_buddy) && + gfire_buddy_get_default_clan_data(p_buddy) && + gfire_buddy_get_default_clan_data(p_buddy)->clan_alias) + return gfire_buddy_get_default_clan_data(p_buddy)->clan_alias; + + if(p_buddy->alias) + return p_buddy->alias; + else + return p_buddy->name; +} + +const gchar *gfire_buddy_get_name(const gfire_buddy *p_buddy) +{ + if(!p_buddy) + return NULL; + + return p_buddy->name; +} + +void gfire_buddy_set_status(gfire_buddy *p_buddy, const gchar *p_status_msg) +{ + if(!p_buddy) + return; + + if(p_buddy->status_msg) g_free(p_buddy->status_msg); + if(p_status_msg) + { + gchar *status_msg = g_strdup(p_status_msg); + gfire_strip_invalid_utf8(status_msg); + + if((strncmp(status_msg, "(AFK) ", 6) == 0) || (strncmp(status_msg, "(ABS) ", 6) == 0)) + { + p_buddy->status = PURPLE_STATUS_AWAY; + p_buddy->status_msg = g_strdup(status_msg + 6); + } + else if(strncmp(status_msg, "(Busy) ", 7) == 0) + { + p_buddy->status = PURPLE_STATUS_UNAVAILABLE; + p_buddy->status_msg = g_strdup(status_msg + 7); + } + else + { + p_buddy->status = PURPLE_STATUS_AVAILABLE; + p_buddy->status_msg = g_strdup(status_msg); + } + g_free(status_msg); + + g_strchomp(g_strchug(p_buddy->status_msg)); + if(strlen(p_buddy->status_msg) == 0) + { + g_free(p_buddy->status_msg); + p_buddy->status_msg = NULL; + } + } + else + { + p_buddy->status = PURPLE_STATUS_AVAILABLE; + p_buddy->status_msg = NULL; + } + + gfire_buddy_update_status(p_buddy); +} + +gchar *gfire_buddy_get_status_text(const gfire_buddy *p_buddy, gboolean p_nogame) +{ + if(!p_buddy) + return NULL; + + if(gfire_buddy_is_playing(p_buddy) && !p_nogame) + { + gchar *tmp = gfire_game_name(p_buddy->game_data.id, FALSE); + gchar *ret = p_buddy->status_msg ? g_strdup_printf(_("Playing %s - %s"), tmp, p_buddy->status_msg) : + g_strdup_printf(_("Playing %s"), tmp); + g_free(tmp); + return ret; + } + else if(p_buddy->status_msg) + return g_strdup(p_buddy->status_msg); + else + return NULL; +} + +const gchar *gfire_buddy_get_status_name(const gfire_buddy *p_buddy) +{ + return purple_primitive_get_name_from_type(p_buddy->status); +} + +void gfire_buddy_set_avatar(gfire_buddy *p_buddy, guchar *p_data, guint32 p_len) +{ + if(!p_buddy || !p_data) + return; + else if(!p_len || !p_buddy->prpl_buddy) + { + g_free(p_data); + return; + } + + PurpleBuddyIcon *icon = purple_buddy_get_icon(p_buddy->prpl_buddy); + if(!icon) + purple_buddy_icon_new(p_buddy->prpl_buddy->account, p_buddy->name, p_data, p_len, NULL); + else + purple_buddy_icon_set_data(icon, p_data, p_len, NULL); +} + +static void gfire_buddy_avatar_download_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const char *p_buf, gsize p_len, const gchar *p_error_message) +{ + guchar *temp = NULL; + + if (p_data == NULL || p_buf == NULL || p_len == 0) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_avatar_download_cb: download of avatar failed (%s)\n", NN(p_error_message)); + return; + } + + temp = g_malloc0(p_len); + memcpy(temp, p_buf, p_len); + + gfire_buddy_set_avatar((gfire_buddy*)p_data, temp, p_len); +} + +void gfire_buddy_download_avatar(gfire_buddy *p_buddy, guint32 p_type, guint32 p_avatarNum) +{ + if(!p_buddy || !p_buddy->prpl_buddy) + return; + + p_buddy->got_info = TRUE; + + gchar *avatar_url = NULL; + PurpleBuddyIcon *buddy_icon = NULL; + + if(p_type == p_buddy->avatartype && p_avatarNum == p_buddy->avatarnumber) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "gfire_buddy_proto_changed_avatar: avatar did not change. skipping download.\n"); + return; + } + + switch(p_type) + { + case 1: + avatar_url = g_strdup_printf(XFIRE_GALLERY_AVATAR_URL, p_avatarNum); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "trying to download avatar from: %s\n", NN(avatar_url)); + purple_util_fetch_url(avatar_url, TRUE, "Purple-xfire", TRUE, gfire_buddy_avatar_download_cb, (void*)p_buddy); + g_free(avatar_url); + + purple_blist_node_set_int(&p_buddy->prpl_buddy->node, "avatartype", p_type); + purple_blist_node_set_int(&p_buddy->prpl_buddy->node, "avatarnumber", p_avatarNum); + break; + case 2: + avatar_url = g_strdup_printf(XFIRE_AVATAR_URL, p_buddy->name, p_avatarNum); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "trying to download avatar from: %s\n", NN(avatar_url)); + purple_util_fetch_url(avatar_url, TRUE, "Purple-xfire", TRUE, gfire_buddy_avatar_download_cb, (void*)p_buddy); + g_free(avatar_url); + + purple_blist_node_set_int(&p_buddy->prpl_buddy->node, "avatartype", p_type); + purple_blist_node_set_int(&p_buddy->prpl_buddy->node, "avatarnumber", p_avatarNum); + break; + default: + buddy_icon = purple_buddy_get_icon(p_buddy->prpl_buddy); + if(buddy_icon != NULL) + { + purple_debug(PURPLE_DEBUG_INFO, "gfire", "removing %s's avatar\n", gfire_buddy_get_name(p_buddy)); + purple_buddy_icon_set_data(buddy_icon, NULL, 0, NULL); + } + else + purple_debug(PURPLE_DEBUG_INFO, "gfire", "%s has no avatar\n", gfire_buddy_get_name(p_buddy)); + + purple_blist_node_remove_setting(&p_buddy->prpl_buddy->node, "avatartype"); + purple_blist_node_remove_setting(&p_buddy->prpl_buddy->node, "avatarnumber"); + break; + } + + p_buddy->avatartype = p_type; + p_buddy->avatarnumber = p_avatarNum; +} + +void gfire_buddy_add_to_clan(gfire_buddy *p_buddy, gfire_clan *p_clan, const gchar *p_clanalias, gboolean p_default) +{ + if(!p_buddy || !p_clan) + return; + + if(gfire_buddy_is_clan_member_of(p_buddy, p_clan->id)) + return; + + if(p_default && gfire_buddy_get_default_clan_data(p_buddy)) + p_default = FALSE; + + gfire_buddy_clan_data *clan_data = gfire_buddy_clan_data_create(p_clan, p_clanalias, p_default); + + if(clan_data) + { + p_buddy->clan_data = g_list_append(p_buddy->clan_data, clan_data); + if(p_buddy->prpl_buddy && gfire_buddy_is_clan_member(p_buddy) && p_default) + serv_got_alias(purple_account_get_connection(purple_buddy_get_account(p_buddy->prpl_buddy)), gfire_buddy_get_name(p_buddy), clan_data->clan_alias); + } +} + +void gfire_buddy_set_clan_alias(gfire_buddy *p_buddy, guint32 p_clanid, const gchar *p_alias) +{ + if(p_buddy) + return; + + if(gfire_buddy_is_clan_member_of(p_buddy, p_clanid)) + { + GList *cur = p_buddy->clan_data; + for(; cur; cur = g_list_next(cur)) + { + if(((gfire_buddy_clan_data*)cur->data)->clan->id == p_clanid) + { + if(((gfire_buddy_clan_data*)cur->data)->clan_alias) + g_free(((gfire_buddy_clan_data*)cur->data)->clan_alias); + ((gfire_buddy_clan_data*)cur->data)->clan_alias = NULL; + + if(p_alias) + ((gfire_buddy_clan_data*)cur->data)->clan_alias = g_strdup(p_alias); + + break; + } + } + + if(gfire_buddy_is_clan_member(p_buddy) && p_buddy->prpl_buddy && cur && ((gfire_buddy_clan_data*)cur->data)->is_default) + serv_got_alias(purple_account_get_connection(purple_buddy_get_account(p_buddy->prpl_buddy)), gfire_buddy_get_name(p_buddy), ((gfire_buddy_clan_data*)cur->data)->clan_alias); + } +} + +void gfire_buddy_remove_clan(gfire_buddy *p_buddy, guint32 p_clanid, guint32 p_newdefault) +{ + if(!p_buddy) + return; + + if(!gfire_buddy_is_clan_member_of(p_buddy, p_clanid)) + return; + + GList *cur = p_buddy->clan_data; + for(; cur; cur = g_list_next(cur)) + { + if(gfire_clan_is(((gfire_buddy_clan_data*)cur->data)->clan, p_clanid)) + { + gfire_buddy_clan_data_free((gfire_buddy_clan_data*)cur->data); + p_buddy->clan_data = g_list_delete_link(p_buddy->clan_data, cur); + break; + } + } + + // Move buddy to new shared clan + if(gfire_buddy_is_clan_member(p_buddy) && !gfire_buddy_get_default_clan_data(p_buddy)) + { + purple_blist_remove_buddy(p_buddy->prpl_buddy); + + if(!gfire_buddy_is_clan_member_of(p_buddy, p_newdefault)) + { + p_buddy->prpl_buddy = NULL; + return; + } + + cur = p_buddy->clan_data; + for(; cur; cur = g_list_next(cur)) + { + if(gfire_clan_is(((gfire_buddy_clan_data*)cur->data)->clan, p_clanid)) + { + ((gfire_buddy_clan_data*)cur->data)->is_default = TRUE; + break; + } + } + + purple_blist_add_buddy(p_buddy->prpl_buddy, NULL, gfire_clan_get_prpl_group(((gfire_buddy_clan_data*)cur->data)->clan), NULL); + } +} + +void gfire_buddy_make_friend(gfire_buddy *p_buddy, gfire_group *p_group) +{ + if(!p_buddy || gfire_buddy_is_friend(p_buddy)) + return; + + // Move the buddy to the selected group + if(p_buddy->prpl_buddy) + { + // Only move the buddy if it is in the clan/fof group + PurpleGroup *old_group = purple_buddy_get_group(p_buddy->prpl_buddy); + gfire_buddy_clan_data *clan_data = gfire_buddy_get_default_clan_data(p_buddy); + if((clan_data && gfire_clan_is(clan_data->clan, purple_blist_node_get_int((PurpleBlistNode*)old_group, "clanid"))) || + purple_find_buddy_in_group(purple_connection_get_account(p_buddy->gc), gfire_buddy_get_name(p_buddy), purple_find_group(GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME))) + { + PurpleGroup *group = NULL; + if(!p_group) + { + group = purple_find_group(GFIRE_DEFAULT_GROUP_NAME); + if(!group) + { + group = purple_group_new(GFIRE_DEFAULT_GROUP_NAME); + purple_blist_add_group(group, NULL); + } + } + else + group = gfire_group_get_group(p_group); + + purple_blist_add_buddy(p_buddy->prpl_buddy, NULL, group, NULL); + purple_blist_node_remove_setting((PurpleBlistNode*)p_buddy->prpl_buddy, "clanmember"); + purple_blist_node_set_flags((PurpleBlistNode*)p_buddy->prpl_buddy, 0); + } + } + + if(gfire_buddy_is_clan_member(p_buddy) && p_buddy->clan_data) + ((gfire_buddy_clan_data*)p_buddy->clan_data->data)->is_default = FALSE; + + p_buddy->type = GFBT_FRIEND; +} + +void gfire_buddy_set_common_buddies(gfire_buddy *p_buddy, GList *p_buddies) +{ + if(!p_buddy || !gfire_buddy_is_friend_of_friend(p_buddy)) + return; + + p_buddy->got_info = TRUE; + + if(p_buddy->common_buddies) gfire_list_clear(p_buddy->common_buddies); + p_buddy->common_buddies = p_buddies; +} + +gchar *gfire_buddy_get_common_buddies_str(const gfire_buddy *p_buddy) +{ + if(!p_buddy || !gfire_buddy_is_friend_of_friend(p_buddy) || !p_buddy->common_buddies) + return NULL; + + GString *str = g_string_new(""); + + GList *cur = p_buddy->common_buddies; + for(; cur; cur = g_list_next(cur)) + { + if(cur != p_buddy->common_buddies) + g_string_append_printf(str, ", %s", (gchar*)cur->data); + else + g_string_append(str, (gchar*)cur->data); + } + + return g_string_free(str, FALSE); +} + +gboolean gfire_buddy_has_p2p(const gfire_buddy *p_buddy) +{ + return (p_buddy && p_buddy->gc && !gfire_is_self(p_buddy->gc->proto_data, p_buddy->userid) && + (gfire_buddy_is_friend(p_buddy) || gfire_buddy_is_clan_member(p_buddy)) && + (p_buddy->hasP2P == GFP2P_YES || p_buddy->hasP2P == GFP2P_UNKNOWN)); +} + +gboolean gfire_buddy_uses_p2p(const gfire_buddy *p_buddy) +{ + return (p_buddy && p_buddy->p2p && gfire_p2p_session_connected(p_buddy->p2p)); +} + +static gboolean gfire_buddy_p2p_request_timed_out(gpointer p_data) { + gfire_buddy *buddy = (gfire_buddy*)p_data; + + purple_debug_misc("gfire", "P2P request timed out\n"); + + gfire_p2p_connection_remove_session(gfire_get_p2p(buddy->gc->proto_data), buddy->p2p); + gfire_p2p_session_free(buddy->p2p, FALSE); + buddy->p2p = NULL; + buddy->p2p_request_timeout = 0; + + return FALSE; +} + +void gfire_buddy_request_p2p(gfire_buddy *p_buddy, gboolean p_notify) +{ + if(!p_buddy || p_buddy->p2p) + return; + + if(!gfire_has_p2p(p_buddy->gc->proto_data)) + return; + + gfire_p2p_connection *p2p_con = gfire_get_p2p(p_buddy->gc->proto_data); + + purple_debug_info("gfire", "Sending P2P request to buddy %s...\n", gfire_buddy_get_name(p_buddy)); + + // Generate random salt + gchar *salt = g_malloc0(41); + gchar *random_str = g_strdup_printf("%d", rand()); + hashSha1(random_str, salt); + + // Send P2P data request + guint16 len = gfire_buddy_proto_create_p2p(p_buddy->sid, gfire_p2p_connection_ip(p2p_con), + gfire_p2p_connection_port(p2p_con), + gfire_p2p_connection_local_ip(p2p_con), + gfire_p2p_connection_local_port(p2p_con), + gfire_p2p_connection_natType(p2p_con), salt); + if(len > 0) + { + gfire_send(p_buddy->gc, len); + p_buddy->p2p_requested = TRUE; + + p_buddy->p2p = gfire_p2p_session_create(p_buddy, salt); + gfire_p2p_connection_add_session(p2p_con, p_buddy->p2p); + + p_buddy->p2p_request_timeout = purple_timeout_add_seconds(15, (GSourceFunc)gfire_buddy_p2p_request_timed_out, + p_buddy); + } + + if(p_buddy->hasP2P == GFP2P_UNKNOWN) + p_buddy->p2p_notify = p_notify; + + g_free(salt); + g_free(random_str); +} + +void gfire_buddy_got_p2p_data(gfire_buddy *p_buddy, guint32 p_ip, guint16 p_port, guint32 p_localip, guint16 p_localport, guint32 p_natType, const gchar *p_salt) +{ + if(!p_buddy || !p_salt) + return; + + if(p_buddy->p2p && gfire_p2p_session_connected(p_buddy->p2p)) + { + purple_debug_misc("gfire", "Received P2P information, but we're already connected\n"); + return; + } + + GString *debug_str = g_string_new("Received P2P information, "); + + p_buddy->p2p_notify = FALSE; + + if(gfire_has_p2p(p_buddy->gc->proto_data)) + { + gfire_p2p_connection *p2p_con = gfire_get_p2p(p_buddy->gc->proto_data); + + if(p_natType == 1 || + ((p_natType == 2 || p_natType == 3) && gfire_p2p_connection_natType(p2p_con) == 1) || + (p_natType == 4 && (gfire_p2p_connection_natType(p2p_con) == 1 || gfire_p2p_connection_natType(p2p_con) == 4))) + { + if(!p_buddy->p2p) + { + p_buddy->p2p = gfire_p2p_session_create(p_buddy, p_salt); + gfire_p2p_connection_add_session(p2p_con, p_buddy->p2p); + } + p_buddy->hasP2P = GFP2P_YES; + + gfire_p2p_session_set_addr(p_buddy->p2p, GF_P2P_ADDR_TYPE_LOCAL, p_localip, p_localport); + gfire_p2p_session_set_addr(p_buddy->p2p, GF_P2P_ADDR_TYPE_EXTERN, p_ip, p_port); + + g_string_append(debug_str, "compatible buddy"); + + gfire_p2p_session_start(p_buddy->p2p, p_natType); + } + else + { + if(p_buddy->p2p) + { + gfire_p2p_connection_remove_session(p2p_con, p_buddy->p2p); + gfire_p2p_session_free(p_buddy->p2p, FALSE); + p_buddy->p2p = NULL; + } + p_buddy->hasP2P = GFP2P_NO; + + g_string_append(debug_str, "incompatible buddy"); + } + + if(p_buddy->p2p_requested) + { + p_buddy->p2p_requested = FALSE; + purple_timeout_remove(p_buddy->p2p_request_timeout); + p_buddy->p2p_request_timeout = 0; + } + else + { + guint16 len = gfire_buddy_proto_create_p2p(p_buddy->sid, gfire_p2p_connection_ip(p2p_con), + gfire_p2p_connection_port(p2p_con), + gfire_p2p_connection_local_ip(p2p_con), + gfire_p2p_connection_local_port(p2p_con), + gfire_p2p_connection_natType(p2p_con), p_salt); + if(len > 0) gfire_send(p_buddy->gc, len); + } + } + else + { + guint16 len = gfire_buddy_proto_create_p2p(p_buddy->sid, 0, 0, 0, 0, 0, p_salt); + if(len > 0) gfire_send(p_buddy->gc, len); + + g_string_append(debug_str, "request denied"); + } + + purple_debug_misc("gfire", "%s\n", debug_str->str); + g_string_free(debug_str, TRUE); +} + +void gfire_buddy_p2p_timedout(gfire_buddy *p_buddy) +{ + if(p_buddy && p_buddy->p2p) + { + gfire_p2p_connection_remove_session(gfire_get_p2p(p_buddy->gc->proto_data), p_buddy->p2p); + gfire_p2p_session_free(p_buddy->p2p, FALSE); + p_buddy->p2p = NULL; + } +} + +void gfire_buddy_p2p_uncapable(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return; + + purple_debug_info("gfire", "Buddy %s is unable to use P2P.\n", gfire_buddy_get_name(p_buddy)); + + p_buddy->hasP2P = GFP2P_NO; + + if(p_buddy->p2p) + { + gfire_p2p_connection_remove_session(gfire_get_p2p(p_buddy->gc->proto_data), p_buddy->p2p); + gfire_p2p_session_free(p_buddy->p2p, FALSE); + p_buddy->p2p = NULL; + } + + if(p_buddy->p2p_notify) + { + p_buddy->p2p_notify = FALSE; + purple_notify_message(p_buddy->gc, PURPLE_NOTIFY_MSG_ERROR, _("P2P Connection not possible"), _("P2P Connection not possible"), _("We're not able to establish a connection to your buddy. File transfer and P2P messaging will not be possible."), NULL, NULL); + } +} + +void gfire_buddy_p2p_connected(gfire_buddy *p_buddy) +{ + if(!p_buddy) + return; + + purple_debug_info("gfire", "P2P connected with buddy %s\n", gfire_buddy_get_name(p_buddy)); + + p_buddy->hasP2P = GFP2P_YES; + p_buddy->p2p_notify = FALSE; + + p_buddy->p2p_requested = FALSE; + if(p_buddy->p2p_request_timeout) + { + purple_timeout_remove(p_buddy->p2p_request_timeout); + p_buddy->p2p_request_timeout = 0; + } +} + +void gfire_buddy_p2p_ft_init(PurpleXfer *p_xfer) +{ + if(!p_xfer) + return; + + gfire_buddy *gf_buddy = p_xfer->data; + if(!gf_buddy->p2p) + { + purple_xfer_cancel_local(p_xfer); + return; + } + + gfire_p2p_session_add_file_transfer(gf_buddy->p2p, p_xfer); +} + +static void gfire_clan_avatar_download_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, + const char *p_buf, gsize p_len, const gchar *p_error_message) +{ + guchar *temp = NULL; + + if (p_data == NULL || p_buf == NULL || p_len == 0) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_clan_avatar_download_cb: download of avatar failed (%s)\n", + NN(p_error_message)); + return; + } + + temp = g_malloc0(p_len); + memcpy(temp, p_buf, p_len); + purple_buddy_icons_node_set_custom_icon(PURPLE_BLIST_NODE(((gfire_clan*)p_data)->prpl_group), temp, p_len); +} + +static void gfire_clan_download_avatar(gfire_clan *p_clan) +{ + if(!p_clan || !p_clan->prpl_group || !p_clan->short_name) + return; + + gchar *avatar_url = g_strdup_printf(XFIRE_COMMUNITY_AVATAR_URL, p_clan->short_name, rand()); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "trying to download community avatar from: %s\n", NN(avatar_url)); + purple_util_fetch_url(avatar_url, TRUE, "Purple-xfire", TRUE, gfire_clan_avatar_download_cb, (void*)p_clan); + g_free(avatar_url); +} + +static void gfire_clan_create_group(gfire_clan *p_clan) +{ + if(!p_clan || !p_clan->long_name || p_clan->prpl_group) + return; + + gchar *clan_group_name = NULL; + if(p_clan->short_name) + clan_group_name = g_strdup_printf(GFIRE_CLAN_GROUP_FORMATTING, p_clan->long_name, p_clan->short_name); + else + clan_group_name = g_strdup(p_clan->long_name); + + if(!clan_group_name) + return; + + p_clan->prpl_group = purple_group_new(clan_group_name); + g_free(clan_group_name); + + purple_blist_add_group(p_clan->prpl_group, NULL); + purple_blist_node_set_int(&p_clan->prpl_group->node, "clanid", p_clan->id); +} + +void gfire_clan_prpl_remove(gfire_clan *p_clan) +{ + if(!p_clan || !p_clan->prpl_group) + return; + + purple_blist_remove_group(p_clan->prpl_group); + + p_clan->prpl_group = 0; +} + +gfire_clan *gfire_clan_create(guint32 p_clanid, const gchar *p_longName, const gchar *p_shortName, gboolean p_createGroup) +{ + gfire_clan *ret = g_malloc0(sizeof(gfire_clan)); + if(!ret) + goto error; + + ret->id = p_clanid; + + if(p_longName) + { + ret->long_name = g_strdup(p_longName); + if(!ret->long_name) + { + gfire_clan_free(ret); + goto error; + } + } + + if(p_shortName) + { + ret->short_name = g_strdup(p_shortName); + if(!ret->short_name) + { + gfire_clan_free(ret); + goto error; + } + } + + if(p_createGroup) + gfire_clan_create_group(ret); + + return ret; + +error: + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_clan_create: Out of memory!\n"); + return NULL; +} + +void gfire_clan_free(gfire_clan *p_clan) +{ + if(!p_clan) + return; + + if(p_clan->long_name) g_free(p_clan->long_name); + if(p_clan->short_name) g_free(p_clan->short_name); + + g_free(p_clan); +} + +void gfire_clan_set_names(gfire_clan *p_clan, const gchar *p_longName, const gchar *p_shortName) +{ + if(!p_clan) + return; + + if(p_longName) + { + if(p_clan->long_name) g_free(p_clan->long_name); + p_clan->long_name = g_strdup(p_longName); + } + + if(p_shortName) + { + if(p_clan->short_name) g_free(p_clan->short_name); + p_clan->short_name = g_strdup(p_shortName); + } + + if(p_clan->prpl_group) + { + gchar *clan_group_name = NULL; + if(p_clan->short_name) + clan_group_name = g_strdup_printf(GFIRE_CLAN_GROUP_FORMATTING, p_clan->long_name, p_clan->short_name); + else + clan_group_name = g_strdup(p_clan->long_name); + + if(!clan_group_name) + return; + + purple_blist_rename_group(p_clan->prpl_group, clan_group_name); + g_free(clan_group_name); + + gfire_clan_download_avatar(p_clan); + } +} + +const gchar *gfire_clan_get_long_name(const gfire_clan *p_clan) +{ + if(!p_clan) + return NULL; + + return p_clan->long_name; +} + +const gchar *gfire_clan_get_short_name(const gfire_clan *p_clan) +{ + if(!p_clan) + return NULL; + + return p_clan->short_name; +} + +gchar *gfire_clan_get_name(const gfire_clan *p_clan) +{ + if(!p_clan) + return NULL; + + if(p_clan->short_name) + return g_strdup_printf("%s [%s]", p_clan->long_name, p_clan->short_name); + else + return g_strdup(p_clan->long_name); +} + +void gfire_clan_set_prpl_group(gfire_clan *p_clan, PurpleGroup *p_group) +{ + if(!p_clan) + return; + + p_clan->prpl_group = p_group; + + if(p_group) + gfire_clan_download_avatar(p_clan); +} + +PurpleGroup *gfire_clan_get_prpl_group(gfire_clan *p_clan) +{ + if(!p_clan) + return NULL; + + if(!p_clan->prpl_group) + gfire_clan_create_group(p_clan); + + return p_clan->prpl_group; +} + +gboolean gfire_clan_is(const gfire_clan *p_clan, guint32 p_clanid) +{ + if(!p_clan) + return FALSE; + + return (p_clan->id == p_clanid); +} + +GList *gfire_clan_get_existing() +{ + GList *ret = NULL; + PurpleBlistNode *group_node = NULL; + + group_node = purple_blist_get_root(); + + // Get first node of type group + while(group_node && !PURPLE_BLIST_NODE_IS_GROUP(group_node)) + group_node = purple_blist_node_get_first_child(group_node); + + // Check for clan group nodes + while(group_node) + { + if(purple_blist_node_get_int(group_node, "clanid")) + { + // Create the clan and add it to the list + gfire_clan *clan = gfire_clan_create(purple_blist_node_get_int(group_node, "clanid"), NULL, NULL, FALSE); + if(clan) + { + gfire_clan_set_prpl_group(clan, (PurpleGroup*)group_node); + ret = g_list_append(ret, clan); + } + } + + group_node = purple_blist_node_get_sibling_next(group_node); + } + + return ret; +} + +void gfire_clan_check_for_left_members(gfire_clan *p_clan, gfire_data *p_gfire) +{ + if(!p_clan || !p_clan->prpl_group || !p_gfire) + return; + + PurpleBlistNode *contact_buddy_node = purple_blist_node_get_first_child(PURPLE_BLIST_NODE(p_clan->prpl_group)); + if(!contact_buddy_node) + return; + + PurpleBlistNode *buddy_node = NULL; + + while(contact_buddy_node) + { + gboolean in_contact = FALSE; + // No buddy and no contact + if(!PURPLE_BLIST_NODE_IS_BUDDY(contact_buddy_node) && !PURPLE_BLIST_NODE_IS_CONTACT(contact_buddy_node)) + { + contact_buddy_node = purple_blist_node_get_sibling_next(contact_buddy_node); + continue; + } + // A contact, check the buddies inside of it + else if(PURPLE_BLIST_NODE_IS_CONTACT(contact_buddy_node)) + { + in_contact = TRUE; + buddy_node = purple_blist_node_get_first_child(contact_buddy_node); + + if(!buddy_node) + continue; + } + // A buddy, check it + else + buddy_node = contact_buddy_node; + + gboolean removed = FALSE; + + do + { + gboolean found = FALSE; + PurpleBuddy *pbuddy = PURPLE_BUDDY(buddy_node); + + // Only check buddies of the current account + if(purple_buddy_get_account(pbuddy) != purple_connection_get_account(gfire_get_connection(p_gfire))) + continue; + + // Search the PurpleBuddy in all registered buddies + GList *buddies = p_gfire->buddies; + while(buddies) + { + // Invalid buddy + if(!buddies->data) + { + buddies = g_list_next(buddies); + continue; + } + + // Compare the names + gfire_buddy *gf_buddy = (gfire_buddy*)buddies->data; + if(g_strcmp0(gf_buddy->name, purple_buddy_get_name(pbuddy)) == 0) + { + found = TRUE; + break; + } + + buddies = g_list_next(buddies); + } + + // Delete the buddy if we couldn't find him + if(!found) + { + purple_debug(PURPLE_DEBUG_INFO, "gfire", "%s seems to have left his clan, removing buddy\n", purple_buddy_get_name(pbuddy)); + + // Get the next node before we delete the current one + if(in_contact) + { + buddy_node = purple_blist_node_get_sibling_next(buddy_node); + if(!buddy_node) + // The contact will also be removed, so get the next one + contact_buddy_node = purple_blist_node_get_sibling_next(contact_buddy_node); + } + else + contact_buddy_node = purple_blist_node_get_sibling_next(contact_buddy_node); + + purple_blist_remove_buddy(pbuddy); + + removed = TRUE; + } + + // Repeat if we're in a contact, to check all buddies of it + } while(in_contact && ((removed && buddy_node) || + (!removed && (buddy_node = purple_blist_node_get_sibling_next(buddy_node))))); + if(!removed) + contact_buddy_node = purple_blist_node_get_sibling_next(contact_buddy_node); + } +} + +fof_game_data *gfire_fof_game_data_create(const guint8 *p_sid, guint32 p_game, guint32 p_ip, guint16 p_port) +{ + if(!p_sid) + return NULL; + + fof_game_data *ret = g_malloc0(sizeof(fof_game_data)); + if(!ret) + goto error; + + ret->sid = g_malloc0(XFIRE_SID_LEN); + if(!ret->sid) + goto error; + + memcpy(ret->sid, p_sid, XFIRE_SID_LEN); + + ret->game.id = p_game; + ret->game.ip.value = p_ip; + ret->game.port = p_port; + + return ret; + +error: + if(ret) g_free(ret); + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_fof_game_data_create: Out of memory!\n"); + return NULL; +} + +void gfire_fof_game_data_free(fof_game_data *p_data) +{ + if(!p_data) + return; + + if(p_data->sid) g_free(p_data->sid); + while(p_data->gcd) + { + gfire_game_client_data_free(p_data->gcd->data); + p_data->gcd = g_list_delete_link(p_data->gcd, p_data->gcd); + } + g_free(p_data); +} diff -Nru gfire-0.8.3/src/gf_buddies.h gfire-0.9.4/src/gf_buddies.h --- gfire-0.8.3/src/gf_buddies.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_buddies.h 2011-03-14 20:26:18.000000000 +0000 @@ -0,0 +1,271 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_BUDDIES_H +#define _GF_BUDDIES_H + +typedef struct _gfire_buddy gfire_buddy; +typedef struct _gfire_clan gfire_clan; + +#include "gf_base.h" +#include "gfire.h" +#include "gf_games.h" +#include "gf_p2p_session.h" +#include "gf_groups.h" + +// Stores information about all clans this gfire session has to handle with +struct _gfire_clan +{ + guint32 id; // Clan ID + gchar *long_name; // Long Clan Name, e.g. "Gfire - Linux and Co Users" + gchar *short_name; // Short Clan Name, e.g. "gfire" + PurpleGroup *prpl_group; // Purple Buddy List Group + gboolean got_first_list; // TRUE if the initializing buddy list has been received +}; + +// Enum with all possible buddy types +typedef enum _gfire_buddy_type +{ + GFBT_FRIEND = 0, + GFBT_CLAN, + GFBT_GROUPCHAT, + GFBT_FRIEND_OF_FRIEND +} gfire_buddy_type; + +// Stores a buddy's clan information +typedef struct _gfire_buddy_clan_data +{ + gfire_clan *clan; + gchar *clan_alias; + gboolean is_default; +} gfire_buddy_clan_data; + +// Stores game client info (belonging to Xfire SDK) +typedef struct _game_client_data +{ + gchar *key; + gchar *value; +} game_client_data; + +// Stores a FoF buddies game data +typedef struct _fof_game_data +{ + guint8 *sid; + gfire_game_data game; + GList *gcd; +} fof_game_data; + +// Stores sent messages, which we haven't received an ack for +typedef struct _im_sent +{ + guint32 imindex; + gchar *msg; + glong time; +} im_sent; + +typedef enum _can_handle_p2p +{ + GFP2P_UNKNOWN, + GFP2P_YES, + GFP2P_NO +} can_handle_p2p; + +// Information about a gfire buddy +struct _gfire_buddy +{ + // Connection for sending + PurpleConnection *gc; + + // Xfire user data + guint32 userid; // user id + guint8 *sid; // session id, length = XFIRE_SID_LEN + gchar *name; // name (xfire login id) + gchar *alias; // nick (xfire alias) + + // Status data + PurpleStatusPrimitive status; + gchar *status_msg; // away message + + // Chat state + guint32 im; // im index ++'d on each im reception and send + GList *pending_ims; // List of im_sent structs + GList *pending_p2p_ims; // List of im_sent structs for P2P messages + guint lost_ims_timer; // Timer handle to check for lost IMs + guint lost_p2p_ims_timer; // Timer handle to check for lost P2P IMs + guint32 chatperm; // group chat permissions (only used for group chat members) + guint32 highest_im; // Highest received imindex + GList *missing_ims; // List of missing received imindex's + + // P2P + can_handle_p2p hasP2P; + gboolean p2p_requested; + guint p2p_request_timeout; + gboolean p2p_notify; + gfire_p2p_session *p2p; + + // Game data + gfire_game_data game_data; + GList *game_client_data; + + // VoIP data + gfire_game_data voip_data; + + // FoF common buddies + GList *common_buddies; + + // Got advanced info + glong get_info_block; + gboolean got_info; + + // Buddy type + GList *clan_data; // list of type gfire_buddy_clan_data + gfire_buddy_type type; // buddy type + + // Avatar data + guint32 avatarnumber; // xfire avatar reference number + guint32 avatartype; // xfire avatar type + + // Purple Buddy + PurpleBuddy *prpl_buddy; + +#ifdef USE_NOTIFICATIONS + glong creation_time; + gboolean show_game_status; +#endif // USE_NOTIFICATIONS +}; + +// GFIRE BUDDIES //////////////////////////////////////////////////// +// Creation and freeing +gfire_buddy *gfire_buddy_create(const guint32 p_userid, const gchar *p_name, const gchar *p_alias, gfire_buddy_type p_type); +void gfire_buddy_free(gfire_buddy *p_buddy); + +// Type checks +gboolean gfire_buddy_is_friend(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_clan_member(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_friend_of_friend(const gfire_buddy *p_buddy); + +// Identifying +gboolean gfire_buddy_is_by_userid(const gfire_buddy *p_buddy, guint32 p_userid); +gboolean gfire_buddy_is_by_sid(const gfire_buddy *p_buddy, const guint8 *p_sid); + +// IM handling +void gfire_buddy_send(gfire_buddy *p_buddy, const gchar *p_msg); +void gfire_buddy_send_nop2p(gfire_buddy *p_buddy, const gchar *p_msg, guint32 p_imindex); +void gfire_buddy_got_im(gfire_buddy *p_buddy, guint32 p_imindex, const gchar *p_msg, gboolean p_p2p); +void gfire_buddy_send_typing(gfire_buddy *p_buddy, gboolean p_typing); +void gfire_buddy_got_typing(const gfire_buddy *p_buddy, gboolean p_typing); +void gfire_buddy_got_im_ack(gfire_buddy *p_buddy, guint32 p_imindex); +gboolean gfire_buddy_check_pending_ims_cb(gfire_buddy *p_buddy); +gboolean gfire_buddy_check_pending_p2p_ims_cb(gfire_buddy *p_buddy); + +// PurpleBuddy creation/deletion +void gfire_buddy_prpl_add(gfire_buddy *p_buddy, gfire_group *p_group); +void gfire_buddy_prpl_remove(gfire_buddy *p_buddy); +void gfire_buddy_prpl_move(gfire_buddy *p_buddy, PurpleGroup *p_group); + +// Game/VoIP status +void gfire_buddy_set_game_status(gfire_buddy *p_buddy, guint32 p_id, guint32 p_port, guint32 p_ip); +void gfire_buddy_set_voip_status(gfire_buddy *p_buddy, guint32 p_id, guint32 p_port, guint32 p_ip); +void gfire_buddy_set_game_client_data(gfire_buddy *p_buddy, GList *p_data); +gboolean gfire_buddy_is_playing(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_talking(const gfire_buddy *p_buddy); +const gfire_game_data *gfire_buddy_get_game_data(const gfire_buddy *p_buddy); +const gfire_game_data *gfire_buddy_get_voip_data(const gfire_buddy *p_buddy); +const GList *gfire_buddy_get_game_client_data(const gfire_buddy *p_buddy); + +// Status handling +void gfire_buddy_set_session_id(gfire_buddy *p_buddy, const guint8 *p_sessionid); +void gfire_buddy_set_status(gfire_buddy *p_buddy, const gchar *p_status_msg); +gchar *gfire_buddy_get_status_text(const gfire_buddy *p_buddy, gboolean p_nogame); +const gchar *gfire_buddy_get_status_name(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_available(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_away(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_busy(const gfire_buddy *p_buddy); +gboolean gfire_buddy_is_online(const gfire_buddy *p_buddy); + +// Extended info +void gfire_buddy_request_info(gfire_buddy *p_buddy); +gboolean gfire_buddy_got_info(const gfire_buddy *p_buddy); + +// Clan membership handling +gboolean gfire_buddy_is_clan_member_of(const gfire_buddy *p_buddy, guint32 p_clanid); +void gfire_buddy_add_to_clan(gfire_buddy *p_buddy, gfire_clan *p_clan, const gchar *p_clanalias, gboolean p_default); +void gfire_buddy_remove_clan(gfire_buddy *p_buddy, guint32 p_clanid, guint32 p_newdefault); +void gfire_buddy_set_clan_alias(gfire_buddy *p_buddy, guint32 p_clanid, const gchar *p_alias); +guint32 gfire_buddy_get_default_clan(gfire_buddy *p_buddy); +GList *gfire_buddy_get_clans_info(const gfire_buddy *p_buddy); +void gfire_buddy_make_friend(gfire_buddy *p_buddy, gfire_group *p_group); + +// FoF handling +void gfire_buddy_set_common_buddies(gfire_buddy *p_buddy, GList *p_buddies); +gchar *gfire_buddy_get_common_buddies_str(const gfire_buddy *p_buddy); + +// Appearance +void gfire_buddy_set_alias(gfire_buddy *p_buddy, const gchar *p_alias); +const gchar *gfire_buddy_get_alias(gfire_buddy *p_buddy); +const gchar *gfire_buddy_get_name(const gfire_buddy *p_buddy); +void gfire_buddy_set_avatar(gfire_buddy *p_buddy, guchar *p_data, guint32 p_len); +void gfire_buddy_download_avatar(gfire_buddy *p_buddy, guint32 p_type, guint32 p_avatarNum); + +// P2P +gboolean gfire_buddy_has_p2p(const gfire_buddy *p_buddy); +gboolean gfire_buddy_uses_p2p(const gfire_buddy *p_buddy); +void gfire_buddy_request_p2p(gfire_buddy *p_buddy, gboolean p_notify); +void gfire_buddy_got_p2p_data(gfire_buddy *p_buddy, guint32 p_ip, guint16 p_port, guint32 p_localip, guint16 p_localport, guint32 p_natType, const gchar *p_salt); +void gfire_buddy_p2p_timedout(gfire_buddy *p_buddy); +void gfire_buddy_p2p_uncapable(gfire_buddy *p_buddy); +void gfire_buddy_p2p_connected(gfire_buddy *p_buddy); +void gfire_buddy_p2p_ft_init(PurpleXfer *p_xfer); + + +// GFIRE CLANS ////////////////////////////////////////////////////// +// Creation and freeing +gfire_clan *gfire_clan_create(guint32 p_clanid, const gchar *p_longName, const gchar *p_shortName, gboolean p_createGroup); +void gfire_clan_free(gfire_clan *p_clan); + +// Identifying +gboolean gfire_clan_is(const gfire_clan *p_clan, guint32 p_clanid); + +// External changes +void gfire_clan_set_prpl_group(gfire_clan *p_clan, PurpleGroup *p_group); +PurpleGroup *gfire_clan_get_prpl_group(gfire_clan *p_clan); +void gfire_clan_set_names(gfire_clan *p_clan, const gchar *p_longName, const gchar *p_shortName); +const gchar *gfire_clan_get_long_name(const gfire_clan *p_clan); +const gchar *gfire_clan_get_short_name(const gfire_clan *p_clan); +gchar *gfire_clan_get_name(const gfire_clan *p_clan); + +// PurpleGroup deletion +void gfire_clan_prpl_remove(gfire_clan *p_clan); + +// Initializing from Buddy List +GList *gfire_clan_get_existing(); + +// Buddy list cleanups +void gfire_clan_check_for_left_members(gfire_clan *p_clan, gfire_data *p_gfire); + +// FOF GAME DATA +fof_game_data *gfire_fof_game_data_create(const guint8 *p_sid, guint32 p_game, guint32 p_ip, guint16 p_port); +void gfire_fof_game_data_free(fof_game_data *p_data); + +// GAME CLIENT DATA +GList *gfire_game_client_data_parse(const gchar *p_datastring); + +#endif // _GF_BUDDIES_H diff -Nru gfire-0.8.3/src/gf_buddies_proto.c gfire-0.9.4/src/gf_buddies_proto.c --- gfire-0.8.3/src/gf_buddies_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_buddies_proto.c 2011-03-14 20:26:13.000000000 +0000 @@ -0,0 +1,1059 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_protocol.h" +#include "gf_network.h" +#include "gf_buddies.h" +#include "gf_buddies_proto.h" + +static GList *gfire_fof_data = NULL; + +guint16 gfire_buddy_proto_create_advanced_info_request(guint32 p_userid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // '01' + offset = gfire_proto_write_attr_bs(0x01, 0x02, &p_userid, sizeof(p_userid), offset); + + gfire_proto_write_header(offset, 0x25, 1, 0); + return offset; +} + +guint16 gfire_buddy_proto_create_typing_notification(const guint8 *p_sid, guint32 p_imindex, gboolean p_typing) +{ + if(!p_sid) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // "sid" + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + + // "peermsg" + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 3, offset); + + // "peermsg"->"msgtype" + guint32 msgtype = GUINT32_TO_LE(3); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + + // "peermsg"->"imindex" + p_imindex = GUINT32_TO_LE(p_imindex); + offset = gfire_proto_write_attr_ss("imindex", 0x02, &p_imindex, sizeof(p_imindex), offset); + + // "peermsg"->"typing" + guint32 typing = GUINT32_TO_LE(p_typing ? 1 : 0); + offset = gfire_proto_write_attr_ss("typing", 0x02, &typing, sizeof(typing), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + return offset; +} + +guint16 gfire_buddy_proto_create_send_im(const guint8 *p_sid, guint32 p_imindex, const gchar *p_msg) +{ + if(!p_sid || !p_msg) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 msgtype = GUINT32_TO_LE(0); + p_imindex = GUINT32_TO_LE(p_imindex); + + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 3, offset); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + offset = gfire_proto_write_attr_ss("imindex", 0x02, &p_imindex, sizeof(p_imindex), offset); + offset = gfire_proto_write_attr_ss("im", 0x01, p_msg, strlen(p_msg), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + + return offset; +} + +guint16 gfire_buddy_proto_create_fof_request(GList *p_sids) +{ + if(!p_sids) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_write_attr_list_ss("sid", p_sids, 0x03, XFIRE_SID_LEN, offset); + + gfire_proto_write_header(offset, 0x05, 1, 0); + + return offset; +} + +guint16 gfire_buddy_proto_create_ack(const guint8 *p_sid, guint32 p_imindex) +{ + if(!p_sid) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 msgtype = GUINT32_TO_LE(1); + p_imindex = GUINT32_TO_LE(p_imindex); + + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 2, offset); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + offset = gfire_proto_write_attr_ss("imindex", 0x02, &p_imindex, sizeof(p_imindex), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + + return offset; +} + +guint16 gfire_buddy_proto_create_p2p(const guint8 *p_sid, guint32 p_ip, guint16 p_port, guint32 p_local_ip, guint16 p_local_port, guint32 p_nat_type, const gchar *p_salt) +{ + if(!p_sid || !p_salt) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 msgtype = GUINT32_TO_LE(2); + + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 7, offset); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + + p_ip = GUINT32_TO_LE(p_ip); + offset = gfire_proto_write_attr_ss("ip", 0x02, &p_ip, sizeof(p_ip), offset); + + guint32 port = GUINT32_TO_LE(p_port); + offset = gfire_proto_write_attr_ss("port", 0x02, &port, sizeof(port), offset); + + p_local_ip = GUINT32_TO_LE(p_local_ip); + offset = gfire_proto_write_attr_ss("localip", 0x02, &p_local_ip, sizeof(p_local_ip), offset); + + guint32 local_port = GUINT32_TO_LE(p_local_port); + offset = gfire_proto_write_attr_ss("localport", 0x02, &local_port, sizeof(local_port), offset); + + p_nat_type = GUINT32_TO_LE(p_nat_type); + offset = gfire_proto_write_attr_ss("status", 0x02, &p_nat_type, sizeof(p_nat_type), offset); + + offset = gfire_proto_write_attr_ss("salt", 0x01, p_salt, strlen(p_salt), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + + return offset; +} + +void gfire_buddy_proto_on_off(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset = 0; + GList *userids = NULL; + GList *sids = NULL; + GList *u,*s; + gfire_buddy *gf_buddy = NULL; + + if (p_packet_len < 16) { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_on_off: buddies online status received but way too short?!? %d bytes\n", + p_packet_len); + return; + } + + offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &userids, 0x01, offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !userids) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &sids, 0x03, offset); + if(offset == -1 || !sids) + { + gfire_list_clear(userids); + return; + } + + u = userids; s = sids; + + for(; u; u = g_list_next(u)) + { + gf_buddy = gfire_find_buddy(p_gfire, u->data, GFFB_USERID); + if (!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_on_off: invalid user ID from Xfire\n"); + + g_free(u->data); + g_free(s->data); + + s = g_list_next(s); + continue; + } + + gfire_buddy_set_session_id(gf_buddy, (guint8*)s->data); + + purple_debug(PURPLE_DEBUG_INFO, "gfire", "%s is now %s\n", gfire_buddy_get_name(gf_buddy), + gfire_buddy_is_online(gf_buddy) ? "online" : "offline"); + + g_free(u->data); + g_free(s->data); + + s = g_list_next(s); + } + + g_list_free(userids); + g_list_free(sids); +} + +void gfire_buddy_proto_game_status(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + gfire_buddy *gf_buddy = NULL; + GList *sids = NULL; + GList *gameids = NULL; + GList *gameips = NULL; + GList *gameports = NULL; + GList *s, *g, *ip, *gp; + + offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &sids, "sid", offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !sids) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &gameids, "gameid", offset); + // Parsing error -> skip further parsing + if (offset == -1) + { + gfire_list_clear(sids); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &gameips, "gip", offset); + // Parsing error -> skip further parsing + if (offset == -1) + { + gfire_list_clear(sids); + gfire_list_clear(gameids); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &gameports, "gport", offset); + // Parsing error -> skip further parsing + if (offset == -1) + { + gfire_list_clear(sids); + gfire_list_clear(gameids); + gfire_list_clear(gameips); + return; + } + + g = gameids; s = sids; ip = gameips; gp = gameports; + + GList *fof_sids = NULL; + for(; s; s = g_list_next(s)) + { + gf_buddy = gfire_find_buddy(p_gfire, s->data, GFFB_SID); + // Needs to be an FoF buddy + if(!gf_buddy) + { + if(gfire_wants_fofs(p_gfire)) + { + fof_sids = g_list_append(fof_sids, s->data); + gfire_fof_data = g_list_append(gfire_fof_data, gfire_fof_game_data_create(s->data, *(guint32*)g->data, *(guint32*)ip->data, *(guint32*)gp->data & 0xFFFF)); + } + + g_free(g->data); + g_free(gp->data); + g_free(ip->data); + + g = g_list_next(g); + ip = g_list_next(ip); + gp = g_list_next(gp); + + continue; + } + + gfire_buddy_set_game_status(gf_buddy, *(guint32*)g->data, *(guint32*)gp->data & 0xFFFF, *(guint32*)ip->data); + + // Remove FoF as soon as he stops playing + if(gfire_buddy_is_friend_of_friend(gf_buddy) && !gfire_buddy_is_playing(gf_buddy)) + gfire_remove_buddy(p_gfire, gf_buddy, FALSE, TRUE); + + g_free(s->data); + g_free(g->data); + g_free(gp->data); + g_free(ip->data); + + g = g_list_next(g); + ip = g_list_next(ip); + gp = g_list_next(gp); + } + + g_list_free(gameids); + g_list_free(gameports); + g_list_free(sids); + g_list_free(gameips); + + if(g_list_length(fof_sids) > 0) + { + purple_debug_misc("gfire", "requesting FoF network info for %u users\n", g_list_length(fof_sids)); + guint16 len = gfire_buddy_proto_create_fof_request(fof_sids); + if(len > 0) gfire_send(gfire_get_connection(p_gfire), len); + } + + gfire_list_clear(fof_sids); +} + +void gfire_buddy_proto_voip_status(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + gfire_buddy *gf_buddy = NULL; + GList *sids = NULL; + GList *voipids = NULL; + GList *voipips = NULL; + GList *voipports = NULL; + GList *s, *v, *ip, *vp; + + offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &sids, "sid", offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !sids) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &voipids, "vid", offset); + // Parsing error -> skip further parsing + if (offset == -1) + { + gfire_list_clear(sids); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &voipips, "vip", offset); + // Parsing error -> skip further parsing + if (offset == -1) + { + gfire_list_clear(sids); + gfire_list_clear(voipids); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &voipports, "vport", offset); + // Parsing error -> skip further parsing + if (offset == -1) + { + gfire_list_clear(sids); + gfire_list_clear(voipids); + gfire_list_clear(voipips); + return; + } + + v = voipids; s = sids; ip = voipips; vp = voipports; + + for(; s; s = g_list_next(s)) + { + gf_buddy = gfire_find_buddy(p_gfire, s->data, GFFB_SID); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_voip_status: unkown session ID from Xfire\n"); + + g_free(s->data); + g_free(v->data); + g_free(vp->data); + g_free(ip->data); + + v = g_list_next(v); + ip = g_list_next(ip); + vp = g_list_next(vp); + + continue; + } + + gfire_buddy_set_voip_status(gf_buddy, *(guint32*)v->data, *(guint32*)vp->data & 0xFFFF, *(guint32*)ip->data); + + g_free(s->data); + g_free(v->data); + g_free(vp->data); + g_free(ip->data); + + v = g_list_next(v); + ip = g_list_next(ip); + vp = g_list_next(vp); + } + + g_list_free(voipids); + g_list_free(voipports); + g_list_free(sids); + g_list_free(voipips); +} + +void gfire_buddy_proto_status_msg(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + gfire_buddy *gf_buddy = NULL; + GList *sids = NULL; + GList *msgs = NULL; + GList *s, *m; + + offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &sids, "sid", offset); + if(offset == -1) + { + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &msgs, "msg", offset); + if(offset == -1) + { + gfire_list_clear(sids); + return; + } + + m = msgs; s = sids; + + for(; s; s = g_list_next(s)) + { + gf_buddy = gfire_find_buddy(p_gfire, s->data, GFFB_SID); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_status_msg: unkown session ID from Xfire\n"); + g_free(s->data); + g_free(m->data); + + m = g_list_next(m); + continue; + } + + gfire_buddy_set_status(gf_buddy, (gchar*)m->data); + + purple_debug(PURPLE_DEBUG_INFO, "gfire", "%s's status set to \"%s\"\n", + gfire_buddy_get_name(gf_buddy), (gchar*)m->data); + + g_free(s->data); + g_free(m->data); + + m = g_list_next(m); + } + + g_list_free(msgs); + g_list_free(sids); +} + +void gfire_buddy_proto_alias_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + guint32 uid = 0; + gchar *nick = NULL; + gfire_buddy *gf_buddy = NULL; + + offset = XFIRE_HEADER_LEN; + + // grab the userid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &uid, 0x01, offset); + if(offset == -1) + return; + + // grab the new nick + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &nick, 0x0D, offset); + if(offset == -1 || !nick) + return; + + gf_buddy = gfire_find_buddy(p_gfire, (gpointer) &uid, GFFB_USERID); + if (!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_alias_change: unknown user ID from Xfire\n"); + g_free(nick); + return; + } + + purple_debug(PURPLE_DEBUG_INFO, "gfire", "User %s changed nick from \"%s\" to \"%s\"\n", + gfire_buddy_get_name(gf_buddy), gfire_buddy_get_alias(gf_buddy), NN(nick)); + + gfire_buddy_set_alias(gf_buddy, nick); + + g_free(nick); +} + +void gfire_buddy_proto_changed_avatar(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + guint32 uid; + guint32 avatarType = 0x0; + guint32 avatarNum = 0x0; + gfire_buddy *gf_buddy = NULL; + + offset = XFIRE_HEADER_LEN; + + // grab the userid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &uid, 0x01, offset); + if(offset == -1) + return; + + // grab the avatarType + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &avatarType, 0x34, offset); + if(offset == -1) + return; + + // grab the avatarNum + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &avatarNum, 0x1F, offset); + if(offset == -1) + return; + + gf_buddy = gfire_find_buddy(p_gfire, (gpointer) &uid, GFFB_USERID); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_changed_avatar: unknown user ID from Xfire\n"); + return; + } + + if(gfire_buddy_is_friend(gf_buddy) || gfire_buddy_is_clan_member(gf_buddy)) + gfire_buddy_download_avatar(gf_buddy, avatarType, avatarNum); +} + +void gfire_buddy_proto_clans(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + guint32 uid; + GList *clanids = NULL; + GList *clanShortNames = NULL; + GList *clanLongNames = NULL; + GList *clanNicks = NULL; + GList *ci, *csn, *cln, *cn; + gfire_buddy *gf_buddy = NULL; + gfire_clan *gf_clan = NULL; + + offset = XFIRE_HEADER_LEN; + + // grab the userid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &uid, 0x01, offset); + if(offset == -1) + return; + + // grab the clanids + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanids, 0x6C, offset); + if(offset == -1 || !clanids) + return; + + // grab the clanShortNames + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanShortNames, 0x72, offset); + if(offset == -1 || !clanShortNames) + { + gfire_list_clear(clanids); + return; + } + + // grab the clanLongNames + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanLongNames, 0x81, offset); + if(offset == -1 || !clanLongNames) + { + gfire_list_clear(clanids); + gfire_list_clear(clanShortNames); + return; + } + + // grab the clanNicks + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanNicks, 0x6D, offset); + if(offset == -1 || !clanNicks) + { + gfire_list_clear(clanids); + gfire_list_clear(clanShortNames); + gfire_list_clear(clanLongNames); + return; + } + + gf_buddy = gfire_find_buddy(p_gfire, (gpointer) &uid, GFFB_USERID); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_clans: unknown user ID from Xfire\n"); + gfire_list_clear(clanids); + gfire_list_clear(clanShortNames); + gfire_list_clear(clanLongNames); + gfire_list_clear(clanNicks); + return; + } + + ci = clanids; + csn = clanShortNames; + cln = clanLongNames; + cn = clanNicks; + + while(ci) + { + gf_clan = gfire_find_clan(p_gfire, *(guint32*)ci->data); + if(!gf_clan) + { + gf_clan = gfire_clan_create(*(guint32*)ci->data, (gchar*)cln->data, (gchar*)csn->data, FALSE); + if(gf_clan) + gfire_add_clan(p_gfire, gf_clan); + } + + g_free(ci->data); + g_free(csn->data); + g_free(cln->data); + + ci = g_list_next(ci); + csn = g_list_next(csn); + cln = g_list_next(cln); + + if(!gf_clan) + { + g_free(cn->data); + cn = g_list_next(cn); + + continue; + } + + gfire_buddy_add_to_clan(gf_buddy, gf_clan, (gchar*)cn->data, FALSE); + g_free(cn->data); + cn = g_list_next(cn); + } + + g_list_free(clanids); + g_list_free(clanShortNames); + g_list_free(clanLongNames); + g_list_free(clanNicks); +} + +void gfire_buddy_proto_im(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint8 *sid, peermsg; + guint32 msgtype,imindex = 0; + gchar *im = NULL; + gfire_buddy *gf_buddy = NULL; + guint32 typing = 0; + + if(p_packet_len < 16) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: packet 133 recv'd but way too short?!? %d bytes\n", + p_packet_len); + return; + } + + guint32 offset = XFIRE_HEADER_LEN; + + // get session id ("sid") + offset = gfire_proto_read_attr_sid_ss(p_gfire->buff_in, &sid, "sid", offset); + if(offset == -1 || !sid) + return; + + gf_buddy = gfire_find_buddy(p_gfire, (gpointer)sid, GFFB_SID); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_im: Unknown session ID for IM packet.\n"); + g_free(sid); + return; + } + + g_free(sid); + + // get peermsg parent attribute ("peermsg") + offset = gfire_proto_read_attr_children_count_ss(p_gfire->buff_in, &peermsg, "peermsg", offset); + if(offset == -1) + return; + + // Get message type ("msgtype") + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &msgtype, "msgtype", offset); + if(offset == -1) + return; + + switch(msgtype) + { + // Instant message + case 0: + // IM index ("imindex") + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &imindex, "imindex", offset); + if(offset == -1) + return; + + // the IM itself ("im") + offset = gfire_proto_read_attr_string_ss(p_gfire->buff_in, &im, "im", offset); + if(offset == -1 || !im) + return; + + gfire_buddy_got_im(gf_buddy, imindex, im, FALSE); + break; + // ACK packet + case 1: + // got an ack packet from a previous IM sent + purple_debug(PURPLE_DEBUG_MISC, "gfire", "IM ack packet received.\n"); + + // IM index ("imindex") + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &imindex, "imindex", offset); + if(offset == -1) + return; + + gfire_buddy_got_im_ack(gf_buddy, imindex); + break; + // P2P Info + case 2: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Got P2P info.\n"); + + guint32 ip, localip; + guint32 port, localport; + guint32 status; + gchar *salt = NULL; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &ip, "ip", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &port, "port", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &localip, "localip", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &localport, "localport", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &status, "status", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_string_ss(p_gfire->buff_in, &salt, "salt", offset); + if(offset == -1) + return; + + gfire_buddy_got_p2p_data(gf_buddy, GUINT32_FROM_LE(ip), (guint16)GUINT32_FROM_LE(port), GUINT32_FROM_LE(localip), (guint16)GUINT32_FROM_LE(localport), status, salt); + + g_free(salt); + break; + // Typing notification + case 3: + // IM index ("imindex") + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &imindex, "imindex", offset); + if(offset == -1) + return; + + // typing ("typing") + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &typing, "typing", offset); + if(offset == -1) + return; + + gfire_buddy_got_typing(gf_buddy, typing == 1); + break; + // Unknown + default: + purple_debug(PURPLE_DEBUG_INFO, "gfire", "unknown IM msgtype %u.\n", msgtype); + } +} + +void gfire_buddy_proto_fof_list(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + gfire_buddy *gf_buddy = NULL; + GList *fofsid = NULL; + GList *fofs = NULL; + GList *names = NULL; + GList *nicks = NULL; + GList *common = NULL; + GList *f, *na, *n, *s, *c; + + offset = XFIRE_HEADER_LEN; + + if(!gfire_wants_fofs(p_gfire)) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &fofsid, "fnsid", offset); + if(offset == -1 || !fofsid) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &fofs, "userid", offset); + // Parsing error or empty list -> skip further handling + if(offset == -1 || !fofs) + { + gfire_list_clear(fofsid); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &names, "name", offset); + // Parsing error -> free other lists and skip further handling + if(offset == -1 || !names) + { + gfire_list_clear(fofsid); + gfire_list_clear(fofs); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &nicks, "nick", offset); + // Parsing error -> free other lists and skip further handling + if(offset == -1 || !nicks) + { + gfire_list_clear(fofsid); + gfire_list_clear(fofs); + gfire_list_clear(names); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &common, "friends", offset); + // Parsing error -> free other lists and skip further handling + if(offset == -1 || !common) + { + gfire_list_clear(fofsid); + gfire_list_clear(fofs); + gfire_list_clear(names); + gfire_list_clear(nicks); + return; + } + + s = fofsid; + f = fofs; + na = names; + n = nicks; + c = common; + + for(; s; s = g_list_next(s)) + { + // Invalid FoF + if(*(guint32*)f->data == 0) + { + g_free(s->data); + g_free(f->data); + g_free(na->data); + g_free(n->data); + gfire_list_clear(c->data); + + f = g_list_next(f); + na = g_list_next(na); + n = g_list_next(n); + c = g_list_next(c); + + continue; + } + + if(!gfire_is_self(p_gfire, *(guint32*)f->data)) + { + gf_buddy = gfire_find_buddy(p_gfire, na->data, GFFB_NAME); + if(!gf_buddy) + { + gf_buddy = gfire_buddy_create(*(guint32*)f->data, (gchar*)na->data, (gchar*)n->data, GFBT_FRIEND_OF_FRIEND); + if(gf_buddy) + { + gfire_add_buddy(p_gfire, gf_buddy, NULL); + gfire_buddy_set_session_id(gf_buddy, (guint8*)s->data); + + GList *common_names = NULL; + GList *cur = c->data; + for(; cur; cur = g_list_next(cur)) + { + gfire_buddy *common_buddy = gfire_find_buddy(p_gfire, cur->data, GFFB_USERID); + if(common_buddy) + common_names = g_list_append(common_names, g_strdup(gfire_buddy_get_name(common_buddy))); + + g_free(cur->data); + } + + gfire_buddy_set_common_buddies(gf_buddy, common_names); + + cur = gfire_fof_data; + for(; cur; cur = g_list_next(cur)) + { + if(memcmp(((fof_game_data*)cur->data)->sid, s->data, XFIRE_SID_LEN) == 0) + { + gfire_buddy_set_game_status(gf_buddy, ((fof_game_data*)cur->data)->game.id, ((fof_game_data*)cur->data)->game.port, ((fof_game_data*)cur->data)->game.ip.value); + + if(((fof_game_data*)cur->data)->gcd) + { + gfire_buddy_set_game_client_data(gf_buddy, ((fof_game_data*)cur->data)->gcd); + ((fof_game_data*)cur->data)->gcd = NULL; + } + + gfire_fof_game_data_free((fof_game_data*)cur->data); + gfire_fof_data = g_list_delete_link(gfire_fof_data, cur); + + break; + } + } + } + else + { + GList *cur = gfire_fof_data; + for(; cur; cur = g_list_next(cur)) + { + if(memcmp(((fof_game_data*)cur->data)->sid, s->data, XFIRE_SID_LEN) == 0) + { + gfire_fof_game_data_free((fof_game_data*)cur->data); + gfire_fof_data = g_list_delete_link(gfire_fof_data, cur); + + break; + } + } + } + } + else + { + GList *cur = gfire_fof_data; + for(; cur; cur = g_list_next(cur)) + { + if(memcmp(((fof_game_data*)cur->data)->sid, s->data, XFIRE_SID_LEN) == 0) + { + gfire_fof_game_data_free((fof_game_data*)cur->data); + gfire_fof_data = g_list_delete_link(gfire_fof_data, cur); + + break; + } + } + } + } + else + { + GList *cur = gfire_fof_data; + for(; cur; cur = g_list_next(cur)) + { + if(memcmp(((fof_game_data*)cur->data)->sid, s->data, XFIRE_SID_LEN) == 0) + { + gfire_fof_game_data_free((fof_game_data*)cur->data); + gfire_fof_data = g_list_delete_link(gfire_fof_data, cur); + + break; + } + } + } + + g_free(s->data); + g_free(f->data); + g_free(na->data); + g_free(n->data); + g_list_free(c->data); + + f = g_list_next(f); + na = g_list_next(na); + n = g_list_next(n); + c = g_list_next(c); + } + + g_list_free(fofsid); + g_list_free(fofs); + g_list_free(nicks); + g_list_free(names); + g_list_free(common); +} + +void gfire_buddy_proto_clan_alias_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + guint32 clanid = 0; + guint32 uid = 0; + gchar *nick = NULL; + gfire_buddy *gf_buddy = NULL; + + offset = XFIRE_HEADER_LEN; + + // grab the clanid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &clanid, 0x6C, offset); + if(offset == -1) + return; + + // grab the userid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &uid, 0x01, offset); + if(offset == -1) + return; + + // grab the new nick + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &nick, 0x0D, offset); + if(offset == -1 || !nick) + return; + + gf_buddy = gfire_find_buddy(p_gfire, (gpointer) &uid, GFFB_USERID); + if (!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_buddy_proto_clan_alias_change: unknown user ID from Xfire\n"); + g_free(nick); + return; + } + + gfire_clan *clan = gfire_find_clan(p_gfire, clanid); + if(clan) + purple_debug(PURPLE_DEBUG_INFO, "gfire", "User %s changed nick for clan %s (%u) to \"%s\"\n", + gfire_buddy_get_name(gf_buddy), clan->long_name, clanid, nick); + + gfire_buddy_set_clan_alias(gf_buddy, clanid, nick); + + g_free(nick); +} + +void gfire_buddy_proto_game_client_data(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + GList *sids = NULL, *data = NULL; + gfire_buddy *gf_buddy = NULL; + + offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &sids, "sid", offset); + if(!sids || offset == -1) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &data, "gcd", offset); + if(!data || offset == -1) + { + gfire_list_clear(sids); + return; + } + + GList *sid = g_list_first(sids); + GList *gcd = g_list_first(data); + + for(; sid; sid = g_list_next(sid)) + { + gf_buddy = gfire_find_buddy(p_gfire, (const void*)sid->data, GFFB_SID); + if(gf_buddy) + { + purple_debug_misc("gfire", "Got Game Client Data for buddy %s:\n", gfire_buddy_get_name(gf_buddy)); + GList *game_data = gfire_game_client_data_parse((gchar*)gcd->data); + + GList *current = g_list_first(game_data); + for(; current; current = g_list_next(current)) + purple_debug_misc("gfire", "\t%s=%s\n", NN(((game_client_data*)current->data)->key), NN(((game_client_data*)current->data)->value)); + + gfire_buddy_set_game_client_data(gf_buddy, game_data); + } + else + { + GList *cur = gfire_fof_data; + for(; cur; cur = g_list_next(cur)) + { + if(memcmp(((fof_game_data*)cur->data)->sid, sid->data, XFIRE_SID_LEN) == 0) + break; + } + + if(cur) + { + purple_debug_misc("gfire", "Got Game Client Data for requested FoF:\n"); + GList *game_data = gfire_game_client_data_parse((gchar*)gcd->data); + + GList *current = g_list_first(game_data); + for(; current; current = g_list_next(current)) + purple_debug_misc("gfire", "\t%s=%s\n", NN(((game_client_data*)current->data)->key), NN(((game_client_data*)current->data)->value)); + + ((fof_game_data*)cur->data)->gcd = game_data; + } + else + purple_debug_error("gfire", "got unknown SID from Xfire\n"); + } + + g_free(sid->data); + g_free(gcd->data); + + gcd = g_list_next(gcd); + } + + g_list_free(sids); + g_list_free(data); +} diff -Nru gfire-0.8.3/src/gf_buddies_proto.h gfire-0.9.4/src/gf_buddies_proto.h --- gfire-0.8.3/src/gf_buddies_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_buddies_proto.h 2011-03-14 20:26:04.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_BUDDIES_PROTO_H +#define _GF_BUDDIES_PROTO_H + +#include "gf_base.h" +#include "gf_games.h" +#include "gfire.h" + +// Packet creation +guint16 gfire_buddy_proto_create_advanced_info_request(guint32 p_userid); +guint16 gfire_buddy_proto_create_typing_notification(const guint8 *p_sid, guint32 p_imindex, gboolean p_typing); +guint16 gfire_buddy_proto_create_send_im(const guint8 *p_sid, guint32 p_imindex, const gchar *p_msg); +guint16 gfire_buddy_proto_create_fof_request(GList *p_sids); +guint16 gfire_buddy_proto_create_ack(const guint8 *p_sid, guint32 p_imindex); +guint16 gfire_buddy_proto_create_p2p(const guint8 *p_sid, guint32 p_ip, guint16 p_port, guint32 p_local_ip, guint16 p_local_port, guint32 p_nat_type, const gchar *p_salt); + +// Packet parsing +void gfire_buddy_proto_on_off(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_game_status(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_voip_status(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_status_msg(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_alias_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_changed_avatar(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_clans(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_im(gfire_data *p_gfire, guint16 packet_len); +void gfire_buddy_proto_fof_list(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_clan_alias_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_buddy_proto_game_client_data(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // _GF_BUDDIES_PROTO_H diff -Nru gfire-0.8.3/src/gf_chat.c gfire-0.9.4/src/gf_chat.c --- gfire-0.8.3/src/gf_chat.c 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_chat.c 2011-03-14 20:25:59.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -20,506 +19,1114 @@ * along with Gfire. If not, see . */ -#include "gfire.h" -#include "gf_packet.h" -#include "gf_chat.h" #include "gf_network.h" +#include "gf_chat.h" -void gfire_join_chat(PurpleConnection *gc, GHashTable *components) +static PurpleChat *gfire_chat_find_in_blist(const gfire_chat *p_chat) { - gfire_data *gfire = NULL; - guint8 *xid = NULL; - gchar *room = NULL; - gchar *name = NULL; - gchar *pass = NULL; - int packet_len = 0; + if(!p_chat) + return NULL; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !components) return; + PurpleChat *chat = NULL; + // Check by name first + if(p_chat->topic) + { + chat = purple_blist_find_chat(purple_connection_get_account(gfire_get_connection(p_chat->owner)), p_chat->topic); + if(chat) + { + GHashTable *comp = purple_chat_get_components(chat); + if(comp && p_chat->chat_id && g_hash_table_lookup(comp, "chat_id")) + { + guint8 *id = purple_base64_decode(g_hash_table_lookup(comp, "chat_id"), NULL); + if(memcmp(id, p_chat->chat_id, XFIRE_CHATID_LEN) == 0) + { + g_free(id); + return chat; + } + g_free(id); + } + else + return chat; + } + } - name = gfire->alias ? gfire->alias : (gchar *)purple_account_get_username(gc->account); - room = g_hash_table_lookup(components, "room"); - pass = g_hash_table_lookup(components, "password"); - if (!(xid = g_hash_table_lookup(components, "chat_id"))) { - /* no xid we need to create this room */ - purple_debug(PURPLE_DEBUG_MISC, "gfire","Attempting to create chat room %s\n", NN(room)); - xid = g_malloc0(XFIRE_CHATID_LEN); - xid[0] = 0x00; - xid[1] = 0x00; - packet_len = gfire_create_join_chat(gc, xid, (room ? room : name), pass); - g_free(xid); - } else { - packet_len = gfire_create_join_chat(gc, xid, name, pass); + // Check by chat_id + if(p_chat->chat_id) + { + // Iterate through the whole buddy list until we find a chat with given chat_id + PurpleBlistNode *node = purple_blist_get_root(); + while(node) + { + PurpleBlistNode *next = NULL; + if(!PURPLE_BLIST_NODE_IS_CHAT(node)) + { + next = purple_blist_node_get_first_child(node); + } + else + { + chat = PURPLE_CHAT(node); + // We only care for chats of the current account + if(purple_chat_get_account(chat) == purple_connection_get_account(gfire_get_connection(p_chat->owner))) + { + // Check the chat_id + GHashTable *comp = purple_chat_get_components(chat); + if(comp && g_hash_table_lookup(comp, "chat_id")) + { + guint8 *id = purple_base64_decode(g_hash_table_lookup(comp, "chat_id"), NULL); + if(memcmp(id, p_chat->chat_id, XFIRE_CHATID_LEN) == 0) + { + g_free(id); + return chat; + } + g_free(id); + } + } + + // Not our chat; go on with next sibling + } + + if(!next) + { + next = purple_blist_node_get_sibling_next(node); + } + + if(!next) + { + // No chat found + if(node == purple_blist_get_root()) + return NULL; + + // Get next sibling of parent + PurpleBlistNode *parent = purple_blist_node_get_parent(node); + next = purple_blist_node_get_sibling_next(parent); + while(!next && parent) + { + parent = purple_blist_node_get_parent(parent); + next = purple_blist_node_get_sibling_next(parent); + } + } + + node = next; + } } - if (packet_len > 0) { - gfire_send(gc, gfire->buff_out, packet_len); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat): sending join info for room %s\n", NN(room)); + // No chat found + return NULL; +} + +static void gfire_chat_update_purple_chat(gfire_chat *p_chat) +{ + if(!p_chat || !p_chat->purple_chat) return; + + GHashTable *comp = purple_chat_get_components(p_chat->purple_chat); + // Set Chat ID by adding a new chat node / Update name + if(!g_hash_table_lookup(comp, "chat_id") || + (p_chat->topic && purple_utf8_strcasecmp(g_hash_table_lookup(comp, "room"), p_chat->topic) != 0)) + { + // Update the topic + if(p_chat->topic) + g_hash_table_replace(comp, g_strdup("room"), g_strdup(p_chat->topic)); + + // Insert the ID + gchar *id = purple_base64_encode(p_chat->chat_id, XFIRE_CHATID_LEN); + g_hash_table_replace(comp, g_strdup("chat_id"), id); } +} - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(chat join): failed to join room %s\n", NN(room)); +gfire_chat *gfire_chat_create(gfire_data *p_owner, const guint8 *p_id, const gchar *p_topic, + const gchar *p_motd, gboolean p_force_add) +{ + if(!p_owner) + return NULL; -} + gfire_chat *ret = g_malloc0(sizeof(gfire_chat)); + if(!ret) + return NULL; + ret->owner = p_owner; -void gfire_reject_chat(PurpleConnection *gc, GHashTable *components) -{ - gfire_data *gfire = NULL; - guint8 *cid = NULL; - int packet_len = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !components) return; + ret->chat_id = g_malloc0(XFIRE_CHATID_LEN); + if(!ret->chat_id) + { + g_free(ret); + return NULL; + } - if ((cid = g_hash_table_lookup(components, "chat_id"))) packet_len = gfire_create_reject_chat(gc, cid); + if(p_id) + memcpy(ret->chat_id, p_id, XFIRE_CHATID_LEN); + if(p_topic) + ret->topic = g_strdup(p_topic); + if(p_motd) + ret->motd = g_strdup(p_motd); - if (packet_len > 0) { - gfire_send(gc, gfire->buff_out, packet_len); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat): sending reject groupchat invitation\n"); - return; + ret->purple_chat = gfire_chat_find_in_blist(ret); + if(ret->purple_chat) + { + gfire_chat_update_purple_chat(ret); + gfire_chat_set_saved(ret, TRUE); + } + else if(p_force_add) + { + GHashTable *comp = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + if(p_topic) + g_hash_table_insert(comp, g_strdup("room"), g_strdup(p_topic)); + + gchar *chat_id = purple_base64_encode(ret->chat_id, XFIRE_CHATID_LEN); + g_hash_table_insert(comp, g_strdup("chat_id"), chat_id); + + ret->purple_chat = purple_chat_new(purple_connection_get_account(gfire_get_connection(p_owner)), + NULL, comp); + + PurpleGroup *group = purple_find_group(GFIRE_DEFAULT_GROUP_NAME); + if(!group) + { + group = purple_group_new(GFIRE_DEFAULT_GROUP_NAME); + purple_blist_add_group(group, NULL); + } + purple_blist_add_chat(ret->purple_chat, group, NULL); } + return ret; } +void gfire_chat_free(gfire_chat *p_chat) +{ + if(!p_chat) + return; + + if(p_chat->chat_id) g_free(p_chat->chat_id); + if(p_chat->topic) g_free(p_chat->topic); + if(p_chat->motd) g_free(p_chat->motd); -void gfire_read_chat_invite(PurpleConnection *gc, int packet_len) + GList *cur_member = p_chat->members; + while(cur_member) + { + gfire_buddy_free((gfire_buddy*)cur_member->data); + cur_member = g_list_next(cur_member); + } + + if(p_chat->members) g_list_free(p_chat->members); +} + +void gfire_chat_add_user(gfire_chat *p_chat, gfire_buddy *p_buddy, guint32 p_perm, gboolean p_joined) { - int index = 7; - guint16 sl = 0; - gfire_data *gfire = NULL; - gchar chanid[XFIRE_CHATID_LEN + 1]; - gchar *inviter_uid = NULL; - gchar *inviter_login = NULL; - gchar *inviter_alias = NULL; - gchar *room = NULL; - GHashTable *components = NULL; + if(!p_chat || !p_buddy) + return; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (index > packet_len)) return; + gchar permissionName[50]; + PurpleConvChatBuddyFlags f; + switch(p_perm) + { + case Muted: + strcpy(permissionName, _("Permissionless (muted)")); + f = PURPLE_CBFLAGS_NONE; + break; - /* get chat id */ - memcpy(chanid, gfire->buff_in + index, XFIRE_CHATID_LEN); - chanid[XFIRE_CHATID_LEN]=0x00; - index += XFIRE_CHATID_LEN + 8; + case Normal: + strcpy(permissionName, _("Normal")); + f = PURPLE_CBFLAGS_NONE; + break; - /* get user id of the person inviting us */ - inviter_uid = g_malloc0(XFIRE_USERID_LEN); - memcpy(inviter_uid, gfire->buff_in + index, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN + 2; + case Power_User: + strcpy(permissionName, _("Power-User")); + f = PURPLE_CBFLAGS_VOICE; + break; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat invite): chatid: %s, inviter userid: %s\n", - NN(chanid), NN(inviter_uid)); + case Moderator: + strcpy(permissionName, _("Moderator")); + f = PURPLE_CBFLAGS_HALFOP; + break; - /* get string len of login id of inviter */ - memcpy(&sl, gfire->buff_in + index, sizeof(sl)); - sl = GUINT16_FROM_LE(sl); - index += sizeof(sl); + case Admin: + strcpy(permissionName, _("Admin")); + f = PURPLE_CBFLAGS_OP; + break; - if (0 == sl) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(chat invite): string len of loginID is 0!\n"); - return; + default: + strcpy(permissionName, _("Unknown")); + f = PURPLE_CBFLAGS_NONE; } - inviter_login = g_malloc0(sl + 1); - memcpy(inviter_login, gfire->buff_in + index, sl); - index += sl + 2; - /* get nick of inviter if they have one */ - memcpy(&sl, gfire->buff_in + index, sizeof(sl)); - sl = GUINT16_FROM_LE(sl); - index += sizeof(sl); + purple_conv_chat_add_user(PURPLE_CONV_CHAT(p_chat->c), gfire_buddy_get_name(p_buddy), NULL, f, p_joined && p_chat->show_join_leave); - if (sl > 0) { - inviter_alias = g_malloc0(sl + 1); - memcpy(inviter_alias, gfire->buff_in + index, sl); + if(gfire_is_self(p_chat->owner, p_buddy->userid)) + { + p_chat->own_permission = p_perm; + gchar *tmpmsg = g_strdup_printf(_("You currently have the permission \"%s\"."), permissionName); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); } - index += sl + 2; - /* get room name length */ - memcpy(&sl, gfire->buff_in + index, sizeof(sl)); - sl = GUINT16_FROM_LE(sl); - index += sizeof(sl); - if (sl > 0) { - room = g_malloc0(sl + 1); - memcpy(room, gfire->buff_in + index, sl); - } - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat invite): %s with alias %s, invited us to room '%s'\n", - NN(inviter_login), NN(inviter_alias), NN(room)); + p_buddy->chatperm = p_perm; + p_chat->members = g_list_append(p_chat->members, p_buddy); +} + +gfire_buddy *gfire_chat_find_user(gfire_chat *p_chat, guint32 p_userid) +{ + if(!p_chat) + return NULL; - /* assemble ghashtable */ - components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - if (NULL != room) g_hash_table_replace(components, g_strdup("room"), room); - if (NULL != inviter_alias) g_hash_table_replace(components, g_strdup("inv_alias"), inviter_alias); - if (NULL != inviter_login) g_hash_table_replace(components, g_strdup("inv_lid"), inviter_login); - g_hash_table_replace(components, g_strdup("chat_id"), g_strdup(chanid)); - g_hash_table_replace(components, g_strdup("inv_uid"), inviter_uid); - g_hash_table_replace(components, g_strdup("members"), g_strdup_printf("%s\n", inviter_login)); + GList *cur = p_chat->members; + while(cur) + { + if(gfire_buddy_is_by_userid((gfire_buddy*)cur->data, p_userid)) + return (gfire_buddy*)cur->data; - serv_got_chat_invite(gc, room, (inviter_alias ? inviter_alias : inviter_login), "", components); -// serv_got_chat_invite(gc, room, inviter_login, "", components); + cur = g_list_next(cur); + } + return NULL; } - -GList *gfire_chat_info(PurpleConnection *gc) +void gfire_chat_got_msg(gfire_chat *p_chat, guint32 p_userid, const gchar *p_msg) { - GList *m = NULL; - struct proto_chat_entry *pce; + if(!p_chat || !p_msg) + return; - pce = g_new0(struct proto_chat_entry, 1); - pce->label = "_Room:"; - pce->identifier = "room"; - pce->required = TRUE; - m = g_list_append(m, pce); - - pce = g_new0(struct proto_chat_entry, 1); - pce->label = "_Password:"; - pce->identifier = "password"; - pce->secret = TRUE; - m = g_list_append(m, pce); + gfire_buddy *buddy = gfire_chat_find_user(p_chat, p_userid); + if(!buddy) + return; - return m; + gchar *escaped = gfire_escape_html(p_msg); + serv_got_chat_in(purple_conversation_get_gc(p_chat->c), p_chat->purple_id, gfire_buddy_get_name(buddy), + PURPLE_MESSAGE_RECV, escaped, time(NULL)); + g_free(escaped); } - -GHashTable *gfire_chat_info_defaults(PurpleConnection *gc, const char *chat_name) +void gfire_chat_user_left(gfire_chat *p_chat, guint32 p_userid, gboolean p_kicked) { - GHashTable *defaults; + if(!p_chat) + return; - defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); + gfire_buddy *buddy = gfire_chat_find_user(p_chat, p_userid); + if(!buddy) + return; - if (chat_name != NULL) - g_hash_table_insert(defaults, "room", g_strdup(chat_name)); + purple_conv_chat_remove_user(PURPLE_CONV_CHAT(p_chat->c), gfire_buddy_get_name(buddy), + p_kicked ? _("Buddy has been kicked.") : NULL); - return defaults; -} + GList *cur = g_list_find(p_chat->members, buddy); + if(!cur) + return; + p_chat->members = g_list_delete_link(p_chat->members, cur); + gfire_buddy_free(buddy); +} -char *gfire_get_chat_name(GHashTable *data) +void gfire_chat_join(const guint8 *p_chat_id, const gchar *p_room, const gchar *p_pass, PurpleConnection *p_gc) { - return g_strdup(g_hash_table_lookup(data, "room")); + if(!p_gc) + return; + + if(!p_room) + p_room = gfire_get_name((gfire_data *)p_gc->proto_data); + + + guint16 packet_len = gfire_chat_proto_create_join(p_chat_id, p_room, p_pass); + if(packet_len > 0) + { + gfire_send(p_gc, packet_len); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat): sending join request for room %s\n", p_room); + return; + } } +void gfire_chat_leave(gfire_chat *p_chat) +{ + if(!p_chat) + return; -void gfire_chat_invite(PurpleConnection *gc, int id, const char *message, const char *who) + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(group chat): leaving room: %s\n", NN(p_chat->topic)); + guint16 len = gfire_chat_proto_create_leave(p_chat->chat_id); + if(len > 0) gfire_send(gfire_get_connection(p_chat->owner), len); +} + +void gfire_chat_set_topic(gfire_chat *p_chat, const gchar *p_topic, gboolean p_notify) { - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - gfire_buddy *buddy = NULL; - GList *t = NULL; - int len = 0; + if(!p_chat || !p_topic) + return; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !who) return; + gchar *oldtopic = p_chat->topic; + p_chat->topic = g_strdup(p_topic); - t = gfire_find_chat(gfire->chats, (gpointer *)GINT_TO_POINTER(id), GFFC_PURPLEID); - if (!t || !(gfchat = (gfire_chat *)t->data)) return; + // Update chat node + gfire_chat_update_purple_chat(p_chat); - t = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)who, GFFB_NAME); - if (!t || !(buddy = (gfire_buddy *)t->data)) return; + if(p_notify && p_chat->c && oldtopic) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "new topic for room %s: %s\n", oldtopic, p_topic); - /* need chat id, and buddy's sid for invite message */ - len = gfire_create_chat_invite(gc, gfchat->chat_id, buddy->userid); - if (len) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(group chat): inviting %s to %s\n", - NN(buddy->name), NN(gfchat->topic)); - gfire_send(gc, gfire->buff_out, len); + purple_conversation_set_title(p_chat->c, p_chat->topic); + + gchar *tmpmsg = g_strdup_printf(_("This room's name has been changed to \"%s\"."), p_topic); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); } + + if(oldtopic) + g_free(oldtopic); } +void gfire_chat_reject(guint8 *p_chat_id, PurpleConnection *p_gc) +{ + if(!p_chat_id || !p_gc) + return; -void gfire_chat_leave(PurpleConnection *gc, int id) + guint16 packet_len = gfire_chat_proto_create_reject(p_chat_id); + if(packet_len > 0) + { + gfire_send(p_gc, packet_len); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat): sending reject groupchat invitation\n"); + } +} + +void gfire_chat_set_motd(gfire_chat *p_chat, const gchar *p_motd, gboolean p_notify) { - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - int len = 0; + if(!p_chat || !p_motd) + return; - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; + if(p_chat->motd) g_free(p_chat->motd); + p_chat->motd = g_strdup(p_motd); - t = gfire_find_chat(gfire->chats, (gpointer *)GINT_TO_POINTER(id), GFFC_PURPLEID); - if (!t || !(gfchat = (gfire_chat *)t->data)) return; + if(p_notify && p_chat->c) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "new motd for room %s: %s\n", p_chat->topic, p_motd); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(group chat): leaving room: %s\n", NN(gfchat->topic)); - len = gfire_create_chat_leave(gc, gfchat->chat_id); - if (len) gfire_send(gc, gfire->buff_out, len); -/* FIXME: add cleanup code to chat leave() */ - return; + purple_conv_chat_set_topic(PURPLE_CONV_CHAT(p_chat->c), "", p_motd); + gchar *tmpmsg = g_strdup_printf(_("Today's message changed to:\n%s"), p_motd); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } } - -int gfire_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) +void gfire_chat_buddy_permission_changed(gfire_chat *p_chat, guint32 p_userid, guint32 p_perm) { - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - int len = 0; + if(!p_chat) + return; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !message) return -1; + gfire_buddy *gf_buddy = gfire_chat_find_user(p_chat, p_userid); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_chat_buddy_permission_changed: Unknown buddy!\n"); + return; + } - t = gfire_find_chat(gfire->chats, (gpointer *)GINT_TO_POINTER(id), GFFC_PURPLEID); - if (!t || !(gfchat = (gfire_chat *)t->data)) return -1; + gchar permissionName[50]; + PurpleConvChatBuddyFlags f; + switch(p_perm) + { + case 01: + strcpy(permissionName, _("Permissionless (muted)")); + f = PURPLE_CBFLAGS_NONE; + break; - message = purple_unescape_html(message); + case 02: + strcpy(permissionName, _("Normal")); + f = PURPLE_CBFLAGS_NONE; + break; + + case 03: + strcpy(permissionName, _("Power-User")); + f = PURPLE_CBFLAGS_VOICE; + break; + + case 04: + strcpy(permissionName, _("Moderator")); + f = PURPLE_CBFLAGS_HALFOP; + break; - if ((len = gfire_create_chat_message(gc, gfchat->chat_id, message))) { - gfire_send(gc, gfire->buff_out, len); - return 1; + case 05: + strcpy(permissionName, _("Admin")); + f = PURPLE_CBFLAGS_OP; + break; + + default: + strcpy(permissionName, _("Unknown")); + f = PURPLE_CBFLAGS_NONE; } - return -1; -} + if(gfire_is_self(p_chat->owner, gf_buddy->userid)) + { + p_chat->own_permission = p_perm; + gchar *tmpmsg = g_strdup_printf(_("Your permission has been changed to \"%s\"."), permissionName); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } + else + { + gchar *tmpmsg = g_strdup_printf(_("%s's permission has been changed to \"%s\"."), gfire_buddy_get_alias(gf_buddy), permissionName); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } + purple_conv_chat_user_set_flags(PURPLE_CONV_CHAT(p_chat->c), gfire_buddy_get_name(gf_buddy), f); + gf_buddy->chatperm = p_perm; +} -void gfire_chat_joined(PurpleConnection *gc, GList *members, guint8 *chat_id, gchar *topic, gchar *motd) +void gfire_chat_set_saved(gfire_chat *p_chat, gboolean p_save) { - gchar *tmpmsg = NULL; - gfire_buddy *m = NULL; - gfire_chat *gfchat = NULL; - GList *cl = NULL; - gfire_data *gfire = NULL; - PurpleConversation *c = NULL; - PurpleConvChatBuddyFlags f; + if(!p_chat) + return; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !chat_id) return; + guint16 len = gfire_chat_proto_create_save_chat_room(p_chat->chat_id, p_save); + if(len > 0) gfire_send(gfire_get_connection(p_chat->owner), len); +} - cl = gfire_find_chat(gfire->chats, (gpointer *)chat_id, GFFC_CID); +void gfire_chat_show(gfire_chat *p_chat) +{ + if(!p_chat) + return; + + // Create conversation + p_chat->c = serv_got_joined_chat(gfire_get_connection(p_chat->owner), p_chat->purple_id, p_chat->topic); - if (!cl || !(gfchat = (gfire_chat *)cl->data)) { - gfchat = g_new0(gfire_chat, 1); - gfchat->purple_id = gfire->chat; - gfchat->chat_id = chat_id; - gfire->chat++; - gfire->chats = g_list_append(gfire->chats, gfchat); - } - - gfchat->members = members; - gfchat->topic = topic; - gfchat->motd = motd; - //prefix the window title with "xfire groupchat-" to get arround a nasty 1.5 bug that causes a crash - //if groupchat window title matches users username. - c = gfchat->c = serv_got_joined_chat(gc, gfchat->purple_id, g_strdup_printf("xfire groupchat-%s",topic)); - purple_conv_chat_set_topic(PURPLE_CONV_CHAT(c), NULL, topic); + // Set motd + purple_conv_chat_set_topic(PURPLE_CONV_CHAT(p_chat->c), NULL, p_chat->motd); - tmpmsg = g_strdup_printf("You are now chatting in %s.", topic); - purple_conv_chat_write(PURPLE_CONV_CHAT(c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + // Join message + gchar *tmpmsg = g_strdup_printf(_("You are now chatting in %s."), p_chat->topic); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); g_free(tmpmsg); - if (NULL != motd) { - purple_conv_chat_set_topic(PURPLE_CONV_CHAT(c), "", motd); - tmpmsg = g_strdup_printf("Today's Message:\n%s", motd); - purple_conv_chat_write(PURPLE_CONV_CHAT(c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + // MotD + if(p_chat->motd && strlen(p_chat->motd)) + { + gchar *tmpmsg = g_strdup_printf(_("Today's message:\n%s"), p_chat->motd); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); g_free(tmpmsg); } - - for (cl = members; NULL != cl; cl = g_list_next(cl)) { - m = (gfire_buddy *)cl->data; - if (!m) continue; - switch(m->chatperm) { - case 01: - f = PURPLE_CBFLAGS_NONE; + + purple_conversation_present(p_chat->c); +} + +void gfire_chat_invite(gfire_chat *p_chat, const gfire_buddy *p_buddy) +{ + if(!p_chat || !p_buddy) + return; + + // need chat id, and buddy's userid for invite message + guint32 len = gfire_chat_proto_create_invite(p_chat->chat_id, p_buddy->userid); + if(len > 0) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(group chat): inviting %s to %s\n", + NN(p_buddy->name), NN(p_chat->topic)); + gfire_send(gfire_get_connection(p_chat->owner), len); + } +} + +void gfire_chat_send(gfire_chat *p_chat, const gchar *p_msg) +{ + if(!p_chat || !p_msg) + return; + + gchar *no_html = purple_markup_strip_html(p_msg); + gchar *unescaped = purple_unescape_html(no_html); + g_free(no_html); + + guint16 len = gfire_chat_proto_create_message(p_chat->chat_id, unescaped); + if(len > 0) gfire_send(gfire_get_connection(p_chat->owner), len); + + g_free(unescaped); +} + +void gfire_chat_change_motd(gfire_chat *p_chat, const gchar *p_motd) +{ + if(!p_chat || !p_motd) + return; + + guint16 len = gfire_chat_proto_create_change_motd(p_chat->chat_id, p_motd); + if(len > 0) gfire_send(gfire_get_connection(p_chat->owner), len); +} + +void gfire_chat_set_default_permission(gfire_chat *p_chat, guint32 p_permission, gboolean p_notify) +{ + if(!p_chat) + return; + + p_chat->def_permission = p_permission; + + if(p_notify) + { + gchar permissionName[50]; + switch(p_permission) + { + case Muted: + strcpy(permissionName, _("Permissionless (muted)")); break; - - case 02: - f = PURPLE_CBFLAGS_NONE; + + case Normal: + strcpy(permissionName, _("Normal")); break; - - case 03: - f = PURPLE_CBFLAGS_VOICE; + + case Power_User: + strcpy(permissionName, _("Power-User")); break; - - case 04: - f = PURPLE_CBFLAGS_HALFOP; + + case Moderator: + strcpy(permissionName, _("Moderator")); break; - - case 05: - f = PURPLE_CBFLAGS_OP; + + case Admin: + strcpy(permissionName, _("Admin")); break; - - default: - f = PURPLE_CBFLAGS_NONE; - } - purple_conv_chat_add_user(PURPLE_CONV_CHAT(c), m->name, NULL, f, FALSE); - } + default: + strcpy(permissionName, _("Unknown")); + } - return; + gchar *tmpmsg = g_strdup_printf(_("This room's default permission has been changed to \"%s\"."), permissionName); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } } - -GList *gfire_find_chat(GList *chats, gpointer *data, int mode) +void gfire_chat_set_accessibility(gfire_chat *p_chat, guint32 p_accessibility, gboolean p_notify) { - GList *t = chats; - gfire_chat *c = NULL; + if(!p_chat) + return; - if (!chats) return NULL; + p_chat->accessibility = p_accessibility; - switch (mode) + if(p_notify) { - case GFFC_CID: - while (NULL != t){ - c = (gfire_chat *)t->data; - if ((NULL != c->chat_id) && (memcmp(c->chat_id, data, XFIRE_CHATID_LEN) == 0)) - break; - t = g_list_next(t); - } - break; + const gchar *accessibility = NULL; + switch(p_accessibility) + { + case 1: + accessibility = _("Public"); + break; + case 2: + accessibility = _("Friends only"); + break; + default: + accessibility = _("Unknown"); + } - case GFFC_PURPLEID: - while (NULL != t){ - c = (gfire_chat *)t->data; - if ( c->purple_id == GPOINTER_TO_INT(data)) - break; - t = g_list_next(t); - } - break; + gchar *tmpmsg = g_strdup_printf(_("This room's visibility has been changed to \"%s\"."), accessibility); + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } +} - default: - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_find_chat() unknown mode specified\n"); - return NULL; +void gfire_chat_set_secure(gfire_chat *p_chat, gboolean p_secure, gboolean p_notify) +{ + if(!p_chat) + return; + + if(p_notify) + { + gchar *tmpmsg = NULL; + if(!p_chat->secure && p_secure) + tmpmsg = g_strdup_printf(_("This room is now password protected.")); + else if(p_chat->secure && !p_secure) + tmpmsg = g_strdup_printf(_("This room is no longer password protected.")); + else if(p_chat->secure && p_secure) + tmpmsg = g_strdup_printf(_("This room's password has been changed.")); + else + return; + + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); } - return t; + p_chat->secure = p_secure; } +void gfire_chat_set_silenced(gfire_chat *p_chat, gboolean p_silenced, gboolean p_notify) +{ + if(!p_chat) + return; + + if(p_notify) + { + gchar *tmpmsg = NULL; + if(!p_chat->silenced && p_silenced) + tmpmsg = g_strdup_printf(_("This room is now silenced.")); + else if(p_chat->silenced && !p_silenced) + tmpmsg = g_strdup_printf(_("This room is no longer silenced.")); + else + return; + + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); + } -void gfire_chat_got_msg(PurpleConnection *gc, gfire_chat_msg *gcm) + p_chat->silenced = p_silenced; +} + +void gfire_chat_set_show_join_leave(gfire_chat *p_chat, gboolean p_show, gboolean p_notify) { - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - gfire_buddy *m = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !gfire->chats - || !gcm || !(gcm->chat_id) ) return; + if(!p_chat) + return; - t = gfire_find_chat(gfire->chats, (gpointer *)gcm->chat_id, GFFC_CID); - if (t && (gfchat = (gfire_chat *)t->data)) { + if(p_notify) + { + gchar *tmpmsg = NULL; + if(!p_chat->show_join_leave && p_show) + tmpmsg = g_strdup_printf(_("Buddy join-/leave-messages will be displayed now.")); + else if(p_chat->show_join_leave && !p_show) + tmpmsg = g_strdup_printf(_("Buddy join-/leave-messages will no longer be displayed.")); + else + return; - t = gfire_find_buddy_in_list(gfchat->members, (gpointer *)gcm->uid, GFFB_UIDBIN); - if ( t && (m = (gfire_buddy *)t->data)) { - serv_got_chat_in(gc, gfchat->purple_id, m->name, PURPLE_MESSAGE_RECV, - gfire_escape_html(gcm->im_str), time(NULL)); - } + purple_conv_chat_write(PURPLE_CONV_CHAT(p_chat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmpmsg); } - //free gcm - if (gcm->chat_id) g_free(gcm->chat_id); - if (gcm->uid) g_free(gcm->uid); - if (gcm->im_str) g_free(gcm->im_str); - g_free(gcm); + + p_chat->show_join_leave = p_show; } +void gfire_chat_set_purple_chat(gfire_chat *p_chat, PurpleChat *p_purple_chat) +{ + if(!p_chat || !p_purple_chat) + return; + p_chat->purple_chat = p_purple_chat; + gfire_chat_update_purple_chat(p_chat); +} -void gfire_chat_user_leave(PurpleConnection *gc, gfire_chat_msg *gcm) +// Gfire Chat Commands +static PurpleCmdRet gfire_chat_command_handler(PurpleConversation *p_conv, const gchar *p_cmd, + gchar **p_args, gchar **p_error, void *p_data) { - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - gfire_buddy *m = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !gfire->chats - || !gcm || !(gcm->chat_id)) return; + gfire_data *gfire = purple_conversation_get_gc(p_conv)->proto_data; + if(!gfire) + return PURPLE_CMD_RET_FAILED; + + gint id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(p_conv)); + gfire_chat *chat = gfire_find_chat(gfire, &id, GFFC_PURPLEID); + if(!chat) + return PURPLE_CMD_RET_FAILED; - t = gfire_find_chat(gfire->chats, (gpointer *)gcm->chat_id, GFFC_CID); - if (t && (gfchat = (gfire_chat *)t->data)) { + // Save command + if(!purple_utf8_strcasecmp(p_cmd, "save")) + { + if(!purple_utf8_strcasecmp(p_args[0], "yes")) + { + if(!chat->purple_chat) + purple_blist_request_add_chat(purple_conversation_get_account(p_conv), NULL, NULL, chat->topic); + else + gfire_chat_set_saved(chat, TRUE); - t = gfire_find_buddy_in_list(gfchat->members, (gpointer *)gcm->uid, GFFB_UIDBIN); - if ( t && (m = (gfire_buddy *)t->data)) { - purple_conv_chat_remove_user(PURPLE_CONV_CHAT(gfchat->c), m->name, NULL); + return PURPLE_CMD_RET_OK; + } + else if(!purple_utf8_strcasecmp(p_args[0], "no")) + { + gfire_chat_set_saved(chat, FALSE); + return PURPLE_CMD_RET_OK; + } + else + { + *p_error = g_strdup_printf(_("Unknown argument: %s"), p_args[0]); + return PURPLE_CMD_RET_FAILED; } } - /* free gcm */ - if (gcm->chat_id) g_free(gcm->chat_id); - if (gcm->uid) g_free(gcm->uid); - if (gcm->im_str) g_free(gcm->im_str); - g_free(gcm); -} - + // Change room name command + else if(!purple_utf8_strcasecmp(p_cmd, "rename")) + { + if(!purple_utf8_strcasecmp(chat->topic, p_args[0])) + { + *p_error = g_strdup(_("New and old name are identical. Please note that chat room names have no case.")); + return PURPLE_CMD_RET_FAILED; + } + else + { + guint16 len = gfire_chat_proto_create_change_topic(chat->chat_id, p_args[0]); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + } + // Change password command + else if(!purple_utf8_strcasecmp(p_cmd, "password")) + { + guint16 len = gfire_chat_proto_create_change_password(chat->chat_id, p_args[0]); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + // Change visibility command + else if(!purple_utf8_strcasecmp(p_cmd, "visibility")) + { + if(!purple_utf8_strcasecmp(p_args[0], "public")) + { + guint16 len = gfire_chat_proto_create_change_access(chat->chat_id, Public); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + else if(!purple_utf8_strcasecmp(p_args[0], "friends")) + { + guint16 len = gfire_chat_proto_create_change_access(chat->chat_id, Friends); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + else + { + *p_error = g_strdup_printf(_("Unknown visibility: %s"), p_args[0]); + return PURPLE_CMD_RET_FAILED; + } + } + // Silence command + else if(!purple_utf8_strcasecmp(p_cmd, "silence")) + { + if(!purple_utf8_strcasecmp(p_args[0], "on")) + { + guint16 len = gfire_chat_proto_create_change_silenced(chat->chat_id, TRUE); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + else if(!purple_utf8_strcasecmp(p_args[0], "off")) + { + guint16 len = gfire_chat_proto_create_change_silenced(chat->chat_id, FALSE); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + else + { + *p_error = g_strdup_printf(_("Unknown argument: %s"), p_args[0]); + return PURPLE_CMD_RET_FAILED; + } + } + // User-Join/Leave-Messages command + else if(!purple_utf8_strcasecmp(p_cmd, "userjoinmsg")) + { + if(!purple_utf8_strcasecmp(p_args[0], "on")) + { + guint16 len = gfire_chat_proto_create_change_show_join_leave(chat->chat_id, TRUE); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + else if(!purple_utf8_strcasecmp(p_args[0], "off")) + { + guint16 len = gfire_chat_proto_create_change_show_join_leave(chat->chat_id, FALSE); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + else + { + *p_error = g_strdup_printf(_("Unknown argument: %s"), p_args[0]); + return PURPLE_CMD_RET_FAILED; + } + } + // Change user permission command + else if(!purple_utf8_strcasecmp(p_cmd, "permission")) + { + if(chat->own_permission < Moderator) + { + *p_error = g_strdup(_("You are not allowed to grant/revoke any permissions.")); + return PURPLE_CMD_RET_FAILED; + } -void gfire_chat_user_join(PurpleConnection *gc, gfire_chat_msg *gcm) -{ - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - gfire_buddy *m = NULL; - PurpleConvChatBuddyFlags f; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !gfire->chats - || !gcm ||!(gcm->chat_id)) return; - - t = gfire_find_chat(gfire->chats, (gpointer *)gcm->chat_id, GFFC_CID); - if (t && (gfchat = (gfire_chat *)t->data)) { - m = gcm->b; - /* we need to supress our own join messages, otherwise we show up on the userlist twice */ - if (memcmp(m->userid, gfire->userid, XFIRE_USERID_LEN) != 0) { - switch(m->chatperm) { - case 01: - f = PURPLE_CBFLAGS_NONE; - break; - - case 02: - f = PURPLE_CBFLAGS_NONE; + gfire_buddy *buddy = NULL; + GList *cur = chat->members; + while(cur) + { + if(!purple_utf8_strcasecmp(((gfire_buddy*)cur->data)->name, p_args[0])) + { + buddy = (gfire_buddy*)cur->data; break; - - case 03: - f = PURPLE_CBFLAGS_VOICE; - break; - - case 04: - f = PURPLE_CBFLAGS_HALFOP; - break; - - case 05: - f = PURPLE_CBFLAGS_OP; + } + + cur = g_list_next(cur); + } + + if(!buddy) + { + *p_error = g_strdup_printf(_("Unknown buddy: %s"), p_args[0]); + return PURPLE_CMD_RET_FAILED; + } + + if(gfire_is_self(gfire, buddy->userid)) + { + *p_error = g_strdup(_("You can't change your own permission!")); + return PURPLE_CMD_RET_FAILED; + } + + guint32 permission; + if(!purple_utf8_strcasecmp("muted", p_args[1])) + permission = Muted; + else if(!purple_utf8_strcasecmp("normal", p_args[1])) + permission = Normal; + else if(!purple_utf8_strcasecmp("power", p_args[1])) + permission = Power_User; + else if(!purple_utf8_strcasecmp("moderator", p_args[1])) + { + if(chat->own_permission != Admin) + { + *p_error = g_strdup(_("You are not allowed to grant this permission.")); + return PURPLE_CMD_RET_FAILED; + } + permission = Moderator; + } + else if(!purple_utf8_strcasecmp("admin", p_args[1])) + { + if(chat->own_permission != Admin) + { + *p_error = g_strdup(_("You are not allowed to grant this permission.")); + return PURPLE_CMD_RET_FAILED; + } + permission = Admin; + } + else + { + *p_error = g_strdup_printf(_("Unknown permission: %s"), p_args[1]); + return PURPLE_CMD_RET_FAILED; + } + + guint16 len = gfire_chat_proto_create_change_buddy_permissions(chat->chat_id, buddy->userid, permission); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + // Kick buddy command + else if(!purple_utf8_strcasecmp(p_cmd, "kick")) + { + if(chat->own_permission < Moderator) + { + *p_error = g_strdup(_("You are not allowed to kick buddies.")); + return PURPLE_CMD_RET_FAILED; + } + + gfire_buddy *buddy = NULL; + GList *cur = chat->members; + while(cur) + { + if(!purple_utf8_strcasecmp(((gfire_buddy*)cur->data)->name, p_args[0])) + { + buddy = (gfire_buddy*)cur->data; break; - - default: - f = PURPLE_CBFLAGS_NONE; + } + + cur = g_list_next(cur); } - purple_conv_chat_add_user(PURPLE_CONV_CHAT(gfchat->c), m->name, NULL, f, TRUE); - gfchat->members = g_list_append(gfchat->members, m); - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(group chat): supressing own join message\n"); - /* free the buddy we already have it in the list */ - if (NULL != m->name) g_free(m->name); - if (NULL != m->alias) g_free(m->alias); - if (NULL != m->userid) g_free(m->userid); - g_free(m); + + if(!buddy) + { + *p_error = g_strdup_printf(_("Unknown buddy: %s"), p_args[0]); + return PURPLE_CMD_RET_FAILED; } + + if(gfire_is_self(gfire, buddy->userid)) + { + *p_error = g_strdup(_("You can't kick yourself!")); + return PURPLE_CMD_RET_FAILED; + } + + guint16 len = gfire_chat_proto_create_kick_buddy(chat->chat_id, buddy->userid); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; } - - /* free gcm */ - if (gcm->chat_id) g_free(gcm->chat_id); - if (gcm->uid) g_free(gcm->uid); - if (gcm->im_str) g_free(gcm->im_str); - g_free(gcm); + // Change default permission command + else if(!purple_utf8_strcasecmp(p_cmd, "def_permission")) + { + if(chat->own_permission < Moderator) + { + *p_error = g_strdup(_("You are not allowed to change the default permission.")); + return PURPLE_CMD_RET_FAILED; + } + guint32 permission; + if(!purple_utf8_strcasecmp("muted", p_args[0])) + permission = Muted; + else if(!purple_utf8_strcasecmp("normal", p_args[0])) + permission = Normal; + else if(!purple_utf8_strcasecmp("power", p_args[0])) + permission = Power_User; + else if(!purple_utf8_strcasecmp("moderator", p_args[0])) + { + if(chat->own_permission != Admin) + { + *p_error = g_strdup(_("You are not allowed to set this default permission.")); + return PURPLE_CMD_RET_FAILED; + } + permission = Moderator; + } + else if(!purple_utf8_strcasecmp("admin", p_args[0])) + { + if(chat->own_permission != Admin) + { + *p_error = g_strdup(_("You are not allowed to set this default permission.")); + return PURPLE_CMD_RET_FAILED; + } + permission = Admin; + } + else + { + *p_error = g_strdup_printf(_("Unknown permission: %s"), p_args[1]); + return PURPLE_CMD_RET_FAILED; + } + + guint16 len = gfire_chat_proto_create_set_default_permission(chat->chat_id, permission); + if(len > 0) gfire_send(gfire_get_connection(gfire), len); + return PURPLE_CMD_RET_OK; + } + return PURPLE_CMD_RET_FAILED; } -void gfire_chat_change_motd(PurpleConnection *gc, int id, const char *topic) +static PurpleCmdId gfire_chat_save_cmd; +static PurpleCmdId gfire_chat_rename_cmd; +static PurpleCmdId gfire_chat_password_cmd; +static PurpleCmdId gfire_chat_visibility_cmd; +static PurpleCmdId gfire_chat_silence_cmd; +static PurpleCmdId gfire_chat_userjoinmsg_cmd; +static PurpleCmdId gfire_chat_permission_cmd; +static PurpleCmdId gfire_chat_kick_cmd; +static PurpleCmdId gfire_chat_def_perm_cmd; + +void gfire_chat_register_commands() { - gfire_data *gfire = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - int len = 0; + gfire_chat_save_cmd = purple_cmd_register("save", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("save <yes|no>:
Save the current chat room on Xfire. " + "This preserves all of the chat rooms settings and privileges. " + "On "yes", you will be asked to save the chat room to " + "your buddy list if it is not already there. If you decline this " + "request the save will NOT be performed."), NULL); + + gfire_chat_rename_cmd = purple_cmd_register("rename", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("rename <new-chat-name>:
Changes the current name for this " + "room.

Requires "Admin" permission."), NULL); + + gfire_chat_password_cmd = purple_cmd_register("password", "s", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("password [<new-password>]:
Changes the current password for " + "this room. "/password" results in removing the current " + "password.

Requires "Admin" permission."), NULL); + + gfire_chat_visibility_cmd = purple_cmd_register("visibility", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("visibilty <public|friends>:
Changes the current visibility " + "for this room.

Requires "Admin" permission."), + NULL); + + gfire_chat_silence_cmd = purple_cmd_register("silence", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("silence <on|off>:
Sets whether non-Moderators and non-Admins " + "should not be able to talk in this room.

Requires " + ""Moderator" or higher permission."), NULL); + + gfire_chat_userjoinmsg_cmd = purple_cmd_register("userjoinmsg", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("userjoinmsg <on|off>:
Set whether "<User> " + "joined" and "<User> left" messages should be " + "displayed in this room.

Requires " + ""Moderator" or higher permission."), NULL); + + gfire_chat_permission_cmd = purple_cmd_register("permission", "ww", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("permission <username> <muted|normal|power|moderator|admin>:" + "
Set username's permission. Only admins may give other users " + "the "Admin" permission.
Please note, that you can't " + "change your own permission.

Requires "Moderator" " + "or higher permission."), NULL); + + gfire_chat_kick_cmd = purple_cmd_register("kick", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("kick <username>:
Kicks username from the channel." + "

Requires "Moderator" " + "or higher permission."), NULL); + + gfire_chat_def_perm_cmd = purple_cmd_register("def_permission", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, + GFIRE_PRPL_ID, gfire_chat_command_handler, + _("def_permission <muted|normal|power|moderator|admin>:" + "
Set this room's default permission. New buddies who join this " + "room will have this permission

Requires " + ""Moderator" or higher permission."), NULL); +} - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !topic) return -1; +void gfire_chat_unregister_commands() +{ + purple_cmd_unregister(gfire_chat_save_cmd); + purple_cmd_unregister(gfire_chat_rename_cmd); + purple_cmd_unregister(gfire_chat_password_cmd); + purple_cmd_unregister(gfire_chat_visibility_cmd); + purple_cmd_unregister(gfire_chat_silence_cmd); + purple_cmd_unregister(gfire_chat_userjoinmsg_cmd); + purple_cmd_unregister(gfire_chat_permission_cmd); + purple_cmd_unregister(gfire_chat_kick_cmd); + purple_cmd_unregister(gfire_chat_def_perm_cmd); +} - t = gfire_find_chat(gfire->chats, (gpointer *)GINT_TO_POINTER(id), GFFC_PURPLEID); - if (!t || !(gfchat = (gfire_chat *)t->data)) return -1; +gboolean gfire_chat_is_by_topic(const gfire_chat *p_chat, const gchar *p_topic) +{ + return (p_chat && p_topic && !purple_utf8_strcasecmp(p_chat->topic, p_topic)); +} - topic = purple_unescape_html(topic); - - if (strlen(topic) > 200) { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_WARNING, "Xfire Groupchat", "Topic change failed", "The topic contains more than 200 characters.", NULL, NULL); - return -1; - } - - if ((len = gfire_create_change_motd(gc, gfchat->chat_id, topic))) { - gfire_send(gc, gfire->buff_out, len); - return 1; - } +gboolean gfire_chat_is_by_chat_id(const gfire_chat *p_chat, const guint8 *p_chat_id) +{ + return (p_chat && p_chat_id && !memcmp(p_chat->chat_id, p_chat_id, XFIRE_CHATID_LEN)); +} - return -1; +gboolean gfire_chat_is_by_purple_id(const gfire_chat *p_chat, const gint p_purple_id) +{ + return (p_chat && p_chat->c && purple_conv_chat_get_id(PURPLE_CONV_CHAT(p_chat->c)) == p_purple_id); +} +gboolean gfire_chat_is_by_purple_chat(const gfire_chat *p_chat, const PurpleChat *p_purple_chat) +{ + return (p_chat && p_purple_chat && p_chat->purple_chat == p_purple_chat); } +typedef struct +{ + gfire_data *gfire; + guint8 *chat_id; +} gfire_chat_rejoin_data; + +static void gfire_chat_rejoin_cb(gfire_chat_rejoin_data *p_data, const gchar *p_password) +{ + if(!p_data || !p_password) + return; + + gfire_chat_join(p_data->chat_id, NULL, p_password, gfire_get_connection(p_data->gfire)); + + g_free(p_data->chat_id); + g_free(p_data); +} + +static void gfire_chat_rejoin_cancel_cb(gfire_chat_rejoin_data *p_data) +{ + if(p_data) + { + g_free(p_data->chat_id); + g_free(p_data); + } +} + +void gfire_chat_request_password_rejoin(gfire_data *p_gfire, guint8 *p_chat_id, gboolean p_password_given) +{ + if(!p_gfire || !p_chat_id) + return; + + const gchar *msg = NULL; + const gchar *title = NULL; + if(p_password_given) + { + msg = _("You attempted to join a chat room using an invalid password. Please try again."); + title = _("Invalid password"); + } + else + { + msg = _("You attempted to join a chat room that is password protected. Please try again."); + title = _("Password required"); + } + + gfire_chat_rejoin_data *data = g_malloc(sizeof(gfire_chat_rejoin_data)); + data->chat_id = p_chat_id; + data->gfire = p_gfire; + + purple_request_input(gfire_get_connection(p_gfire), title, + NULL, msg, NULL, FALSE, TRUE, NULL, _("Join"), G_CALLBACK(gfire_chat_rejoin_cb), + _("Cancel"), G_CALLBACK(gfire_chat_rejoin_cancel_cb), + purple_connection_get_account(gfire_get_connection(p_gfire)), + NULL, NULL, data); +} diff -Nru gfire-0.8.3/src/gf_chat.h gfire-0.9.4/src/gf_chat.h --- gfire-0.8.3/src/gf_chat.h 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_chat.h 2011-03-14 20:25:51.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -19,42 +18,108 @@ * You should have received a copy of the GNU General Public License * along with Gfire. If not, see . */ + #ifndef _GF_CHAT_H #define _GF_CHAT_H -#include "gfire.h" +typedef struct _gfire_chat gfire_chat; -typedef struct _gfire_chat gfire_chat; +#include "gf_base.h" +#include "gf_buddies.h" +#include "gf_chat_proto.h" +#include "gfire.h" -struct _gfire_chat { - int purple_id; /* purple chat id */ - GList *members; /* glist of _gfire_buddy structs */ - guint8 *chat_id; /* xfire chat id */ - gchar *topic; /* channel topic */ - gchar *motd; /* motd */ - PurpleConversation *c; /* purple conv instance */ +// GFIRE CHAT SYSTEM //////////////////////////////////////////////// +typedef enum +{ + Muted = 1, + Normal = 2, + Power_User = 3, + Moderator = 4, + Admin = 5 +} gfire_chat_privilege; + +typedef enum +{ + Public = 1, + Friends = 2 +} gfire_chat_visibility; + +// Gfire Chat Struct +struct _gfire_chat +{ + gfire_data *owner; + guint32 purple_id; // purple chat id + GList *members; // glist of _gfire_buddy structs + guint8 *chat_id; // xfire chat id + gchar *topic; // channel topic + gchar *motd; // motd + PurpleConversation *c; // purple conv instance + PurpleChat *purple_chat;// purple buddy list chat + guint32 own_permission; + guint32 def_permission; + guint32 accessibility; + gboolean secure; + gboolean silenced; + gboolean show_join_leave; }; -/* gfire_find_chat() modes */ -#define GFFC_CID 0 -#define GFFC_PURPLEID 1 - - -void gfire_join_chat(PurpleConnection *gc, GHashTable *components); -void gfire_reject_chat(PurpleConnection *gc, GHashTable *components); - -void gfire_read_chat_invite(PurpleConnection *gc, int packet_len); -GList *gfire_chat_info(PurpleConnection *gc); -GHashTable *gfire_chat_info_defaults(PurpleConnection *gc, const char *chat_name); -char *gfire_get_chat_name(GHashTable *data); -void gfire_chat_invite(PurpleConnection *gc, int id, const char *message, const char *who); -void gfire_chat_leave(PurpleConnection *gc, int id); -int gfire_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags); -void gfire_chat_joined(PurpleConnection *gc, GList *members, guint8 *chat_id, gchar *topic, gchar *motd); -GList *gfire_find_chat(GList *chats, gpointer *data, int mode); -void gfire_chat_got_msg(PurpleConnection *gc, gfire_chat_msg *gcm); -void gfire_chat_user_leave(PurpleConnection *gc, gfire_chat_msg *gcm); -void gfire_chat_user_join(PurpleConnection *gc, gfire_chat_msg *gcm); -void gfire_chat_change_motd(PurpleConnection *gc, int id, const char *topic); +// Creation and freeing +gfire_chat *gfire_chat_create(gfire_data *p_owner, const guint8 *p_id, const gchar *p_topic, + const gchar *p_motd, gboolean p_force_add); +void gfire_chat_free(gfire_chat *p_chat); + +// Member handling +gfire_buddy *gfire_chat_find_user(gfire_chat *p_chat, guint32 p_userid); +void gfire_chat_add_user(gfire_chat *p_chat, gfire_buddy *p_buddy, guint32 p_perm, gboolean p_joined); +void gfire_chat_user_left(gfire_chat *p_chat, guint32 p_userid, gboolean p_kicked); +void gfire_chat_buddy_permission_changed(gfire_chat *p_chat, guint32 p_userid, guint32 p_perm); + +// Receiving and sending messages +void gfire_chat_got_msg(gfire_chat *p_chat, guint32 p_userid, const gchar *p_msg); +void gfire_chat_send(gfire_chat *p_chat, const gchar *p_msg); + +// Joining and leaving +void gfire_chat_join(const guint8 *p_chat_id, const gchar *p_room, const gchar *p_pass, PurpleConnection *p_gc); +void gfire_chat_leave(gfire_chat *p_chat); + +// Topic +void gfire_chat_set_topic(gfire_chat *p_chat, const gchar *p_topic, gboolean p_notify); + +// MotD +void gfire_chat_set_motd(gfire_chat *p_chat, const gchar *p_motd, gboolean p_notify); +void gfire_chat_change_motd(gfire_chat *p_chat, const gchar *p_motd); + +// Flags +// Internal +void gfire_chat_set_default_permission(gfire_chat *p_chat, guint32 p_permission, gboolean p_notify); +void gfire_chat_set_accessibility(gfire_chat *p_chat, guint32 p_accessibility, gboolean p_notify); +void gfire_chat_set_secure(gfire_chat *p_chat, gboolean p_secure, gboolean p_notify); +void gfire_chat_set_silenced(gfire_chat *p_chat, gboolean p_silenced, gboolean p_notify); +void gfire_chat_set_show_join_leave(gfire_chat *p_chat, gboolean p_show, gboolean p_notify); + +// Inviting +void gfire_chat_invite(gfire_chat *p_chat, const gfire_buddy *p_buddy); +void gfire_chat_reject(guint8 *p_chat_id, PurpleConnection *p_gc); + +// Saving +void gfire_chat_set_saved(gfire_chat *p_chat, gboolean p_save); + +// Purple +void gfire_chat_show(gfire_chat *p_chat); +void gfire_chat_set_purple_chat(gfire_chat *p_chat, PurpleChat *p_purple_chat); + +// Chat commands +void gfire_chat_register_commands(); +void gfire_chat_unregister_commands(); + +// Identification +gboolean gfire_chat_is_by_topic(const gfire_chat *p_chat, const gchar *p_topic); +gboolean gfire_chat_is_by_chat_id(const gfire_chat *p_chat, const guint8 *p_chat_id); +gboolean gfire_chat_is_by_purple_id(const gfire_chat *p_chat, const gint p_purple_id); +gboolean gfire_chat_is_by_purple_chat(const gfire_chat *p_chat, const PurpleChat *p_purple_chat); + +// Internal +void gfire_chat_request_password_rejoin(gfire_data *p_gfire, guint8 *p_chat_id, gboolean p_password_given); -#endif /* _GF_CHAT_H */ +#endif // _GF_CHAT_H diff -Nru gfire-0.8.3/src/gf_chat_proto.c gfire-0.9.4/src/gf_chat_proto.c --- gfire-0.8.3/src/gf_chat_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_chat_proto.c 2011-03-14 20:25:46.000000000 +0000 @@ -0,0 +1,1271 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_protocol.h" +#include "gfire.h" +#include "gf_chat.h" +#include "gf_chat_proto.h" +#include "gf_network.h" + +guint16 gfire_chat_proto_create_join(const guint8 *p_id, const gchar *p_room, const gchar *p_pass) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if (!p_room || (strlen(p_room) == 0) || !p_id) + { + + purple_debug(PURPLE_DEBUG_ERROR, "gfire", + "gfire_chat_proto_create_join_chat: invalid parameter to gfire_chat_proto_create_join room=%s\n", NN(p_room)); + return 0; + } + + guint32 climsg = GUINT32_TO_LE(0x4CF4); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 6, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_id, XFIRE_CHATID_LEN, offset); + + guint32 requestIndex = GUINT32_TO_LE(1); + offset = gfire_proto_write_attr_bs(0x0B, 0x02, &requestIndex, sizeof(requestIndex), offset); + + guint32 chatRoomType = GUINT32_TO_LE(1); + offset = gfire_proto_write_attr_bs(0xAA, 0x02, &chatRoomType, sizeof(chatRoomType), offset); + + offset = gfire_proto_write_attr_bs(0x05, 0x01, p_room, strlen(p_room), offset); + + offset = gfire_proto_write_attr_bs(0x5F, 0x01, p_pass, p_pass ? strlen(p_pass) : 0, offset); + + guint8 autoName = 0; + offset = gfire_proto_write_attr_bs(0xA7, 0x08, &autoName, sizeof(autoName), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_leave(const guint8 *p_cid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if (!p_cid) return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CF5); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 1, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_message(const guint8 *p_cid, const gchar *p_message) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if (!p_message || !p_cid || (strlen(p_message) == 0)) return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CF6); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + offset = gfire_proto_write_attr_bs(0x2E, 0x01, p_message, strlen(p_message), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_invite(const guint8 *p_cid, guint32 p_userid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if (!p_cid) return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CFC); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + GList *users = g_list_append(NULL, &p_userid); + offset = gfire_proto_write_attr_list_bs(0x18, users, 0x02, sizeof(p_userid), offset); + g_list_free(users); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_request_persistent_infos(GList *p_cids) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cids) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CFA); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 1, offset); + + offset = gfire_proto_write_attr_list_bs(0x04, p_cids, 0x06, XFIRE_CHATID_LEN, offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_motd(const guint8 *p_cid, const gchar* p_motd) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid || !p_motd || (strlen(p_motd) == 0)) return 0; + + guint32 climsg = GUINT32_TO_LE(0x4D0C); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + offset = gfire_proto_write_attr_bs(0x2E, 0x01, p_motd, strlen(p_motd), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_reject(const guint8 *p_cid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CFF); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 1, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_save_chat_room(const guint8 *p_cid, gboolean p_save) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CFD); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + guint8 save = p_save ? 1 : 0; + offset = gfire_proto_write_attr_bs(0x2A, 0x08, &save, sizeof(save), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_topic(const guint8 *p_cid, const gchar *p_topic) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid || !p_topic) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CF8); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + offset = gfire_proto_write_attr_bs(0x05, 0x01, p_topic, strlen(p_topic), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_kick_buddy(const guint8 *p_cid, guint32 p_userid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CFB); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + p_userid = GUINT32_TO_LE(p_userid); + offset = gfire_proto_write_attr_bs(0x18, 0x02, &p_userid, sizeof(p_userid), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_buddy_permissions(const guint8 *p_cid, guint32 p_userid, guint32 p_permission) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4CF9); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 3, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + p_userid = GUINT32_TO_LE(p_userid); + offset = gfire_proto_write_attr_bs(0x18, 0x02, &p_userid, sizeof(p_userid), offset); + + p_permission = GUINT32_TO_LE(p_permission); + offset = gfire_proto_write_attr_bs(0x13, 0x02, &p_permission, sizeof(p_permission), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_set_default_permission(const guint8 *p_cid, guint32 p_permission) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4D08); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + p_permission = GUINT32_TO_LE(p_permission); + offset = gfire_proto_write_attr_bs(0x13, 0x02, &p_permission, sizeof(p_permission), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_password(const guint8 *p_cid, const gchar *p_password) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid || !p_password) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4D15); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + offset = gfire_proto_write_attr_bs(0x5F, 0x01, p_password, strlen(p_password), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_access(const guint8 *p_cid, guint32 p_access) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4D16); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + p_access = GUINT32_TO_LE(p_access); + offset = gfire_proto_write_attr_bs(0x17, 0x02, &p_access, sizeof(p_access), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_silenced(const guint8 *p_cid, gboolean p_silenced) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4D17); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + guint8 silenced = p_silenced ? 1 : 0; + offset = gfire_proto_write_attr_bs(0x16, 0x08, &silenced, sizeof(silenced), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +guint16 gfire_chat_proto_create_change_show_join_leave(const guint8 *p_cid, gboolean p_show) +{ + guint32 offset = XFIRE_HEADER_LEN; + + if(!p_cid) + return 0; + + guint32 climsg = GUINT32_TO_LE(0x4D18); + offset = gfire_proto_write_attr_ss("climsg", 0x02, &climsg, sizeof(climsg), offset); + + offset = gfire_proto_write_attr_ss("msg", 0x09, NULL, 2, offset); + + offset = gfire_proto_write_attr_bs(0x04, 0x06, p_cid, XFIRE_CHATID_LEN, offset); + + guint8 show = p_show ? 1 : 0; + offset = gfire_proto_write_attr_bs(0x1B, 0x08, &show, sizeof(show), offset); + + gfire_proto_write_header(offset, 0x19, 2, 0); + + return offset; +} + +void gfire_chat_proto_persistent_chats(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + GList *chat_ids = NULL; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &chat_ids, 0x04, offset); + if(offset == -1 || !chat_ids) + return; + + // Directly request further information on the rooms + guint16 len = gfire_chat_proto_create_request_persistent_infos(chat_ids); + if(len > 0) gfire_send(gfire_get_connection(p_gfire), len); + + gfire_list_clear(chat_ids); +} + +void gfire_chat_proto_persistent_chat_infos(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + GList *chat_ids = NULL; + GList *chat_types = NULL; + GList *chat_names = NULL; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &chat_ids, 0x04, offset); + if(offset == -1 || !chat_ids) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &chat_types, 0xAA, offset); + if(offset == -1 || !chat_types) + { + gfire_list_clear(chat_ids); + return; + } + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &chat_names, 0x05, offset); + if(offset == -1 || !chat_names) + { + gfire_list_clear(chat_ids); + gfire_list_clear(chat_types); + return; + } + + GList *chat_id = chat_ids; + GList *chat_type = chat_types; + GList *chat_name = chat_names; + while(chat_id && chat_type && chat_name) + { + // We only want normal chats + if(*((guint32*)chat_type->data) == 1) + { + gfire_chat *chat = gfire_find_chat(p_gfire, chat_id->data, GFFC_CID); + if(!chat) + { + gfire_chat_create(p_gfire, chat_id->data, chat_name->data, NULL, TRUE); + gfire_add_chat(p_gfire, chat); + } + else + { + gfire_chat_set_topic(chat, chat_name->data, FALSE); + } + } + + chat_id = g_list_next(chat_id); + chat_type = g_list_next(chat_type); + chat_name = g_list_next(chat_name); + } + + gfire_list_clear(chat_ids); + gfire_list_clear(chat_types); + gfire_list_clear(chat_names); +} + +void gfire_chat_proto_join_info(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + gfire_chat *chat = NULL; + guint8 *chat_id = NULL; + guint32 requestID = 0; + guint32 response = 0; + guint32 my_permission = 0; + guint32 access = 0; + guint32 type = 0; + gchar *topic = NULL; + gchar *motd = NULL; + gboolean new_room = FALSE; + gboolean secure = FALSE; + gboolean silenced = FALSE; + gboolean show_join_leave = FALSE; + + if (!p_gfire || (p_packet_len == 0)) return; + + // xfire chat id + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + // requestID + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &requestID, 0x0B, offset); + if(offset == -1) + return; + + // response + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &response, 0x0C, offset); + if(offset == -1) + return; + + // Password required but not given + if(response == 4) + { + // Chat ID will be freed by the function + gfire_chat_request_password_rejoin(p_gfire, chat_id, FALSE); + return; + } + // Wrong password given + else if(response == 5) + { + // Chat ID will be freed by the function + gfire_chat_request_password_rejoin(p_gfire, chat_id, TRUE); + return; + } + // Other failure + else if(response != 0) + { + purple_notify_error(gfire_get_connection(p_gfire), _("Chat room join error"), _("Unknown error"), + _("Unknown join error. You might be blocked from this chat room or are already in 5 rooms.")); + g_free(chat_id); + return; + } + + // own permission + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &my_permission, 0x12, offset); + if(offset == -1) + { + g_free(chat_id); + return; + } + + // accessibility (public / private) + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &access, 0x17, offset); + if(offset == -1) + { + g_free(chat_id); + return; + } + + // chat room type (normal / live broadcast) + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &type, 0xAA, offset); + if(offset == -1) + { + g_free(chat_id); + return; + } + + // topic + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &topic, 0x05, offset); + if(offset == -1 || !topic) + { + g_free(chat_id); + return; + } + + // message of the day + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &motd, 0x4D, offset); + if(offset == -1 || !motd) + { + g_free(chat_id); + g_free(topic); + return; + } + + // new room + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &new_room, 0xA5, offset); + if(offset == -1) + { + g_free(chat_id); + g_free(topic); + g_free(motd); + return; + } + + // password protected + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &secure, 0xA6, offset); + if(offset == -1) + { + g_free(chat_id); + g_free(topic); + g_free(motd); + return; + } + + // silenced + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &silenced, 0x16, offset); + if(offset == -1) + { + g_free(chat_id); + g_free(topic); + g_free(motd); + return; + } + + // show join/leave messages + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &show_join_leave, 0x1B, offset); + if(offset == -1) + { + g_free(chat_id); + g_free(topic); + g_free(motd); + return; + } + + // packet has been parsed + + gboolean created = FALSE; + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + // Create a new chat with the correct values + created = TRUE; + chat = gfire_chat_create(p_gfire, chat_id, topic, motd, FALSE); + } + else + { + // Set current values + gfire_chat_set_topic(chat, topic, FALSE); + gfire_chat_set_motd(chat, motd, FALSE); + } + g_free(chat_id); g_free(topic); g_free(motd); + + gfire_chat_set_accessibility(chat, access, FALSE); + gfire_chat_set_secure(chat, secure, FALSE); + gfire_chat_set_silenced(chat, silenced, FALSE); + gfire_chat_set_show_join_leave(chat, show_join_leave, FALSE); + + // Add it to gfire_data and tell purple about the chat + if(created) + gfire_add_chat(p_gfire, chat); + gfire_chat_show(chat); +} + +void gfire_chat_proto_room_info(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + gfire_chat *chat = NULL; + guint8 *chat_id = NULL; + gchar *topic = NULL; + gchar *motd = NULL; + guint32 allowVoiceChat = 0; + guint32 defaultPerm = 0; + guint32 timeStamp = 0; + guint32 roomType = 0; + + gfire_buddy *m = NULL; + GList *userids, *perms, *names, *nicks; + GList *u, *p, *n, *a; + + u = p = n = a = NULL; + userids = perms = names = nicks = NULL; + + // xfire chat id + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + // chat topic / name + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &topic, 0x05, offset); + if(offset == -1 || !topic) + { + g_free(chat_id); + return; + } + + // Motd + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &motd, 0x4D, offset); + if(offset == -1 || !motd) + { + g_free(chat_id); + g_free(topic); + return; + } + + // Get the correct chat + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + return; + + gfire_chat_set_topic(chat, topic, FALSE); + gfire_chat_set_motd(chat, motd, FALSE); + g_free(chat_id); g_free(topic); g_free(motd); + + // voice chat allowed + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &allowVoiceChat, 0x4E, offset); + if(offset == -1) + return; + + // default permission + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &defaultPerm, 0x49, offset); + if(offset == -1) + return; + + gfire_chat_set_default_permission(chat, defaultPerm, FALSE); + + // time stamp? + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &timeStamp, 0x14, offset); + if(offset == -1) + return; + + // room type + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &roomType, 0x17, offset); + if(offset == -1) + return; + + // get user id's of members in chat + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &userids, 0x33, offset); + if(offset == -1 || !userids) + return; + + // get user permissions of members in chat + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &perms, 0x44, offset); + if(offset == -1 || !perms) + { + //mem cleanup code + if(userids) + g_list_free(userids); + return; + } + + // get chat member usernames + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &names, 0x42, offset); + if(offset == -1 || !names) + { + //mem cleanup code + if(userids) + g_list_free(userids); + if(perms) + g_list_free(perms); + return; + } + + // get chat member aliases + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &nicks, 0x43, offset); + if(offset == -1 || !nicks) + { + //mem cleanup code + if(userids) + g_list_free(userids); + if(perms) + g_list_free(perms); + if(names) + g_list_free(names); + return; + } + + // packet has been parsed + + n = names; p = perms; a = nicks; u = userids; + + while(u && p && a && u) + { + if(!gfire_is_self(p_gfire, *(guint32*)u->data)) + { + m = gfire_buddy_create(*(guint32*)u->data, (gchar*)n->data, (gchar*)a->data, GFBT_GROUPCHAT); + gfire_chat_add_user(chat, m, *(guint32*)p->data, FALSE); + } + + g_free(u->data); g_free(n->data); + g_free(a->data); g_free(p->data); + u = g_list_next(u); n = g_list_next(n); + a = g_list_next(a); p = g_list_next(p); + } + + g_list_free(names); g_list_free(perms); g_list_free(nicks); g_list_free(userids); +} + + +void gfire_chat_proto_msg(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 userid = 0; + gchar *msg = NULL; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_msg: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x01, offset); + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &msg, 0x2E, offset); + + gfire_chat_got_msg(chat, userid, msg); + + g_free(msg); +} + + +void gfire_chat_proto_user_leave(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 userid = 0; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_user_leave: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x01, offset); + + gfire_chat_user_left(chat, userid, FALSE); +} + + +void gfire_chat_proto_user_join(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 userid = 0; + gchar *name = NULL; + gchar *nick = NULL; + guint32 perm = 0; + gfire_buddy *gf_buddy = NULL; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_user_leave: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x01, offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &name, 0x02, offset); + if(offset == -1 || !name) + { + return; + } + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &nick, 0x0D, offset); + if(offset == -1 || !nick) + { + g_free(name); + return; + } + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &perm, 0x12, offset); + if(offset == -1) + return; + + gf_buddy = gfire_buddy_create(userid, name, nick, GFBT_GROUPCHAT); + gfire_chat_add_user(chat, gf_buddy, perm, TRUE); + + purple_debug(PURPLE_DEBUG_MISC, "gfire", "groupchat join, userid: %u, username: %s, alias: %s\n", + userid, NN(name), NN(nick)); + + g_free(name); + g_free(nick); +} + + + +void gfire_chat_proto_motd_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + gchar *motd = NULL; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_motd_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &motd, 0x2E, offset); + if(offset == -1 || !motd) + return; + + gfire_chat_set_motd(chat, motd, TRUE); + g_free(motd); +} + +void gfire_chat_proto_buddy_permission_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 userid = 0; + guint32 perm = 0; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_buddy_permission_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x18, offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &perm, 0x13, offset); + if(offset == -1) + return; + + gfire_chat_buddy_permission_changed(chat, userid, perm); +} + +void gfire_chat_proto_invite(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + guint32 unknown = 0; + guint32 userid = 0; + gchar *name = NULL; + gchar *nick = NULL; + gchar *room = NULL; + GHashTable *components = NULL; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &unknown, 0xAA, offset); + if(offset == -1) + { + g_free(chat_id); + return; + } + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x01, offset); + if(offset == -1) + { + g_free(chat_id); + return; + } + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &name, 0x02, offset); + if(offset == -1 || !name) + { + g_free(chat_id); + return; + } + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &nick, 0x0D, offset); + if(offset == -1 || !nick) + { + g_free(chat_id); + g_free(name); + return; + } + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &room, 0x05, offset); + if(offset == -1 || !room) + { + g_free(chat_id); + g_free(name); + g_free(nick); + return; + } + + if(strlen(nick) == 0) + { + g_free(nick); + nick = g_strdup(name); + } + + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(chat invite): %s with alias %s invited us to room '%s'\n", + NN(name), NN(nick), NN(room)); + + // assemble ghashtable + components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + g_hash_table_replace(components, g_strdup("room"), room); + g_hash_table_replace(components, g_strdup("chat_id"), purple_base64_encode(chat_id, XFIRE_CHATID_LEN)); + + g_free(chat_id); + + serv_got_chat_invite(gfire_get_connection(p_gfire), room, nick, "", components); +} + +void gfire_chat_proto_topic_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + gchar *topic = NULL; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_topic_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &topic, 0x05, offset); + if(offset == -1 || !topic) + return; + + gfire_chat_set_topic(chat, topic, TRUE); + g_free(topic); +} + +void gfire_chat_proto_buddy_kicked(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 userid = 0; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_buddy_kicked: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x18, offset); + if(offset == -1) + return; + + gfire_chat_user_left(chat, userid, TRUE); +} + +void gfire_chat_proto_default_permission_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 permission = 0; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_default_permission_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &permission, 0x13, offset); + if(offset == -1) + return; + + gfire_chat_set_default_permission(chat, permission, TRUE); +} + +void gfire_chat_proto_password_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + gboolean secured = FALSE; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_password_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &secured, 0x5F, offset); + if(offset == -1) + return; + + gfire_chat_set_secure(chat, secured, TRUE); +} + +void gfire_chat_proto_accessibility_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 access = 0; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_accessibility_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &access, 0x17, offset); + if(offset == -1) + return; + + gfire_chat_set_accessibility(chat, access, TRUE); +} + +void gfire_chat_proto_silenced_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + guint32 userid = 0; + gboolean silenced = FALSE; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_silenced_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x01, offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &silenced, 0x16, offset); + if(offset == -1) + return; + + gfire_chat_set_silenced(chat, silenced, TRUE); +} + +void gfire_chat_proto_show_join_leave_change(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint8 *chat_id = NULL; + gfire_chat *chat = NULL; + gboolean show = FALSE; + + offset = gfire_proto_read_attr_chatid_bs(p_gfire->buff_in, &chat_id, 0x04, offset); + if(offset == -1 || !chat_id) + return; + + chat = gfire_find_chat(p_gfire, chat_id, GFFC_CID); + if(!chat) + { + g_free(chat_id); + purple_debug_error("gfire", "gfire_chat_proto_show_join_leave_change: Unknown chat id!\n"); + return; + } + + g_free(chat_id); + + offset = gfire_proto_read_attr_boolean_bs(p_gfire->buff_in, &show, 0x1B, offset); + if(offset == -1) + return; + + gfire_chat_set_show_join_leave(chat, show, TRUE); +} diff -Nru gfire-0.8.3/src/gf_chat_proto.h gfire-0.9.4/src/gf_chat_proto.h --- gfire-0.8.3/src/gf_chat_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_chat_proto.h 2011-03-14 20:25:41.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_CHAT_PROTO_H +#define _GF_CHAT_PROTO_H + +#include "gf_base.h" +#include "gfire.h" + +// Packet creation +guint16 gfire_chat_proto_create_join(const guint8 *p_id, const gchar *p_room, const gchar *p_pass); +guint16 gfire_chat_proto_create_leave(const guint8 *p_cid); +guint16 gfire_chat_proto_create_message(const guint8 *p_cid, const gchar *p_message); +guint16 gfire_chat_proto_create_invite(const guint8 *p_cid, guint32 p_userid); +guint16 gfire_chat_proto_create_request_persistent_infos(GList *p_cids); +guint16 gfire_chat_proto_create_change_motd(const guint8 *p_cid, const gchar* p_motd); +guint16 gfire_chat_proto_create_reject(const guint8 *p_cid); +guint16 gfire_chat_proto_create_save_chat_room(const guint8 *p_cid, gboolean p_save); +guint16 gfire_chat_proto_create_change_topic(const guint8 *p_cid, const gchar *p_topic); +guint16 gfire_chat_proto_create_kick_buddy(const guint8 *p_cid, guint32 p_userid); +guint16 gfire_chat_proto_create_change_buddy_permissions(const guint8 *p_cid, guint32 p_userid, guint32 p_permission); +guint16 gfire_chat_proto_create_set_default_permission(const guint8 *p_cid, guint32 p_permission); +guint16 gfire_chat_proto_create_change_password(const guint8 *p_cid, const gchar *p_password); +guint16 gfire_chat_proto_create_change_access(const guint8 *p_cid, guint32 p_access); +guint16 gfire_chat_proto_create_change_silenced(const guint8 *p_cid, gboolean p_silenced); +guint16 gfire_chat_proto_create_change_show_join_leave(const guint8 *p_cid, gboolean p_show); + +// Packet parsing +void gfire_chat_proto_persistent_chats(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_persistent_chat_infos(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_join_info(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_room_info(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_msg(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_user_leave(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_user_join(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_motd_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_buddy_permission_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_invite(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_topic_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_buddy_kicked(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_default_permission_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_password_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_accessibility_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_silenced_change(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_chat_proto_show_join_leave_change(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // _GF_CHAT_PROTO_H diff -Nru gfire-0.8.3/src/gf_debug.h gfire-0.9.4/src/gf_debug.h --- gfire-0.8.3/src/gf_debug.h 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_debug.h 2011-03-14 20:25:33.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -28,4 +27,4 @@ /* define for a binary string, so we never pass a bin array element or * deference a null binary string to purple_debug */ -#define NNA(ba, bai) (ba ? bai : 0x00) +#define NNA(ba, bai) (ba ? bai : 0x00) diff -Nru gfire-0.8.3/src/gf_file_chunk.c gfire-0.9.4/src/gf_file_chunk.c --- gfire-0.8.3/src/gf_file_chunk.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_file_chunk.c 2011-03-17 20:25:01.000000000 +0000 @@ -0,0 +1,248 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_file_chunk.h" +#include "gf_p2p_dl_proto.h" + +gfire_file_chunk *gfire_file_chunk_create(gfire_p2p_session *p_session, guint32 p_fileid, guint32 p_msgid, + PurpleXfer *p_xfer, gfire_ft_callback p_done_func, + gfire_ft_callback p_error_func, gpointer p_data) +{ + gfire_file_chunk *chunk = g_new0(gfire_file_chunk, 1); + + chunk->session = p_session; + chunk->fileid = p_fileid; + chunk->msgid = p_msgid; + + chunk->xfer = p_xfer; + + chunk->data = (guint8*)g_malloc(XFIRE_P2P_FT_CHUNK_SIZE); + + chunk->done_func = p_done_func; + chunk->error_func = p_error_func; + chunk->user_data = p_data; + + return chunk; +} + +void gfire_file_chunk_free(gfire_file_chunk *p_chunk) +{ + if(!p_chunk) + return; + + if(p_chunk->checksum) + g_free(p_chunk->checksum); + + g_free(p_chunk->data); + g_free(p_chunk); +} + +void gfire_file_chunk_init(gfire_file_chunk *p_chunk, guint64 p_offset, guint32 p_size) +{ + if(!p_chunk) + return; + + p_chunk->offset = p_offset; + p_chunk->size = p_size; + + p_chunk->data_packets_received = 0; + p_chunk->data_packet_count = p_size / XFIRE_P2P_FT_DATA_PACKET_SIZE; + if((p_size % XFIRE_P2P_FT_DATA_PACKET_SIZE) != 0) + p_chunk->data_packet_count++; + + p_chunk->last_requested = p_chunk->data_packet_count; + guint32 i = 0; + for(; i < XFIRE_P2P_FT_MAX_REQUESTS; i++) + p_chunk->requested[i] = p_chunk->data_packet_count; + + if(p_chunk->checksum) + { + g_free(p_chunk->checksum); + p_chunk->checksum = NULL; + } +} + +static gboolean gfire_file_chunk_check_checksum(gfire_file_chunk *p_chunk) +{ + if(!p_chunk) + return FALSE; + + // If we don't have a checksum yet, ignore the check for now + if(!p_chunk->checksum) + return TRUE; + + gchar hash[41]; + hashSha1_bin_to_str(p_chunk->data, p_chunk->size, hash); + hash[40] = 0; + + return (!strcmp(hash, p_chunk->checksum)); +} + +void gfire_file_chunk_set_checksum(gfire_file_chunk *p_chunk, const gchar *p_checksum) +{ + if(!p_chunk || !p_checksum) + return; + + if(p_chunk->checksum) + g_free(p_chunk->checksum); + + p_chunk->checksum = g_strdup(p_checksum); + + if(p_chunk->data_packets_received == p_chunk->data_packet_count) + { + // Check checksum and restart chunk if failed + if(!gfire_file_chunk_check_checksum(p_chunk)) + { + purple_debug_warning("gfire", "P2P: bad checksum for chunk at offset %lu\n", p_chunk->offset); + gfire_file_chunk_init(p_chunk, p_chunk->offset, p_chunk->size); + gfire_file_chunk_start_transfer(p_chunk); + return; + } + + if(p_chunk->done_func) + (*p_chunk->done_func)(p_chunk->user_data); + } +} + +guint64 gfire_file_chunk_get_offset(const gfire_file_chunk *p_chunk) +{ + return p_chunk ? p_chunk->offset : 0; +} + +guint32 gfire_file_chunk_get_size(const gfire_file_chunk *p_chunk) +{ + return p_chunk ? p_chunk->size : 0; +} + +const guint8 *gfire_file_chunk_get_data(const gfire_file_chunk *p_chunk) +{ + return p_chunk ? p_chunk->data : NULL; +} + +void gfire_file_chunk_start_transfer(gfire_file_chunk *p_chunk) +{ + if(!p_chunk || p_chunk->last_requested != p_chunk->data_packet_count) + return; + + // Request chunk info + gfire_p2p_dl_proto_send_file_chunk_info_request(p_chunk->session, p_chunk->fileid, p_chunk->offset, + p_chunk->size, 0, p_chunk->msgid++); + + guint32 requests = (p_chunk->data_packet_count > XFIRE_P2P_FT_MAX_REQUESTS) ? + XFIRE_P2P_FT_MAX_REQUESTS : p_chunk->data_packet_count; + guint32 i = 0; + for(; i < requests; i++) + { + p_chunk->requested[i] = (p_chunk->last_requested == p_chunk->data_packet_count) ? + 0 : p_chunk->last_requested + 1; + p_chunk->last_requested = p_chunk->requested[i]; + + guint64 offset = p_chunk->offset + p_chunk->requested[i] * XFIRE_P2P_FT_DATA_PACKET_SIZE; + guint32 size = ((p_chunk->last_requested == p_chunk->data_packet_count - 1) && + ((p_chunk->size % XFIRE_P2P_FT_DATA_PACKET_SIZE) != 0)) ? + p_chunk->size % XFIRE_P2P_FT_DATA_PACKET_SIZE : XFIRE_P2P_FT_DATA_PACKET_SIZE; + + gfire_p2p_dl_proto_send_file_data_packet_request(p_chunk->session, + p_chunk->fileid, + offset, size, + p_chunk->msgid++); + } +} + +void gfire_file_chunk_got_data(gfire_file_chunk *p_chunk, guint64 p_offset, guint32 p_size, const GList *p_data) +{ + if(!p_chunk || !p_data) + return; + + if(p_offset < p_chunk->offset || (p_offset + p_size) > (p_chunk->offset + p_chunk->size) || + ((p_offset - p_chunk->offset) % XFIRE_P2P_FT_DATA_PACKET_SIZE) != 0) + { + purple_debug_warning("gfire", "P2P: Got unrequested data packet!\n"); + return; + } + + const GList *cur = p_data; + guint32 pos = 0; + while(cur) + { + *(p_chunk->data + p_offset - p_chunk->offset + pos) = *((guint8*)cur->data); + cur = g_list_next(cur); + pos++; + } + + guint32 data_packet = (p_offset - p_chunk->offset) / XFIRE_P2P_FT_DATA_PACKET_SIZE; + guint32 i = 0; + for(; i < XFIRE_P2P_FT_MAX_REQUESTS; i++) + { + if(p_chunk->requested[i] == data_packet) + { + // Update the GUI + if((purple_xfer_get_bytes_sent(p_chunk->xfer) + p_size) > purple_xfer_get_size(p_chunk->xfer)) + purple_xfer_set_size(p_chunk->xfer, purple_xfer_get_bytes_sent(p_chunk->xfer) + p_size); + + purple_xfer_set_bytes_sent(p_chunk->xfer, purple_xfer_get_bytes_sent(p_chunk->xfer) + p_size); + purple_xfer_update_progress(p_chunk->xfer); + + // Is this chunk done? If so process the next one + p_chunk->data_packets_received++; + if(p_chunk->data_packets_received == p_chunk->data_packet_count) + { + // Check checksum and restart chunk if failed + if(p_chunk->checksum) + { + if(!gfire_file_chunk_check_checksum(p_chunk)) + { + purple_debug_warning("gfire", "P2P: bad checksum for chunk at offset %lu\n", p_chunk->offset); + gfire_file_chunk_init(p_chunk, p_chunk->offset, p_chunk->size); + gfire_file_chunk_start_transfer(p_chunk); + return; + } + + if(p_chunk->done_func) + (*p_chunk->done_func)(p_chunk->user_data); + } + + return; + } + + if(p_chunk->last_requested < p_chunk->data_packet_count - 1) + { + p_chunk->requested[i] = ++p_chunk->last_requested; + + guint64 offset = p_chunk->offset + p_chunk->requested[i] * XFIRE_P2P_FT_DATA_PACKET_SIZE; + guint32 size = ((p_chunk->requested[i] == p_chunk->data_packet_count - 1) && + ((p_chunk->size % XFIRE_P2P_FT_DATA_PACKET_SIZE) != 0)) ? + p_chunk->size % XFIRE_P2P_FT_DATA_PACKET_SIZE : XFIRE_P2P_FT_DATA_PACKET_SIZE; + + gfire_p2p_dl_proto_send_file_data_packet_request(p_chunk->session, + p_chunk->fileid, + offset, size, + p_chunk->msgid++); + } + else + p_chunk->requested[i] = p_chunk->data_packet_count; + + return; + } + } + + purple_debug_warning("gfire", "P2P: Got unrequested data packet!\n"); +} diff -Nru gfire-0.8.3/src/gf_file_chunk.h gfire-0.9.4/src/gf_file_chunk.h --- gfire-0.8.3/src/gf_file_chunk.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_file_chunk.h 2011-03-17 18:55:58.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_FILE_CHUNK_H +#define _GF_FILE_CHUNK_H + +typedef struct _gfire_file_chunk gfire_file_chunk; + +#include "gf_util.h" +#include "gf_p2p_session.h" + +#define XFIRE_P2P_FT_DATA_PACKET_SIZE 0x0400 // 1024 Byte +#define XFIRE_P2P_FT_MAX_REQUESTS 10 + +typedef void (*gfire_ft_callback)(gpointer*); + +struct _gfire_file_chunk +{ + // Connection + gfire_p2p_session *session; + guint32 fileid; + guint32 msgid; + + // Xfer + PurpleXfer *xfer; + + // Chunk "geometry" + guint64 offset; + guint32 size; + + // Data packets + guint32 data_packet_count; + guint32 data_packets_received; + guint32 last_requested; + guint32 requested[XFIRE_P2P_FT_MAX_REQUESTS]; + + // Chunk data + gchar *checksum; + guint8 *data; + + // Callbacks + gfire_ft_callback done_func; + gfire_ft_callback error_func; + gpointer user_data; +}; + +// Initialization and cleanup +gfire_file_chunk *gfire_file_chunk_create(gfire_p2p_session *p_session, guint32 p_fileid, guint32 p_msgid, + PurpleXfer *p_xfer, gfire_ft_callback p_done_func, + gfire_ft_callback p_error_func, gpointer p_data); +void gfire_file_chunk_free(gfire_file_chunk *p_chunk); +void gfire_file_chunk_init(gfire_file_chunk *p_chunk, guint64 p_offset, guint32 p_size); + +// Setting data +void gfire_file_chunk_set_checksum(gfire_file_chunk *p_chunk, const gchar *p_checksum); + +// Getting data +guint64 gfire_file_chunk_get_offset(const gfire_file_chunk *p_chunk); +guint32 gfire_file_chunk_get_size(const gfire_file_chunk *p_chunk); +const guint8 *gfire_file_chunk_get_data(const gfire_file_chunk *p_chunk); + +// Receiving +void gfire_file_chunk_start_transfer(gfire_file_chunk *p_chunk); +void gfire_file_chunk_got_data(gfire_file_chunk *p_chunk, guint64 p_offset, guint32 p_size, const GList *p_data); + +#endif // _GF_FILE_CHUNK_H diff -Nru gfire-0.8.3/src/gf_filetransfer.c gfire-0.9.4/src/gf_filetransfer.c --- gfire-0.8.3/src/gf_filetransfer.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_filetransfer.c 2011-03-15 19:39:50.000000000 +0000 @@ -0,0 +1,423 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifdef _WIN32 +# include +# include +# include +#else +# define _LARGEFILE64_SOURCE +# include +# include +#endif // _WIN32 + +#include "gf_filetransfer.h" +#include "gf_p2p_dl_proto.h" + +// BSD offers no 64bit functions, so just alias it +#ifdef GF_OS_BSD +# define lseek64 lseek +#endif // GF_OS_BSD + +static guint32 gfire_transfer_count = 0; + +static void gfire_filetransfer_cancel(PurpleXfer *p_xfer) +{ + if(!p_xfer) + return; + + if(purple_xfer_get_status(p_xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL) + { + gfire_filetransfer *ft = p_xfer->data; + if(!ft->aborted) + { + // Send abortion event + gfire_p2p_dl_proto_send_file_event(ft->session, ft->fileid, 1, 2); + gfire_p2p_session_remove_file_transfer(ft->session, ft, TRUE); + } + } +} + +static void gfire_filetransfer_chunk_done(gfire_filetransfer *p_transfer) +{ + // Write the data to disk + const guint8 *chunk_data = gfire_file_chunk_get_data(p_transfer->chunk); + + lseek64(p_transfer->file, gfire_file_chunk_get_offset(p_transfer->chunk), SEEK_SET); + if(write(p_transfer->file, chunk_data, gfire_file_chunk_get_size(p_transfer->chunk)) < 0) + { + purple_xfer_error(PURPLE_XFER_RECEIVE, purple_xfer_get_account(p_transfer->xfer), + purple_xfer_get_remote_user(p_transfer->xfer), + _("Writing a chunk failed! Make sure you have enough drive space " + "and appropriate permissions!")); + + // Abort the transfer + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, TRUE); + return; + } + + // Check if we're done + if(++p_transfer->current_chunk == p_transfer->chunk_count) + { + gfire_p2p_dl_proto_send_file_complete(p_transfer->session, p_transfer->fileid); + purple_xfer_set_completed(p_transfer->xfer, TRUE); + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, TRUE); + return; + } + + // Request the next chunk + guint64 offset = p_transfer->current_chunk * XFIRE_P2P_FT_CHUNK_SIZE; + guint32 size = (p_transfer->current_chunk == p_transfer->chunk_count - 1) ? + p_transfer->size % XFIRE_P2P_FT_CHUNK_SIZE : XFIRE_P2P_FT_CHUNK_SIZE; + + gfire_file_chunk_init(p_transfer->chunk, offset, size); + gfire_file_chunk_start_transfer(p_transfer->chunk); +} + +static void gfire_filetransfer_request_accepted(PurpleXfer *p_xfer) +{ + if(!p_xfer) + return; + + purple_debug_info("gfire", "P2P: file transfer request accepted\n"); + + gfire_filetransfer *ft = p_xfer->data; + +#ifdef _WIN32 + if((ft->file = _sopen(purple_xfer_get_local_filename(p_xfer), _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, + _SH_DENYNO, _S_IREAD | _S_IWRITE)) == -1) +#elif defined(GF_OS_BSD) + if((ft->file = open(purple_xfer_get_local_filename(p_xfer), O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE)) == -1) +#else + if((ft->file = open64(purple_xfer_get_local_filename(p_xfer), O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE)) == -1) +#endif // _WIN32 + { + purple_debug_error("gfire", "gfire_filetransfer_request_accepted: Couldn't open file for writing\n"); + ft->aborted = TRUE; + gfire_p2p_dl_proto_send_file_request_reply(ft->session, ft->fileid, FALSE); + purple_xfer_cancel_local(p_xfer); + gfire_p2p_session_remove_file_transfer(ft->session, ft, TRUE); + return; + } + + // Grow file to the full size +#ifdef _WIN32 + if(_chsize(ft->file, ft->size) != 0) +#else + if(ftruncate64(ft->file, ft->size) != 0) +#endif // _WIN32 + purple_debug_warning("gfire", "P2P: setting the files size failed\n"); + + ft->size = purple_xfer_get_size(p_xfer); + ft->current_chunk = 0; + ft->chunk_count = ft->size / XFIRE_P2P_FT_CHUNK_SIZE; + if((ft->size % XFIRE_P2P_FT_CHUNK_SIZE) != 0) + ft->chunk_count++; + + purple_xfer_start(p_xfer, -1, NULL, 0); + + gfire_p2p_dl_proto_send_file_request_reply(ft->session, ft->fileid, TRUE); + + // Request first chunk + ft->chunk = gfire_file_chunk_create(ft->session, ft->fileid, ft->msgid, p_xfer, + (gfire_ft_callback)gfire_filetransfer_chunk_done, NULL, ft); + + gfire_file_chunk_init(ft->chunk, 0, (ft->chunk_count == 1) ? ft->size : XFIRE_P2P_FT_CHUNK_SIZE); + gfire_file_chunk_start_transfer(ft->chunk); +} + +static void gfire_filetransfer_request_denied(PurpleXfer *p_xfer) +{ + if(!p_xfer) + return; + + purple_debug_info("gfire", "P2P: file transfer request denied\n"); + + gfire_filetransfer *ft = p_xfer->data; + + gfire_p2p_dl_proto_send_file_request_reply(ft->session, ft->fileid, FALSE); + + gfire_p2p_session_remove_file_transfer(ft->session, ft, TRUE); +} + +static void gfire_filetransfer_start_xfer(PurpleXfer *p_xfer) +{ + // We don't need to do anything here +} + +gfire_filetransfer *gfire_filetransfer_create(gfire_p2p_session *p_session, PurpleXfer *p_xfer, guint32 p_fileid) +{ + if(!p_session || !p_xfer) + return NULL; + + gfire_filetransfer *ret = g_new0(gfire_filetransfer, 1); + if(!ret) + { + purple_xfer_cancel_local(p_xfer); + return NULL; + } + + ret->session = p_session; + ret->xfer = p_xfer; + p_xfer->data = ret; + + purple_xfer_set_start_fnc(p_xfer, gfire_filetransfer_start_xfer); + + // Sending + if(purple_xfer_get_type(p_xfer) == PURPLE_XFER_SEND) + { +#ifdef _WIN32 + if((ret->file = _sopen(purple_xfer_get_local_filename(p_xfer), _O_RDONLY | _O_BINARY, + _SH_DENYNO, _S_IREAD | _S_IWRITE)) == -1) +#elif defined(GF_OS_BSD) + if((ret->file = open(purple_xfer_get_local_filename(p_xfer), O_RDONLY)) == -1) +#else + if((ret->file = open64(purple_xfer_get_local_filename(p_xfer), O_RDONLY)) == -1) +#endif // _WIN32 + { + purple_debug_error("gfire", "gfire_filetransfer_init: Couldn't open file for reading\n"); + ret->aborted = TRUE; + purple_xfer_cancel_local(p_xfer); + g_free(ret); + return NULL; + } + + ret->fileid = XFIRE_P2P_FT_PRIVATE_FILEID_START + ++gfire_transfer_count; + ret->size = purple_xfer_get_size(p_xfer); + purple_xfer_set_cancel_send_fnc(p_xfer, gfire_filetransfer_cancel); + } + // Receiving + else + { + ret->fileid = p_fileid; + + purple_xfer_set_init_fnc(p_xfer, gfire_filetransfer_request_accepted); + purple_xfer_set_request_denied_fnc(p_xfer, gfire_filetransfer_request_denied); + purple_xfer_set_cancel_recv_fnc(p_xfer, gfire_filetransfer_cancel); + } + + return ret; +} + +void gfire_filetransfer_start(gfire_filetransfer *p_transfer) +{ + if(!p_transfer) + return; + + // Sending + if(purple_xfer_get_type(p_transfer->xfer) == PURPLE_XFER_SEND) + { + GTimeVal gtv; + g_get_current_time(>v); + gfire_p2p_dl_proto_send_file_request(p_transfer->session, p_transfer->fileid, p_transfer->size, + purple_xfer_get_filename(p_transfer->xfer), + "", gtv.tv_sec); + } + // Receiving + else + purple_xfer_request(p_transfer->xfer); +} + +void gfire_filetransfer_free(gfire_filetransfer *p_transfer, gboolean p_local_reason) +{ + if(!p_transfer) + return; + + if(p_transfer->chunk) + gfire_file_chunk_free(p_transfer->chunk); + + if(p_transfer->file >= 0) +#ifdef _WIN32 + _close(p_transfer->file); +#else + close(p_transfer->file); +#endif // _WIN32 + + if(!purple_xfer_is_completed(p_transfer->xfer)) + { + if(!purple_xfer_is_canceled(p_transfer->xfer)) + { + purple_xfer_set_cancel_recv_fnc(p_transfer->xfer, NULL); + purple_xfer_set_cancel_send_fnc(p_transfer->xfer, NULL); + + if(p_local_reason) + purple_xfer_cancel_local(p_transfer->xfer); + else + purple_xfer_cancel_remote(p_transfer->xfer); + } + + // Remove incomplete file for now + if(purple_xfer_get_type(p_transfer->xfer) == PURPLE_XFER_RECEIVE) + remove(purple_xfer_get_local_filename(p_transfer->xfer)); + } + else + purple_xfer_end(p_transfer->xfer); + + g_free(p_transfer); +} + +void gfire_filetransfer_request_reply(gfire_filetransfer *p_transfer, gboolean p_reply) +{ + if(!p_transfer) + return; + + if(!p_reply) + { + purple_debug_info("gfire", "P2P: file request denied\n"); + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, FALSE); + } + else + { + purple_debug_info("gfire", "P2P: file request accepted\n"); + purple_xfer_start(p_transfer->xfer, 0, NULL, 0); + } +} + +void gfire_filetransfer_event(gfire_filetransfer *p_transfer, guint32 p_event, guint32 p_type) +{ + if(!p_transfer) + return; + + if(p_event == 1 && p_type == 2) + { + purple_debug_misc("gfire", "P2P: Buddy aborted transfer\n"); + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, FALSE); + } +} + +void gfire_filetransfer_chunk_info_request(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_chunk_size, + guint32 p_chunk_count, guint32 p_msgid) +{ + if(!p_transfer || purple_xfer_get_type(p_transfer->xfer) != PURPLE_XFER_SEND || + p_offset >= p_transfer->size || p_chunk_size > 0x01E00000 /* 30 MB */) + return; + + guint8 *chunk = g_malloc(p_chunk_size); + lseek64(p_transfer->file, p_offset, SEEK_SET); + int size = read(p_transfer->file, chunk, p_chunk_size); + if(size <= 0) + { + g_free(chunk); + + purple_xfer_error(PURPLE_XFER_SEND, purple_xfer_get_account(p_transfer->xfer), + purple_xfer_get_remote_user(p_transfer->xfer), + _("Reading a chunk failed! Make sure you have appropriate permissions!")); + + // Abort the transfer + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, TRUE); + return; + } + + gchar hash[41]; + hashSha1_bin_to_str(chunk, size, hash); + hash[40] = 0; + + g_free(chunk); + + gfire_p2p_dl_proto_send_file_chunk_info(p_transfer->session, p_transfer->fileid, p_offset, size, hash, + p_msgid); +} + +void gfire_filetransfer_chunk_info(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_size, + const gchar *p_checksum) +{ + if(!p_transfer || !p_checksum || !p_transfer->chunk) + return; + + if(p_offset == gfire_file_chunk_get_offset(p_transfer->chunk)) + gfire_file_chunk_set_checksum(p_transfer->chunk, p_checksum); + else + purple_debug_warning("gfire", "P2P: Got chunk information for unknown chunk!\n"); +} + +void gfire_filetransfer_data_packet_request(gfire_filetransfer *p_transfer, guint64 p_offset, + guint32 p_size, guint32 p_msgid) +{ + if(!p_transfer || purple_xfer_get_type(p_transfer->xfer) != PURPLE_XFER_SEND || + p_offset >= p_transfer->size || p_size > 0x01E00000 /* 30 MB */) + return; + + guint8 *data = g_malloc(p_size); + lseek64(p_transfer->file, p_offset, SEEK_SET); + int size = read(p_transfer->file, data, p_size); + if(size <= 0) + { + g_free(data); + + purple_xfer_error(PURPLE_XFER_SEND, purple_xfer_get_account(p_transfer->xfer), + purple_xfer_get_remote_user(p_transfer->xfer), + _("Reading a data segment failed! Make sure you have appropriate permissions!")); + + // Abort the transfer + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, TRUE); + return; + } + + gfire_p2p_dl_proto_send_file_data_packet(p_transfer->session, p_transfer->fileid, p_offset, + size, data, p_msgid); + + g_free(data); + + // Update GUI + if((purple_xfer_get_bytes_sent(p_transfer->xfer) + size) > purple_xfer_get_size(p_transfer->xfer)) + purple_xfer_set_size(p_transfer->xfer, purple_xfer_get_bytes_sent(p_transfer->xfer) + size); + + purple_xfer_set_bytes_sent(p_transfer->xfer, purple_xfer_get_bytes_sent(p_transfer->xfer) + size); + purple_xfer_update_progress(p_transfer->xfer); +} + +void gfire_filetransfer_data_packet(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_size, + const GList *p_data) +{ + if(!p_transfer || !p_data || !p_transfer->chunk) + return; + + gfire_file_chunk_got_data(p_transfer->chunk, p_offset, p_size, p_data); +} + +void gfire_filetransfer_complete(gfire_filetransfer *p_transfer) +{ + if(!p_transfer || purple_xfer_get_type(p_transfer->xfer) != PURPLE_XFER_SEND) + return; + + purple_xfer_set_completed(p_transfer->xfer, TRUE); + gfire_p2p_session_remove_file_transfer(p_transfer->session, p_transfer, TRUE); +} + +gfire_p2p_session *gfire_filetransfer_get_session(const gfire_filetransfer *p_transfer) +{ + return p_transfer ? p_transfer->session : NULL; +} + +PurpleXfer *gfire_filetransfer_get_xfer(const gfire_filetransfer *p_transfer) +{ + return p_transfer ? p_transfer->xfer : NULL; +} + +guint32 gfire_filetransfer_get_fileid(const gfire_filetransfer *p_transfer) +{ + return p_transfer ? p_transfer->fileid : 0; +} + +int gfire_filetransfer_get_file(const gfire_filetransfer *p_transfer) +{ + return p_transfer ? p_transfer->file : -1; +} diff -Nru gfire-0.8.3/src/gf_filetransfer.h gfire-0.9.4/src/gf_filetransfer.h --- gfire-0.8.3/src/gf_filetransfer.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_filetransfer.h 2011-03-15 19:38:43.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_FILETRANSFER_H +#define _GF_FILETRANSFER_H + +typedef struct _gfire_filetransfer gfire_filetransfer; + +#include "gf_base.h" +#include "gf_file_chunk.h" +#include "gf_p2p_session.h" + +#define XFIRE_P2P_FT_PRIVATE_FILEID_START 0x80000000 +#define XFIRE_P2P_FT_CHUNK_SIZE 0xC800 // 50 * 1024 Byte: 51200 Byte + +struct _gfire_filetransfer +{ + // Related structures + gfire_p2p_session *session; + PurpleXfer *xfer; + + // Xfire transfer data + guint32 fileid; + guint32 msgid; + gboolean aborted; + + // Chunks + guint64 chunk_count; + guint64 current_chunk; + gfire_file_chunk *chunk; + guint64 bytes_transferred; + + // The file itself + int file; + guint64 size; +}; + +gfire_filetransfer *gfire_filetransfer_create(gfire_p2p_session *p_session, PurpleXfer *p_xfer, guint32 p_fileid); +void gfire_filetransfer_start(gfire_filetransfer *p_transfer); +void gfire_filetransfer_free(gfire_filetransfer *p_transfer, gboolean p_local_reason); + +// Handler functions +void gfire_filetransfer_request_reply(gfire_filetransfer *p_transfer, gboolean p_reply); +void gfire_filetransfer_event(gfire_filetransfer *p_transfer, guint32 p_event, guint32 p_type); +void gfire_filetransfer_chunk_info_request(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_chunk_size, + guint32 p_chunk_count, guint32 p_msgid); +void gfire_filetransfer_chunk_info(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_size, + const gchar *p_checksum); +void gfire_filetransfer_data_packet_request(gfire_filetransfer *p_transfer, guint64 p_offset, + guint32 p_size, guint32 p_msgid); +void gfire_filetransfer_data_packet(gfire_filetransfer *p_transfer, guint64 p_offset, guint32 p_size, + const GList *p_data); +void gfire_filetransfer_complete(gfire_filetransfer *p_transfer); + +// Getting data +gfire_p2p_session *gfire_filetransfer_get_session(const gfire_filetransfer *p_transfer); +PurpleXfer *gfire_filetransfer_get_xfer(const gfire_filetransfer *p_transfer); +guint32 gfire_filetransfer_get_fileid(const gfire_filetransfer *p_transfer); +int gfire_filetransfer_get_file(const gfire_filetransfer *p_transfer); +guint32 gfire_filetransfer_next_msgid(gfire_filetransfer *p_transfer); + +#endif // _GF_FILETRANSFER_H diff -Nru gfire-0.8.3/src/gf_friend_search.c gfire-0.9.4/src/gf_friend_search.c --- gfire-0.8.3/src/gf_friend_search.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_friend_search.c 2011-03-14 20:25:00.000000000 +0000 @@ -0,0 +1,104 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_friend_search.h" + +static void gfire_friend_search_search_cb(PurpleConnection *p_gc, gchar *p_search_str) +{ + if(!p_gc || !p_search_str) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_friend_search_search_cb: Invalid GC or invalid search string\n"); + return; + } + + if(strlen(p_search_str) == 0) + return; + + guint16 len = gfire_friend_search_proto_create_request(p_search_str); + if(len > 0) + gfire_send(p_gc, len); + + return; +} + +static void gfire_friend_search_add_cb(PurpleConnection *p_gc, GList *p_row, gpointer p_user_data) +{ + if(!p_gc || !p_row) + return; + + purple_blist_request_add_buddy(purple_connection_get_account(p_gc), (gchar*)g_list_first(p_row)->data, GFIRE_DEFAULT_GROUP_NAME, ""); +} + +void gfire_show_friend_search_cb(PurplePluginAction *p_action) +{ + PurpleConnection *gc = (PurpleConnection *)p_action->context; + gfire_data *gfire = NULL; + + if (gc == NULL || (gfire = (gfire_data *)gc->proto_data) == NULL) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_show_friend_search_cb: GC not set and/or couldn't access gfire data.\n"); + return; + } + + purple_request_input(gc, _("Xfire Friend Search"), _("Please enter a Xfire username, name or e-Mail address here:"), + _("For example: gill123, Gill Bates or gill@bates.net"), "", FALSE, FALSE, + NULL, _("Search"), G_CALLBACK(gfire_friend_search_search_cb), _("Cancel"), NULL, purple_connection_get_account(gc), + NULL, NULL, gc); +} + +void gfire_friend_search_results(gfire_data *p_gfire, GList *p_usernames, GList *p_firstnames, GList *p_lastnames) +{ + PurpleNotifySearchResults *search_result = purple_notify_searchresults_new(); + if(!search_result) + { + gfire_list_clear(p_usernames); + gfire_list_clear(p_firstnames); + gfire_list_clear(p_lastnames); + return; + } + + purple_notify_searchresults_column_add(search_result, purple_notify_searchresults_column_new(_("Username"))); + purple_notify_searchresults_column_add(search_result, purple_notify_searchresults_column_new(_("First Name"))); + purple_notify_searchresults_column_add(search_result, purple_notify_searchresults_column_new(_("Last Name"))); + purple_notify_searchresults_button_add(search_result, PURPLE_NOTIFY_BUTTON_INVITE, gfire_friend_search_add_cb); + + GList *cur_username = p_usernames; + GList *cur_firstname = p_firstnames; + GList *cur_lastname = p_lastnames; + + while(cur_username) + { + GList *row = g_list_append(NULL, cur_username->data); + row = g_list_append(row, cur_firstname->data); + row = g_list_append(row, cur_lastname->data); + purple_notify_searchresults_row_add(search_result, row); + + cur_username = g_list_next(cur_username); + cur_firstname = g_list_next(cur_firstname); + cur_lastname = g_list_next(cur_lastname); + } + + g_list_free(p_usernames); + g_list_free(p_firstnames); + g_list_free(p_lastnames); + + purple_notify_searchresults(gfire_get_connection(p_gfire), _("Xfire Friend Search"), _("Search results"), "", search_result, NULL, NULL); +} diff -Nru gfire-0.8.3/src/gf_friend_search.h gfire-0.9.4/src/gf_friend_search.h --- gfire-0.8.3/src/gf_friend_search.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_friend_search.h 2011-03-14 20:24:55.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_FRIEND_SEARCH_H +#define _GF_FRIEND_SEARCH_H + +#include "gfire.h" +#include "gf_friend_search_proto.h" + +void gfire_show_friend_search_cb(PurplePluginAction *p_action); +void gfire_friend_search_results(gfire_data *p_gfire, GList *p_usernames, GList *p_firstnames, GList *p_lastnames); + +#endif // _GF_FRIEND_SEARCH_H diff -Nru gfire-0.8.3/src/gf_friend_search_proto.c gfire-0.9.4/src/gf_friend_search_proto.c --- gfire-0.8.3/src/gf_friend_search_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_friend_search_proto.c 2011-03-14 20:24:50.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_friend_search.h" +#include "gf_friend_search_proto.h" + +guint16 gfire_friend_search_proto_create_request(const gchar *p_search) +{ + if(!p_search) + return -1; + + guint32 offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_write_attr_ss("name", 0x01, p_search, strlen(p_search), offset); + offset = gfire_proto_write_attr_ss("fname", 0x01, "", 0, offset); + offset = gfire_proto_write_attr_ss("lname", 0x01, "", 0, offset); + offset = gfire_proto_write_attr_ss("email", 0x01, "", 0, offset); + + gfire_proto_write_header(offset, 0x0C, 4, 0); + + return offset; +} + +void gfire_friend_search_proto_result(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + GList *usernames = NULL; + GList *firstnames = NULL; + GList *lastnames = NULL; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &usernames, "name", offset); + if(offset == -1 || !usernames) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &firstnames, "fname", offset); + if(offset == -1 || !firstnames) + { + //mem cleanup code + if (usernames) g_list_free(usernames); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &lastnames, "lname", offset); + if(offset == -1 || !lastnames) + { + //mem cleanup code + if (usernames) g_list_free(usernames); + if (firstnames) g_list_free(firstnames); + return; + } + + gfire_friend_search_results(p_gfire, usernames, firstnames, lastnames); +} diff -Nru gfire-0.8.3/src/gf_friend_search_proto.h gfire-0.9.4/src/gf_friend_search_proto.h --- gfire-0.8.3/src/gf_friend_search_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_friend_search_proto.h 2011-03-14 20:24:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_FRIEND_SEARCH_PROTO_H +#define _GF_FRIEND_SEARCH_PROTO_H + +#include "gf_base.h" +#include "gf_network.h" +#include "gf_protocol.h" +#include "gfire.h" + +guint16 gfire_friend_search_proto_create_request(const gchar *p_search); +void gfire_friend_search_proto_result(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // _GF_FRIEND_SEARCH_PROTO_H diff -Nru gfire-0.8.3/src/gf_game_detection.c gfire-0.9.4/src/gf_game_detection.c --- gfire-0.8.3/src/gf_game_detection.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_game_detection.c 2011-03-14 20:24:41.000000000 +0000 @@ -0,0 +1,1273 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_game_detection.h" +#include + +// Networking includes, required for the "HTTP-server" as libpurple +// offers no way to listen only on the localhost. +#ifdef _WIN32 + #include +#else + #include + #include +#endif // _WIN32 + +#if defined(USE_DBUS_STATUS_CHANGE) && !defined(_WIN32) +# include + +// KMess status updates +static void setKMessInstanceStatus(DBusGConnection *p_connection, const gchar *p_instance, const gchar *p_message) +{ + if(!p_connection || !p_instance || !p_message) + return; + + DBusGProxy *proxy = dbus_g_proxy_new_for_name(p_connection, p_instance, "/remoteControl", "org.kmess.remoteControl"); + if(!proxy) + return; + + dbus_g_proxy_call_no_reply(proxy, "setPersonalMessage", G_TYPE_STRING, p_message, G_TYPE_INVALID); + + purple_debug_info("gfire", "kmess status: changed to \"%s\" for instance \"%s\"\n", p_message, + p_instance); + + g_object_unref(proxy); +} + +static void setKMessStatus(const gchar *p_message) +{ + if(!p_message) + return; + + GError *error = NULL; + + DBusGConnection *connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if(!connection) + { + purple_debug_error("gfire", "kmess status: dbus_g_bus_get: %s\n", error->message); + g_error_free(error); + return; + } + + DBusGProxy *proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + if(!proxy) + return; + + gchar **names = NULL; + if(!dbus_g_proxy_call(proxy, "ListNames", &error, G_TYPE_INVALID, G_TYPE_STRV, &names, G_TYPE_INVALID)) + { + purple_debug_error("gfire", "kmess status: dbus_g_proxy_call: %s\n", error->message); + g_error_free(error); + + g_object_unref(proxy); + return; + } + + g_object_unref(proxy); + + if(names) + { + int i = 0; + for(; names[i]; i++) + { + if(strncmp(names[i], "org.kmess.kmess-", 16) == 0) + setKMessInstanceStatus(connection, names[i], p_message); + } + + g_strfreev(names); + } +} +#endif // USE_DBUS_STATUS_CHANGE && !_WIN32 + +static gfire_game_detector *gfire_detector = NULL; + +static void gfire_game_detector_inform_instances_game() +{ + gchar *game_name = gfire_game_name(gfire_detector->game_data.id, TRUE); + + if(gfire_detector->game_data.id != 0) + { + gchar *addr = gfire_game_data_addr_str(&gfire_detector->game_data); + purple_debug_info("gfire", "%s is running, sending ingame status. (%s)\n", game_name, addr); + g_free(addr); + } + else + purple_debug_misc("gfire", "Game is not running anymore, sending out-of-game status.\n"); + + GList *cur = gfire_detector->instances; + gboolean do_global_status = FALSE; + while(cur) + { + gfire_set_game_status((gfire_data*)cur->data, &gfire_detector->game_data); + + // Set to true if at least one account wants that + do_global_status = (do_global_status || gfire_wants_global_status_change((gfire_data*)cur->data)); + cur = g_list_next(cur); + } + + // Change the status of non-Xfire accounts as well if requested + if(do_global_status) + { + GList *accounts = purple_accounts_get_all_active(); + GList *cur = accounts; + while(cur) + { + PurpleAccount *account = (PurpleAccount*)cur->data; + + // Only change the status for non-Xfire protocols + if(!purple_utf8_strcasecmp(purple_account_get_protocol_id(account), GFIRE_PRPL_ID)) + { + cur = g_list_next(cur); + continue; + } + + // Set gaming status + if(gfire_detector->game_data.id != 0) + { + gchar *msg = g_strdup_printf(_("Playing %s"), game_name); + PurpleStatusType *status_type = purple_account_get_status_type_with_primitive(account, + PURPLE_STATUS_UNAVAILABLE); + // Set the status to unavailable/busy/dnd + if(status_type) + { + PurplePresence *presence = purple_account_get_presence(account); + if(presence) + { + PurpleStatus *status = purple_presence_get_status(presence, + purple_status_type_get_id(status_type)); + if(status) + { + if(purple_status_type_get_attr(status_type, "message")) + { + purple_debug_info("gfire", "detection: Setting %s status to: %s\n", + purple_account_get_username(account), msg); + + GList *attrs = NULL; + attrs = g_list_append(attrs, "message"); + attrs = g_list_append(attrs, g_strdup(msg)); + purple_status_set_active_with_attrs_list(status, TRUE, attrs); + g_list_free(attrs); + } + else + purple_status_set_active(status, TRUE); + } + } + } + // No unavailable/busy/dnd status supported, just change the current status' message + else + { + PurpleStatus *status = purple_account_get_active_status(account); + if(purple_status_type_get_attr(purple_status_get_type(status), "message")) + { + purple_debug_info("gfire", "detection: Setting %s status to: %s\n", + purple_account_get_username(account), msg); + + GList *attrs = NULL; + attrs = g_list_append(attrs, "message"); + attrs = g_list_append(attrs, g_strdup(msg)); + purple_status_set_active_with_attrs_list(status, TRUE, attrs); + g_list_free(attrs); + } + } + g_free(msg); + } + // Restore old status + else + { + PurpleSavedStatus *savedstatus = purple_savedstatus_get_current(); + if(savedstatus) + { + purple_debug_info("gfire", "detection: Resetting %s status\n", + purple_account_get_username(account)); + + purple_savedstatus_activate_for_account(savedstatus, account); + } + else + purple_debug_warning("gfire", "detection: no status for status reset found\n"); + } + + cur = g_list_next(cur); + } + + g_list_free(accounts); + + // Set external gaming status +#if defined(USE_DBUS_STATUS_CHANGE) && !defined(_WIN32) + if(gfire_detector->game_data.id != 0) + { + gchar *msg = g_strdup_printf(_("Playing %s"), game_name); + // KMess + setKMessStatus(msg); + g_free(msg); + } + else + // KMess + setKMessStatus(""); +#endif // USE_DBUS_STATUS_CHANGE && !_WIN32 + } + + g_free(game_name); +} + +static void gfire_game_detector_inform_instances_voip() +{ + if(gfire_detector->voip_data.id != 0) + { + gchar *voip_name = gfire_game_name(gfire_detector->voip_data.id, FALSE); + gchar *addr = gfire_game_data_addr_str(&gfire_detector->voip_data); + purple_debug_info("gfire", "%s is running, sending VoIP status. (%s)\n", voip_name, addr); + g_free(addr); + g_free(voip_name); + } + else + purple_debug_misc("gfire", "VoIP application is not running anymore, sending status.\n"); + + GList *cur = gfire_detector->instances; + while(cur) + { + gfire_set_voip_status((gfire_data*)cur->data, &gfire_detector->voip_data); + cur = g_list_next(cur); + } +} + +typedef struct _gfire_process_detection_data +{ + const gfire_game_configuration *gconf; + + // Game + const gfire_game_detection_set *g_dset; + gboolean g_checked_old; + gboolean g_old_running; + guint32 g_new_game; + guint32 g_pid; + + // VoIP + const gfire_game_detection_set *v_dset; + gboolean v_checked_old; + gboolean v_old_running; + guint32 v_new_voip; + guint32 v_pid; +} gfire_process_detection_data; + +static gboolean gfire_game_detector_detect_game_dset_cb(const gfire_game *p_game, const gfire_game_detection_set *p_dset, + gpointer p_data) +{ + gfire_process_detection_data *data = (gfire_process_detection_data*)p_data; + + // Check if the current detection set matches our environment + guint32 pid = gfire_process_list_contains(gfire_detector->process_list, data->gconf->detect_file, + p_dset->required_args, p_dset->invalid_args/*, NULL*/); + + // VoIP app + if(p_game->is_voice) + { + if((gfire_detector->voip_data.id == p_game->id) && !data->v_old_running) + { + data->v_checked_old = TRUE; + data->v_old_running = (pid != 0); + if(pid) + { + data->v_pid = pid; + data->v_dset = p_dset; + } + } + else if(pid) + { + data->v_new_voip = p_game->id; + data->v_pid = pid; + data->v_dset = p_dset; + } + } + // Game + else + { + if((gfire_detector->game_data.id == p_game->id) && !data->g_old_running) + { + data->g_checked_old = TRUE; + data->g_old_running = (pid != 0); + if(pid) + { + data->g_pid = pid; + data->g_dset = p_dset; + } + } + else if(pid) + { + data->g_new_game = p_game->id; + data->g_pid = pid; + data->g_dset = p_dset; + } + } + + // Check if we can abort + // Old game still running / not running anymore but new one available + if(((gfire_detector->game_data.id && data->g_checked_old && (data->g_old_running || data->g_new_game)) || + // No old game present, but new one found + (!gfire_detector->game_data.id && data->g_new_game)) && + // Old VoIP app still running / not running anymore but new one available + ((gfire_detector->voip_data.id && data->v_checked_old && (data->v_old_running || data->v_new_voip)) || + // No old VoIP app present, but new one found + (!gfire_detector->voip_data.id && data->v_new_voip))) + return TRUE; + + return FALSE; +} + +static gboolean gfire_game_detector_detect_conf_game_cb(const gfire_game_configuration *p_gconf, gpointer p_data) +{ + const gfire_game *game = gfire_game_by_id(p_gconf->game_id); + if(game) + { + gfire_process_detection_data *data = (gfire_process_detection_data*)p_data; + data->gconf = p_gconf; + + // If a detection callback aborted the loop we abort as well to stop detection + if(gfire_game_foreach_dset(game, G_CALLBACK(gfire_game_detector_detect_game_dset_cb), data, FALSE)) + return TRUE; + } + + return FALSE; +} + +static gboolean gfire_game_detector_detect_cb(void *p_unused) +{ + if(!gfire_detector) + return FALSE; + + gfire_process_list_update(gfire_detector->process_list); + + gfire_process_detection_data *data = g_malloc0(sizeof(gfire_process_detection_data)); + gfire_game_config_foreach(G_CALLBACK(gfire_game_detector_detect_conf_game_cb), data); + + // We have detected a game + if(data->g_pid) + { + // We got a new game? + if(!gfire_detector->game_data.id || !data->g_old_running) + { + gfire_server_detector_stop(gfire_detector->g_server_detector); + gfire_detector->g_server_changed = FALSE; + gfire_detector->g_server_ip = 0; + gfire_detector->g_server_port = 0; + + gfire_game_data_reset(&gfire_detector->game_data); + gfire_detector->game_data.id = data->g_new_game; + gfire_detector->game_type = GFGT_PROCESS; + + gfire_game_detector_inform_instances_game(); + + // Start new server detection if allowed + if(gfire_detector->server_detection_ref && data->g_dset->detect_server) + gfire_server_detector_start(gfire_detector->g_server_detector, gfire_detector->game_data.id, + data->g_pid); + } + // We do still play the old game, start a server detection cycle + else + { + // Check for changed server data + g_mutex_lock(gfire_detector->server_mutex); + if(gfire_detector->g_server_changed) + { + gfire_detector->g_server_changed = FALSE; + + gfire_detector->game_data.ip.value = gfire_detector->g_server_ip; + gfire_detector->game_data.port = gfire_detector->g_server_port; + g_mutex_unlock(gfire_detector->server_mutex); + + gfire_game_detector_inform_instances_game(); + } + else + g_mutex_unlock(gfire_detector->server_mutex); + + // Start new server detection if allowed + if(gfire_detector->server_detection_ref && data->g_dset->detect_server) + gfire_server_detector_start(gfire_detector->g_server_detector, gfire_detector->game_data.id, + data->g_pid); + } + } + // No game playing + else + { + if(gfire_detector->game_data.id) + { + gfire_server_detector_stop(gfire_detector->g_server_detector); + gfire_detector->g_server_changed = FALSE; + gfire_detector->g_server_ip = 0; + gfire_detector->g_server_port = 0; + + gfire_game_data_reset(&gfire_detector->game_data); + gfire_game_detector_inform_instances_game(); + } + } + + // We have detected a VoIP app + if(data->v_pid) + { + // We got a new VoIP app? + if(!gfire_detector->voip_data.id || !data->v_old_running) + { + gfire_server_detector_stop(gfire_detector->v_server_detector); + gfire_detector->v_server_changed = FALSE; + gfire_detector->v_server_ip = 0; + gfire_detector->v_server_port = 0; + + gfire_game_data_reset(&gfire_detector->voip_data); + gfire_detector->voip_data.id = data->v_new_voip; + + gfire_game_detector_inform_instances_voip(); + + // Start new server detection if allowed + if(gfire_detector->server_detection_ref && data->v_dset->detect_server) + gfire_server_detector_start(gfire_detector->v_server_detector, gfire_detector->voip_data.id, + data->v_pid); + } + // Still the old one + else + { + // Check for changed server data + g_mutex_lock(gfire_detector->server_mutex); + if(gfire_detector->v_server_changed) + { + gfire_detector->v_server_changed = FALSE; + + gfire_detector->voip_data.ip.value = gfire_detector->v_server_ip; + gfire_detector->voip_data.port = gfire_detector->v_server_port; + g_mutex_unlock(gfire_detector->server_mutex); + + gfire_game_detector_inform_instances_voip(); + } + else + g_mutex_unlock(gfire_detector->server_mutex); + + // Start new server detection if allowed + if(gfire_detector->server_detection_ref && data->v_dset->detect_server) + gfire_server_detector_start(gfire_detector->v_server_detector, gfire_detector->voip_data.id, + data->v_pid); + } + } + // No VoIP app running + else + { + if(gfire_detector->voip_data.id) + { + gfire_server_detector_stop(gfire_detector->v_server_detector); + gfire_detector->v_server_changed = FALSE; + gfire_detector->v_server_ip = 0; + gfire_detector->v_server_port = 0; + + gfire_game_data_reset(&gfire_detector->voip_data); + gfire_game_detector_inform_instances_voip(); + } + } + + g_free(data); + + return TRUE; +} + +static void gfire_game_detector_update_game_server(guint32 p_server_ip, guint16 p_server_port) +{ + g_mutex_lock(gfire_detector->server_mutex); + // Only apply changes + if(gfire_detector->g_server_ip != p_server_ip || gfire_detector->g_server_port != p_server_port) + { + gfire_detector->g_server_changed = TRUE; + gfire_detector->g_server_ip = p_server_ip; + gfire_detector->g_server_port = p_server_port; + } + g_mutex_unlock(gfire_detector->server_mutex); +} + +static void gfire_game_detector_update_voip_server(guint32 p_server_ip, guint16 p_server_port) +{ + g_mutex_lock(gfire_detector->server_mutex); + // Only apply changes + if(gfire_detector->v_server_ip != p_server_ip || gfire_detector->v_server_port != p_server_port) + { + gfire_detector->v_server_changed = TRUE; + gfire_detector->v_server_ip = p_server_ip; + gfire_detector->v_server_port = p_server_port; + } + g_mutex_unlock(gfire_detector->server_mutex); +} + +static gboolean gfire_game_detector_web_timeout_cb(void *p_unused) +{ + if(!gfire_detector || gfire_detector->game_type != GFGT_WEB) + return FALSE; + + GTimeVal cur_time; + g_get_current_time(&cur_time); + + if((cur_time.tv_sec - gfire_detector->web_timeout) >= GFIRE_WEB_DETECTION_TIMEOUT) + { + // Webgame timed out, kill it + gfire_game_data_reset(&gfire_detector->game_data); + + // Kill this timeout check + g_source_remove(gfire_detector->timeout_check); + + // Start process detection again + gfire_detector->det_source = g_timeout_add_seconds(GFIRE_DETECTION_INTERVAL, + (GSourceFunc)gfire_game_detector_detect_cb, NULL); + + gfire_game_detector_inform_instances_game(); + + return FALSE; + } + + return TRUE; +} + +static void gfire_game_detector_web_http_input_cb(gpointer p_con, gint p_fd, PurpleInputCondition p_condition) +{ + if(!p_con || !(p_condition & PURPLE_INPUT_READ)) + return; + + gfire_game_detection_http_connection *connection = p_con; + if(connection->socket != p_fd) + return; + + int bytes = recv(connection->socket, connection->buffer + connection->reclen, 8192 - connection->reclen, 0); + // Connection closed + if(bytes <= 0) + { + purple_input_remove(connection->input); + close(connection->socket); + + g_free(connection); + + GList *node = g_list_find(gfire_detector->connections, connection); + if(node) + gfire_detector->connections = g_list_delete_link(gfire_detector->connections, node); + +#ifdef DEBUG + purple_debug_misc("gfire", "detection: http: client connection closed\n"); +#endif // DEBUG + + return; + } + connection->reclen += bytes; + connection->buffer[connection->reclen] = 0; + + // VERY BASIC HTTP request parsing + gint result = 200; + gchar *url = NULL; + gchar *end = NULL; + gboolean persistent = TRUE; + + // Request not finished yet, wait for more... + if(!(end = strstr(connection->buffer, "\r\n\r\n")) && connection->reclen < 8192) + return; + + end += 4; + + if(connection->reclen == 8192) + result = 413; + else + { + gchar **lines = g_strsplit(connection->buffer, "\r\n", -1); + if(lines) + { + // Check first line "GET HTTP/." + if(strncmp(lines[0], "GET ", 4)) + result = 501; + else + { + gchar **parts = g_strsplit(lines[0], " ", 3); + if(parts) + { + if(g_strv_length(parts) != 3) + result = 400; + else if(strcmp(parts[0], "GET")) + result = 501; + else if(strncmp(parts[2], "HTTP/", 5)) + result = 400; + else + url = g_strdup(parts[1]); + + if(strcmp(parts[2], "HTTP/1.1")) + persistent = FALSE; + + g_strfreev(parts); + } + } + + gchar **cur = lines + 1; + while(*cur) + { + if(!strcasecmp(*cur, "Connection: keep-alive")) + { + persistent = TRUE; + break; + } + cur++; + } + + g_strfreev(lines); + } + else + result = 400; + } + + static gchar content[8192]; + content[0] = 0; + + if(url) + { + if(strncmp(url, "/url", 4)) + result = 404; + else if(result == 200) + { + const gchar *args = strstr(url, "?"); + if(args) + { + if(!strncmp(args + 1, "url=", 4)) + { + args += 5; + + gchar *unescaped = g_uri_unescape_string(args, ""); + if(unescaped) + { + purple_debug_info("gfire", "detection: http: new url request: %s\n", unescaped); + + guint32 gameid = gfire_game_id_by_url(unescaped); + g_free(unescaped); + + // our game! :) + if(gameid != 0 && gfire_detector->game_data.id == 0) + { + // Set new game + gfire_detector->game_data.id = gameid; + gfire_detector->game_type = GFGT_WEB; + + // Stop process checks + g_source_remove(gfire_detector->det_source); + gfire_detector->det_source = 0; + + // Add a timeout (browser might be just closed) + gfire_detector->timeout_check = + g_timeout_add_seconds(GFIRE_WEB_DETECTION_TIMEOUT, + (GSourceFunc)gfire_game_detector_web_timeout_cb, NULL); + + gfire_game_detector_inform_instances_game(); + } + + // Update the timeout + if(gameid != 0 && gfire_detector->game_data.id == gameid) + { + GTimeVal cur_time; + g_get_current_time(&cur_time); + gfire_detector->web_timeout = cur_time.tv_sec; + } + } + } + } + + gchar *game_name = gfire_game_name(gfire_detector->game_data.id, TRUE); + gchar *game_short_name = gfire_game_short_name(gfire_detector->game_data.id); + g_sprintf(content, "var result = {};\n" + "result[\"gameid\"] = \"%u\";\n" + "result[\"gameshortname\"] = \"%s\";\n" + "result[\"gamelongname\"] = \"%s\";\n" + "result[\"nickname\"] = \"%s\";\n" + "result[\"result\"] = \"ok\";\n" + "result[\"username\"] = \"%s\";\n" + "result[\"is_gfire\"] = true;\n" + "if (document.onSuccess) document.onSuccess(result);\n\n", + gfire_detector->game_data.id, + (gfire_detector->game_data.id != 0) ? NN(game_short_name) : "", + (gfire_detector->game_data.id != 0) ? NN(game_name) : "", + gfire_get_nick(gfire_detector->instances->data) ? + gfire_get_nick(gfire_detector->instances->data) : "", + gfire_get_name(gfire_detector->instances->data)); + if(game_name) + g_free(game_name); + if(game_short_name) + g_free(game_short_name); + } + } + + const gchar *response_text = NULL; + switch(result) + { + case 200: + response_text = "OK"; + break; + case 400: + response_text = "Bad Request"; + break; + case 404: + response_text = "Not Found"; + break; + case 413: + response_text = "Request Entity Too Large"; + break; + case 501: + response_text = "Not Implemented"; + break; + default: + response_text = "Not Implemented"; + break; + } + + // Response header + GString *response = g_string_new(NULL); + g_string_append_printf(response, "HTTP/1.1 %d %s\r\n", result, response_text); + + // Location + if(url) + { + g_string_append_printf(response, "Location: %s\r\n", url); + g_free(url); + } + + // Server + g_string_append_printf(response, "Server: Gfire %s\r\n", GFIRE_VERSION_STRING); + + // Content-Length + g_string_append_printf(response, "Content-Length: %u\r\n", (unsigned int)strlen(content)); + + // Keep-Alive + if(result == 200 && persistent) + g_string_append(response, "Connection: keep-alive\r\n"); + else + g_string_append(response, "Connection: close\r\n"); + + if(strlen(content) > 0) + { + // Date + static gchar timebuf[300]; + time_t rawtime = time(NULL); + struct tm *cur_time = localtime(&rawtime); + + strftime(timebuf, 300, "%a, %d %b %Y %H:%M:%S %Z", cur_time); + g_string_append_printf(response, "Date: %s\r\n", timebuf); + + // Content-Type + g_string_append(response, "Content-Type: text/javascript; charset=utf-8\r\n"); + //g_string_append(response, "Content-Type: text/html; charset=utf-8\r\n"); + } + + // Content + g_string_append_printf(response, "\r\n%s", content); + + // Send response + send(connection->socket, response->str, strlen(response->str), 0); + g_string_free(response, TRUE); + + if(result == 413) + { + purple_input_remove(connection->input); + close(connection->socket); + + g_free(connection); + + GList *node = g_list_find(gfire_detector->connections, connection); + if(node) + gfire_detector->connections = g_list_delete_link(gfire_detector->connections, node); + +#ifdef DEBUG + purple_debug_warning("gfire", "detection: http: client connection closed because of error\n"); +#endif // DEBUG + + return; + } + + // Be ready for another request + guint extralen = connection->reclen - (end - connection->buffer); + memmove(connection->buffer, end, extralen); + connection->buffer[extralen] = 0; + connection->reclen = extralen; +} + +static void gfire_game_detector_web_http_accept_cb(gpointer p_unused, gint p_fd, PurpleInputCondition p_condition) +{ + if(!gfire_detector || (gfire_detector->socket != p_fd) || !(p_condition & PURPLE_INPUT_READ)) + return; + + struct sockaddr_in client_addr; +#ifndef _WIN32 + socklen_t len = sizeof(struct sockaddr_in); + int client = accept(p_fd, (struct sockaddr*)&client_addr, &len); + if(client < 0) +#else + int len = sizeof(struct sockaddr_in); + int client = accept(p_fd, (struct sockaddr*)&client_addr, &len); + if(client == INVALID_SOCKET) +#endif // !_WIN32 + { + return; + } + +#ifdef DEBUG + purple_debug_misc("gfire", "detection: http: new client connection\n"); +#endif // DEBUG + + gfire_game_detection_http_connection *connection = g_malloc0(sizeof(gfire_game_detection_http_connection)); + connection->socket = client; + connection->input = purple_input_add(client, PURPLE_INPUT_READ, gfire_game_detector_web_http_input_cb, connection); + + gfire_detector->connections = g_list_append(gfire_detector->connections, connection); +} + +static gboolean gfire_game_detector_bind_http(gpointer p_unused) +{ + struct sockaddr_in addr; + memset(&addr, 0, sizeof(struct sockaddr_in)); + + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + addr.sin_port = htons(39123); // Xfire WebGame port + + if(bind(gfire_detector->socket, (struct sockaddr*)&addr, sizeof(struct sockaddr_in)) == -1) + { + purple_debug_warning("gfire", "detection: http: could not bind to 127.0.0.1:39123: %s\n", g_strerror(errno)); + return TRUE; + } + + if(listen(gfire_detector->socket, 5) == -1) + { + purple_debug_error("gfire", "detection: http: could not listen on 127.0.0.1:39123: %s\n", g_strerror(errno)); + close(gfire_detector->socket); + gfire_detector->socket = -1; + gfire_detector->bind_timeout = 0; + return FALSE; + } + + int flags = fcntl(gfire_detector->socket, F_GETFL); + fcntl(gfire_detector->socket, F_SETFL, flags | O_NONBLOCK); +#ifndef _WIN32 + fcntl(gfire_detector->socket, F_SETFD, FD_CLOEXEC); +#endif + + gfire_detector->accept_input = purple_input_add(gfire_detector->socket, PURPLE_INPUT_READ, + gfire_game_detector_web_http_accept_cb, NULL); + + purple_debug_info("gfire", "detection: http: started listening on 127.0.0.1:39123\n"); + + gfire_detector->bind_timeout = 0; + return FALSE; +} + +static void gfire_game_detector_start_web_http() +{ + gfire_detector->socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if(gfire_detector->socket < 0) + return; + + int on = 1; + if(setsockopt(gfire_detector->socket, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on)) == -1) + purple_debug_warning("gfire", "detection: http: SO_REUSEADDR: %s\n", g_strerror(errno)); + + if(gfire_game_detector_bind_http(NULL)) + gfire_detector->bind_timeout = g_timeout_add_seconds(5, gfire_game_detector_bind_http, NULL); +} + +static void gfire_game_detector_stop_web_http() +{ + if(gfire_detector->socket >= 0) + { + // Abort all binding retries + if(gfire_detector->bind_timeout) + { + g_source_remove(gfire_detector->bind_timeout); + gfire_detector->bind_timeout = 0; + } + + // Close the listening socket + if(gfire_detector->accept_input) + purple_input_remove(gfire_detector->accept_input); + + close(gfire_detector->socket); + gfire_detector->socket = -1; + + // Close all client connections + while(gfire_detector->connections) + { + gfire_game_detection_http_connection *connection = gfire_detector->connections->data; + purple_input_remove(connection->input); + close(connection->socket); + + g_free(connection); + + gfire_detector->connections = g_list_delete_link(gfire_detector->connections, gfire_detector->connections); + } + + purple_debug_info("gfire", "detection: http: stopped listening\n"); + } +} + +static void gfire_game_detector_init() +{ + if(gfire_detector) + return; + + gfire_detector = g_malloc0(sizeof(gfire_game_detector)); + + gfire_detector->server_mutex = g_mutex_new(); + gfire_detector->g_server_detector = gfire_server_detector_create(G_CALLBACK(gfire_game_detector_update_game_server)); + gfire_detector->v_server_detector = gfire_server_detector_create(G_CALLBACK(gfire_game_detector_update_voip_server)); + + gfire_detector->process_list = gfire_process_list_new(); + gfire_game_detector_start_web_http(); + + // Start detection timer for processes + gfire_detector->det_source = g_timeout_add_seconds(GFIRE_DETECTION_INTERVAL, + (GSourceFunc)gfire_game_detector_detect_cb, NULL); + + purple_debug_info("gfire", "detection: Detector started\n"); +} + +static void gfire_game_detector_free() +{ + if(!gfire_detector) + return; + + // Stop server detection + gfire_server_detector_stop(gfire_detector->g_server_detector); + gfire_server_detector_stop(gfire_detector->v_server_detector); + gfire_server_detector_free(gfire_detector->g_server_detector); + gfire_server_detector_free(gfire_detector->v_server_detector); + g_mutex_free(gfire_detector->server_mutex); + + // Remove detection timer + if(gfire_detector->det_source != 0) + g_source_remove(gfire_detector->det_source); + + gfire_game_detector_stop_web_http(); + gfire_process_list_free(gfire_detector->process_list); + + g_free(gfire_detector); + gfire_detector = NULL; + + purple_debug_info("gfire", "detection: Detector freed\n"); +} + +void gfire_game_detector_register(gfire_data *p_gfire) +{ + if(!p_gfire) + return; + + if(!gfire_detector) + gfire_game_detector_init(); + + gfire_detector->instances = g_list_append(gfire_detector->instances, p_gfire); + if(gfire_wants_server_detection(p_gfire)) + gfire_detector->server_detection_ref++; + + purple_debug_info("gfire", "detection: Gfire instance added (new count: %u)\n", + g_list_length(gfire_detector->instances)); +} + +void gfire_game_detector_unregister(gfire_data *p_gfire) +{ + if(!gfire_detector || !p_gfire) + return; + + GList *node = g_list_find(gfire_detector->instances, p_gfire); + if(!node) + return; + + if(gfire_wants_server_detection(p_gfire)) + gfire_detector->server_detection_ref--; + gfire_detector->instances = g_list_delete_link(gfire_detector->instances, node); + + purple_debug_info("gfire", "detection: Gfire instance removed (new count: %u)\n", + g_list_length(gfire_detector->instances)); + + if(!gfire_detector->instances) + gfire_game_detector_free(); +} + +void gfire_game_detector_set_external_game(guint32 p_gameid) +{ + if(!gfire_detector) + return; + + // Ignore external game while playing a non-external game + if(gfire_detector->game_data.id != 0 && gfire_detector->game_type != GFGT_EXTERNAL) + return; + + if(gfire_detector->game_data.id == 0 && p_gameid != 0) + { + // Playing an external game + gfire_detector->game_data.id = p_gameid; + gfire_detector->game_type = GFGT_EXTERNAL; + + // Stop process detection + g_source_remove(gfire_detector->det_source); + gfire_detector->det_source = 0; + + gfire_game_detector_inform_instances_game(); + } + else if(gfire_detector->game_data.id != 0 && p_gameid == 0) + { + // Stopped playing an external game + gfire_game_data_reset(&gfire_detector->game_data); + + // Start process detection + gfire_detector->det_source = g_timeout_add_seconds(GFIRE_DETECTION_INTERVAL, + (GSourceFunc)gfire_game_detector_detect_cb, NULL); + + gfire_game_detector_inform_instances_game(); + } +} + +gboolean gfire_game_detector_is_playing() +{ + return (gfire_detector && gfire_detector->game_data.id != 0); +} + +gboolean gfire_game_detector_is_voiping() +{ + return (gfire_detector && gfire_detector->voip_data.id != 0); +} + +guint32 gfire_game_detector_current_gameid() +{ + if(gfire_detector) + return gfire_detector->game_data.id; + else + return 0; +} + +const gfire_game_data *gfire_game_detector_current_game() +{ + if(gfire_detector) + return &gfire_detector->game_data; + else + return NULL; +} + +guint32 gfire_game_detector_current_voipid() +{ + if(gfire_detector) + return gfire_detector->voip_data.id; + else + return 0; +} + +const gfire_game_data *gfire_game_detector_current_voip() +{ + if(gfire_detector) + return &gfire_detector->voip_data; + else + return NULL; +} + +gfire_process_list *gfire_process_list_new() +{ + gfire_process_list *ret = g_malloc0(sizeof(gfire_process_list)); + if(!ret) + return NULL; + + return ret; +} + +void gfire_process_list_free(gfire_process_list *p_list) +{ + if(!p_list) + return; + + gfire_process_list_clear(p_list); + g_free(p_list); +} + +process_info *gfire_process_info_new(const gchar *p_exe, const guint32 p_pid, const gchar *p_args) +{ + if (!p_exe || !p_pid) + return NULL; + + process_info *ret = g_malloc0(sizeof(process_info)); + + ret->exe = g_strdup(p_exe); + ret->pid = p_pid; + + if(p_args) + ret->args = g_strdup(p_args); + + return ret; +} + +static void gfire_process_info_free(process_info *p_info) +{ + if(!p_info) + return; + + if(p_info->exe) + g_free(p_info->exe); + + if(p_info->args) + g_free(p_info->args); + + g_free(p_info); +} + +void gfire_process_list_clear(gfire_process_list *p_list) +{ + if(!p_list) + return; + + while(p_list->processes) + { + gfire_process_info_free((process_info*)p_list->processes->data); + p_list->processes = g_list_delete_link(p_list->processes, p_list->processes); + } +} + +guint32 gfire_process_list_contains(const gfire_process_list *p_list, const gchar *p_exe, const GList *p_required_args, + const GList *p_invalid_args/*, const GList *p_required_libraries*/) +{ + if(!p_list || !p_list->processes || !p_exe) + return FALSE; + +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_contains: checking for \"%s\"\n", p_exe); +#endif // DEBUG_VERBOSE + + GList *cur = p_list->processes; + while(cur) + { + process_info *info = cur->data; + if(!info) + continue; + +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_contains: comparing with \"%s\"\n", info->exe); +#endif // DEBUG_VERBOSE + +#ifdef _WIN32 + // Windows handles file names case-insensitive in contrast to most other OSes + if(purple_utf8_strcasecmp(info->exe, p_exe) == 0) +#else + if(g_strcmp0(info->exe, p_exe) == 0) +#endif // _WIN32 + { + // First check invalid arguments + gboolean process_invalid_args = FALSE; + + const GList *cur_arg = p_invalid_args; + while(cur_arg) + { + if (strstr(info->args, cur_arg->data) != NULL) + { + process_invalid_args = TRUE; + break; + } + cur_arg = g_list_next(cur_arg); + } + + // Then check required args + gboolean process_required_args = TRUE; + + if (process_invalid_args != TRUE) + { + cur_arg = p_required_args; + while(cur_arg) + { + if (strstr(info->args, cur_arg->data) == NULL) + { + process_required_args = FALSE; + break; + } + cur_arg = g_list_next(cur_arg); + } + } + + // Finally check required libraries + /*gboolean process_required_libraries = TRUE; +#ifndef _WIN32 + if (p_required_libraries) + { + process_required_libraries = FALSE; + + // Get process libs + GList *process_libs = gfire_game_detection_get_process_libraries(info->pid); + GList *cur_lib = process_libs; + + for(; cur_lib != NULL; cur_lib = g_list_next(cur)) + { + const GList *cur_req_lib = p_required_libraries; + while(cur_req_lib) + { + if (!g_strcmp0(g_strchomp(cur_lib->data), cur_req_lib->data)) + { + process_required_libraries = TRUE; + break; + } + cur_req_lib = g_list_next(cur_req_lib); + } + + if (process_required_libraries) + break; + } + + gfire_game_detection_process_libraries_clear(process_libs); + g_list_free(process_libs); + } +#endif // _WIN32*/ + + // Return as found if valid + if ((process_invalid_args == FALSE) && (process_required_args == TRUE) /*&& process_required_libraries == TRUE*/) + { +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_contains: MATCH!\n"); +#endif // DEBUG_VERBOSE + return info->pid; + } +#ifdef DEBUG_VERBOSE + else + purple_debug_info("gfire", "gfire_process_list_contains: failed args test: %d/%d\n", process_invalid_args, process_required_args); +#endif // DEBUG_VERBOSE + + } + + cur = g_list_next(cur); + } + +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_contains: no match!\n"); +#endif // DEBUG_VERBOSE + return 0; +} + +guint32 gfire_process_list_get_pid(const gfire_process_list *p_list, const gchar *p_exe) +{ + if (!p_list || !p_exe) + return 0; + + GList *cur = p_list->processes; + while(cur) + { + process_info *info = cur->data; + if(!info) + continue; + + if(!g_strcmp0(info->exe, p_exe)) + return info->pid; + + cur = g_list_next(cur); + } + + // Return nothing found + return 0; +} diff -Nru gfire-0.8.3/src/gf_game_detection.h gfire-0.9.4/src/gf_game_detection.h --- gfire-0.8.3/src/gf_game_detection.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_game_detection.h 2011-03-14 20:24:37.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_GAME_DETECTION_H + +#include "gf_base.h" + +#include "gfire.h" +#include "gf_server_detection.h" + +#define GFIRE_DETECTION_INTERVAL 10 // in seconds +#define GFIRE_WEB_DETECTION_TIMEOUT 6 // in seconds + + +typedef struct _process_info +{ + guint32 pid; + gchar *args; + gchar *exe; +} process_info; + +typedef struct _gfire_process_list +{ + GList *processes; +} gfire_process_list; + +typedef enum +{ + GFGT_PROCESS = 0, + GFGT_EXTERNAL, + GFGT_WEB +} gfire_game_detection_type; + +typedef struct +{ + int socket; + guint input; + gchar buffer[8193]; // 8 KiB + 1B for 0 + guint reclen; +} gfire_game_detection_http_connection; + +typedef struct _gfire_game_detector +{ + // Process list + gfire_process_list *process_list; + + // Detected programs + gfire_game_data game_data; + gfire_game_data voip_data; + gfire_game_detection_type game_type; + + // Server detection + guint8 server_detection_ref; + GMutex *server_mutex; + // Game + gfire_server_detector *g_server_detector; + gboolean g_server_changed; + guint32 g_server_ip; + guint16 g_server_port; + // VoIP + gfire_server_detector *v_server_detector; + gboolean v_server_changed; + guint32 v_server_ip; + guint16 v_server_port; + + // Webgame detection + int socket; + guint bind_timeout; + guint accept_input; + GList *connections; + guint timeout_check; + glong web_timeout; + + // Detection timer + guint det_source; + + // Registered Gfire instances + GList *instances; +} gfire_game_detector; + +// OS independent (gf_game_detection.c) ////////////////////////////////////// +// Gfire Game Detector +void gfire_game_detector_register(gfire_data *p_gfire); +void gfire_game_detector_unregister(gfire_data *p_gfire); + +void gfire_game_detector_set_external_game(guint32 p_gameid); + +gboolean gfire_game_detector_is_playing(); +gboolean gfire_game_detector_is_voiping(); + +guint32 gfire_game_detector_current_gameid(); +const gfire_game_data *gfire_game_detector_current_game(); +guint32 gfire_game_detector_current_voipid(); +const gfire_game_data *gfire_game_detector_current_voip(); + +// Gfire Process List +gfire_process_list *gfire_process_list_new(); +void gfire_process_list_free(gfire_process_list *p_list); +void gfire_process_list_clear(gfire_process_list *p_list); +guint32 gfire_process_list_contains(const gfire_process_list *p_list, const gchar *p_exe, const GList *p_required_args, const GList *p_invalid_args/*, const GList *p_required_libraries*/); +guint32 gfire_process_list_get_pid(const gfire_process_list *p_list, const gchar *p_exe); +//GList *gfire_game_detection_get_process_libraries(const guint32 p_pid); + +// For internal use only +process_info *gfire_process_info_new(const gchar *p_exe, const guint32 p_pid, const gchar *p_args); + +// OS dependent (gf_game_detection_X.c) //////////////////////////////////// +void gfire_process_list_update(gfire_process_list *p_list); +//void gfire_game_detection_process_libraries_clear(GList *p_list); + +#endif // _GF_GAME_DETECTION_H diff -Nru gfire-0.8.3/src/gf_game_detection_linux.c gfire-0.9.4/src/gf_game_detection_linux.c --- gfire-0.8.3/src/gf_game_detection_linux.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_game_detection_linux.c 2011-03-14 20:24:27.000000000 +0000 @@ -0,0 +1,481 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +// Enable GNU extensions on glibc +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif // !_GNU_SOURCE + +#include +#include + +#include "gf_game_detection.h" + +static const gchar *get_winepath(const gchar *p_wine_prefix, const gchar *p_command) +{ + static gchar cmd_out[PATH_MAX]; + + gchar *cmd = NULL; + if(!p_wine_prefix) + cmd = g_strdup_printf("winepath -u '%s'", p_command); + else + cmd = g_strdup_printf("WINEPREFIX='%s' winepath -u '%s'", p_wine_prefix, p_command); + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_winepath: Executing \"%s\"\n", cmd); +#endif // DEBUG_VERBOSE + + FILE *winepath = popen(cmd, "r"); + g_free(cmd); + + if(!winepath) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_winepath: popen() failed\n"); +#endif // DEBUG + return NULL; + } + + if(!fgets(cmd_out, PATH_MAX, winepath)) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_winepath: fgets() failed\n"); +#endif // DEBUG + pclose(winepath); + return NULL; + } + + + pclose(winepath); + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_winepath: Result \"%s\"\n", cmd_out); +#endif // DEBUG_VERBOSE + + // Remove trailing spaces and return + return g_strstrip(cmd_out); +} + +static const gchar *get_proc_exe(const gchar *p_proc_path) +{ + static gchar exe[PATH_MAX]; + + gchar *proc_exe = g_strdup_printf("%s/exe", p_proc_path); +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_proc_exe: Resolving symlink \"%s\"\n", proc_exe); +#endif // DEBUG_VERBOSE + + int len = readlink(proc_exe, exe, PATH_MAX - 1); + if(len == -1) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_proc_exe: readlink() failed\n"); +#endif // DEBUG + g_free(proc_exe); + return NULL; + } + + exe[len] = 0; +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_proc_exe: \"%s\" -> \"%s\"\n", proc_exe, exe); +#endif // DEBUG_VERBOSE + g_free(proc_exe); + + return exe; +} + +static void get_proc_cmdline(gchar **p_command, gchar **p_args, const gchar *p_proc_path) +{ + // Get process cmdline + gchar *proc_cmdline = g_strdup_printf("%s/cmdline", p_proc_path); +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_proc_cmdline: Reading command line from \"%s\"\n", proc_cmdline); +#endif // DEBUG_VERBOSE + + FILE *fcmdline = fopen(proc_cmdline, "r"); + g_free(proc_cmdline); + + if(!fcmdline) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_proc_cmdline: fopen() failed\n"); +#endif // DEBUG + return; + } + + gchar *line = NULL; + size_t line_len = 0; + gboolean first = TRUE; + GString *arg_str = g_string_new(""); + + while(getdelim(&line, &line_len, 0, fcmdline) != -1) + { + if(!first) + g_string_append_printf(arg_str, "%s ", line); + else + { + first = FALSE; + *p_command = g_strdup(line); + } + } + g_free(line); + + fclose(fcmdline); + + *p_args = g_strstrip(g_string_free(arg_str, FALSE)); +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_proc_cmdline: Command \"%s\"; Args: \"%s\"\n", *p_command, *p_args); +#endif // DEBUG_VERBOSE +} + +static GHashTable *get_environ(const gchar *p_proc_path) +{ + // Get process environment + gchar *proc_environ = g_strdup_printf("%s/environ", p_proc_path); +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_environ: Reading environment from \"%s\"\n", proc_environ); +#endif // DEBUG_VERBOSE + + FILE *fenviron = fopen(proc_environ, "r"); + g_free(proc_environ); + + if(!fenviron) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_environ: fopen() failed\n"); +#endif // DEBUG + return NULL; + } + + GHashTable *ret = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + + gchar *line = NULL; + size_t line_len = 0; + + while(getdelim(&line, &line_len, 0, fenviron) != -1) + { + const gchar *equal = strchr(line, '='); + if(!equal) + continue; + + g_hash_table_insert(ret, g_strndup(line, equal - line), g_strdup(equal + 1)); + } + fclose(fenviron); + g_free(line); + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_environ: saved %u values\n", g_hash_table_size(ret)); +#endif // DEBUG_VERBOSE + return ret; +} + +static const gchar *get_proc_cwd(GHashTable *p_environ, const gchar *p_proc_path) +{ + static gchar cwd[PATH_MAX]; + + gchar *proc_cwd = g_strdup_printf("%s/cwd", p_proc_path); +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_proc_cwd: No match, resolving symlink \"%s\"\n", proc_cwd); +#endif // DEBUG_VERBOSE + + if(readlink(proc_cwd, cwd, PATH_MAX) == -1) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_proc_cwd: readlink() failed\n"); +#endif // DEBUG + g_free(proc_cwd); + return NULL; + } + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "get_proc_cwd: \"%s\" -> \"%s\"\n", proc_cwd, cwd); +#endif // DEBUG_VERBOSE + g_free(proc_cwd); + return cwd; +} + +void gfire_process_list_update(gfire_process_list *p_list) +{ + if(!p_list) + return; + +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_update: TRACE\n"); +#endif // DEBUG_VERBOSE + + gfire_process_list_clear(p_list); + + DIR *proc = opendir("/proc"); + struct dirent *proc_dirent; + + if(!proc) + { + purple_debug_error("gfire", "gfire_process_list_update: opendir() failed\n"); + return; + } + + while((proc_dirent = readdir(proc))) + { +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_update: checking: \"%s\"\n", proc_dirent->d_name); +#endif // DEBUG_VERBOSE + + // Check if we got a valid process dir + gboolean dir_valid = TRUE; + int i = 0; + for(; i < strlen(proc_dirent->d_name); i++) + { + if(!g_ascii_isdigit(proc_dirent->d_name[i])) + { + dir_valid = FALSE; + break; + } + } + if(!dir_valid) + { +#ifdef DEBUG_VERBOSE + purple_debug_error("gfire", "gfire_process_list_update: \"%s\" is no valid process directory\n", + proc_dirent->d_name); +#endif // DEBUG_VERBOSE + continue; + } + + gchar *proc_path = g_strdup_printf("/proc/%s", proc_dirent->d_name); + + // Check if it is a directory and owned by the current user + struct stat process_stat; + if(stat(proc_path, &process_stat) == -1) + { +#ifdef DEBUG + purple_debug_error("gfire", "gfire_process_list_update: stat(\"%s\") failed\n", proc_path); +#endif // DEBUG + g_free(proc_path); + continue; + } + + // Don't check current process if not owned + if(geteuid() != process_stat.st_uid || !S_ISDIR(process_stat.st_mode)) + { +#ifdef DEBUG_VERBOSE + purple_debug_error("gfire", "gfire_process_list_update: \"%s\" is not owned by current user\n", + proc_dirent->d_name); +#endif // DEBUG_VERBOSE + g_free(proc_path); + continue; + } + + // Get process id + guint32 process_id; + sscanf(proc_dirent->d_name, "%u", &process_id); + + // Get process exe + const gchar *process_exe = get_proc_exe(proc_path); + if(!process_exe) + { + g_free(proc_path); + continue; + } + + // Get process' command line + gchar *process_cmd = NULL; + gchar *process_args = NULL; + get_proc_cmdline(&process_cmd, &process_args, proc_path); + + gchar *process_real_exe = NULL; + // Different behaviour for Wine processes + if(strstr(process_exe, "wine-preloader")) + { +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "gfire_process_list_update: WINE game! Starting WINE based detection...\n"); +#endif // DEBUG_VERBOSE + + // Get Wine prefix for winepath + GHashTable *environ = get_environ(proc_path); + const gchar *prefix = NULL; + if(environ) + prefix = g_hash_table_lookup(environ, "WINEPREFIX"); + +#ifdef DEBUG_VERBOSE + if(prefix) + purple_debug_misc("gfire", "gfire_process_list_update: WINEPREFIX=\"%s\"\n", prefix); + else + purple_debug_misc("gfire", "gfire_process_list_update: no WINEPREFIX set\n"); +#endif // DEBUG_VERBOSE + + // Get process name using winepath + const gchar *real_path = get_winepath(prefix, process_cmd); + + // Some error occured + if(!real_path) + { + g_hash_table_destroy(environ); + g_free(process_cmd); + g_free(process_args); + g_free(proc_path); + continue; + } + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "gfire_process_list_update: Canonicalizing path: \"%s\"\n", real_path); +#endif // DEBUG_VERBOSE + + // Get the physical path +#ifdef GF_OS_BSD + gchar phys_path_buf[PATH_MAX]; + gchar *phys_path = realpath(real_path, phys_path_buf); +#else + gchar *phys_path = canonicalize_file_name(real_path); +#endif // GF_OS_BSD + + // We might have only the executables name, try with adding the CWD + if(!phys_path) + { +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "gfire_process_list_update: No such file :'( Trying to prepend the CWD...\n"); +#endif // DEBUG_VERBOSE + const gchar *cwd = get_proc_cwd(environ, proc_path); + // Okay, we really can't do anything about it + if(!cwd) + { + g_hash_table_destroy(environ); + g_free(process_cmd); + g_free(process_args); + g_free(proc_path); + continue; + } + + gchar *full_cmd = g_strdup_printf("%s/%s", cwd, process_cmd); + g_free(process_cmd); + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "gfire_process_list_update: Trying the following path: \"%s\"\n", full_cmd); +#endif // DEBUG_VERBOSE + + real_path = get_winepath(prefix, full_cmd); + g_free(full_cmd); + g_hash_table_destroy(environ); + + // Again some error :'( + if(!real_path) + { + g_free(process_args); + g_free(proc_path); + continue; + } + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "gfire_process_list_update: Canonicalizing path: \"%s\"\n", real_path); +#endif // DEBUG_VERBOSE + + // Try again +#ifdef GF_OS_BSD + phys_path = realpath(real_path, phys_path_buf); +#else + phys_path = canonicalize_file_name(real_path); +#endif // GF_OS_BSD + + // Okay...we lost + if(!phys_path) + { +#ifdef DEBUG_VERBOSE + purple_debug_error("gfire", "gfire_process_list_update: No such file, we give up...\n"); +#endif // DEBUG_VERBOSE + g_free(process_args); + g_free(proc_path); + continue; + } + } + else + { + g_hash_table_destroy(environ); + g_free(process_cmd); + } + + process_real_exe = phys_path; + } + else + { + g_free(process_cmd); + process_real_exe = g_strdup(process_exe); + } + + // Add process to list + process_info *info = gfire_process_info_new(process_real_exe, process_id, process_args); +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "gfire_process_list_update: added process: pid=%u exe=\"%s\" args=\"%s\"\n", + process_id, process_real_exe, process_args); +#endif // DEBUG_VERBOSE + p_list->processes = g_list_append(p_list->processes, info); + +#ifndef GF_OS_BSD + g_free(process_real_exe); +#endif // !GF_OS_BSD + g_free(process_args); + g_free(proc_path); + } + + closedir(proc); +} + +/*GList *gfire_game_detection_get_process_libraries(const guint32 p_pid) +{ + GList *process_libs = NULL; + + gchar *proc_libs_path = g_strdup_printf("/proc/%u/smaps", p_pid); + FILE *proc_libs = fopen(proc_libs_path, "r"); + g_free(proc_libs_path); + + if(proc_libs) + { + gchar buf[1024]; + while(!feof(proc_libs)) + { + if(fgets(buf, 1024, proc_libs)) + { + if(strstr(buf, ".so")) + { + // Getting file part only, using 20 spaces as delimiter + gchar *libs_file_part = strstr(buf, " "); + if(libs_file_part) + { + libs_file_part = g_path_get_basename(libs_file_part + 20); + process_libs = g_list_append(process_libs, libs_file_part); + } + } + } + } + + fclose(proc_libs); + } + + return process_libs; +} + +void gfire_game_detection_process_libraries_clear(GList *p_list) +{ + while (p_list != NULL) + { + if(p_list->data) + g_free(p_list->data); + + p_list = g_list_next(p_list); + } +}*/ diff -Nru gfire-0.8.3/src/gf_game_detection_win.c gfire-0.9.4/src/gf_game_detection_win.c --- gfire-0.8.3/src/gf_game_detection_win.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_game_detection_win.c 2011-03-14 20:24:23.000000000 +0000 @@ -0,0 +1,329 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_game_detection.h" + +#ifdef _WIN32 + +// Required headers +#include +#include +#include + +// Windows Kernel Functionality +typedef struct _PROCESS_BASIC_INFORMATION +{ + DWORD ExitStatus; + PVOID PebBaseAddress; + DWORD AffinityMask; + DWORD BasePriority; + DWORD UniqueProcessId; + DWORD ParentProcessId; +} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; + +typedef struct _UNICODE_STRING +{ + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; +} UNICODE_STRING, *PUNICODE_STRING; + +#ifndef NTSTATUS +typedef long NTSTATUS; +#endif // NTSTATUS + +typedef NTSTATUS (NTAPI *_NtQueryInformationProcess)( + HANDLE ProcessHandle, + DWORD ProcessInformationClass, + PVOID ProcessInformation, + DWORD ProcessInformationLength, + PDWORD ReturnLength); + +static _NtQueryInformationProcess NtQueryInformationProcess = NULL; + +static gboolean acquirePrivileges() +{ + HANDLE token; + TOKEN_PRIVILEGES tkp = {0}; + + if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) + { + purple_debug_error("gfire", "acquirePrivileges: couldn't open process token\n"); + return FALSE; + } + + if(LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid)) + { + tkp.PrivilegeCount = 1; + tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + AdjustTokenPrivileges(token, FALSE, &tkp, 0, NULL, 0); + CloseHandle(token); + + if(GetLastError() != ERROR_SUCCESS) + { + purple_debug_error("gfire", "acquirePrivileges: couldn't set debug privilege\n"); + return FALSE; + } + + return TRUE; + } + + purple_debug_error("gfire", "acquirePrivileges: no debug privilege available\n"); + + CloseHandle(token); + return FALSE; +} + +static PVOID get_peb_address(HANDLE p_process_handle) +{ + if(!NtQueryInformationProcess) + { + NtQueryInformationProcess = (_NtQueryInformationProcess)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtQueryInformationProcess"); + if(!NtQueryInformationProcess) + { + purple_debug_error("gfire", "get_peb_address: No NtQueryInformationProcess available!\n"); + return NULL; + } + } + + PROCESS_BASIC_INFORMATION pbi; + + if(NtQueryInformationProcess(p_process_handle, 0, &pbi, sizeof(pbi), NULL) < 0) + { + purple_debug_error("gfire", "NtQueryInformationProcess: failed\n"); + return NULL; + } + return pbi.PebBaseAddress; +} + +static gboolean get_process_cmdline(gint p_pid, gchar **p_exe, gchar **p_cmd_line) +{ +#ifdef DEBUG_VERBOSE + purple_debug_info("gfire", "trace: get_process_cmdline(%d)\n", p_pid); +#endif // DEBUG_VERBOSE + + HANDLE process; + PVOID peb; + PVOID rtlUserProcParamsAddress; + UNICODE_STRING cmdline; + WCHAR *cmdline_buff; + + if((process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, p_pid)) == 0) + { + // Don't handle missing permissions as an error + if(GetLastError() != ERROR_ACCESS_DENIED) + { + gchar tmpError[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, tmpError, 1024, NULL); + purple_debug_error("gfire", "get_process_cmdline: Could not open process for reading:\n(%u) %s", (guint)GetLastError(), tmpError); + } +#ifdef DEBUG + else + purple_debug_error("gfire", "get_process_cmdline: Could not open process for reading:\n Access denied\n"); +#endif // DEBUG + + return FALSE; + } + + peb = get_peb_address(process); + if(!peb) + { +#ifdef DEBUG + purple_debug_error("gfire", "get_process_cmdline: bad peb address!\n"); +#endif // DEBUG + return FALSE; + } + + if(!ReadProcessMemory(process, (PCHAR)peb + 0x10, &rtlUserProcParamsAddress, sizeof(PVOID), NULL)) + { + if(GetLastError() != ERROR_ACCESS_DENIED && GetLastError() != ERROR_PARTIAL_COPY) + { + gchar tmpError[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, tmpError, 1024, NULL); + purple_debug_error("gfire", "get_process_cmdline: Could not read the address of ProcessParameters:\n(%u) %s", (guint)GetLastError(), tmpError); + } +#ifdef DEBUG + else + purple_debug_error("gfire", "get_process_cmdline: Could not read the address of ProcessParameters:\n Access denied/Partial Read\n"); +#endif // DEBUG + + CloseHandle(process); + return FALSE; + } + + if(!ReadProcessMemory(process, (PCHAR)rtlUserProcParamsAddress + 0x40, &cmdline, sizeof(cmdline), NULL)) + { + if(GetLastError() != ERROR_ACCESS_DENIED && GetLastError() != ERROR_PARTIAL_COPY) + { + gchar tmpError[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, tmpError, 1024, NULL); + purple_debug_error("gfire", "get_process_cmdline: Could not read CommandLine:\n(%u) %s", (guint)GetLastError(), tmpError); + } +#ifdef DEBUG + else + purple_debug_error("gfire", "get_process_cmdline: Could not read CommandLine:\n Access denied/Partial Read\n"); +#endif // DEBUG + + CloseHandle(process); + return FALSE; + } + + cmdline_buff = (WCHAR*)g_malloc0(cmdline.Length); + if(!ReadProcessMemory(process, cmdline.Buffer, cmdline_buff, cmdline.Length, NULL)) + { + if(GetLastError() != ERROR_ACCESS_DENIED && GetLastError() != ERROR_PARTIAL_COPY) + { + gchar tmpError[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, tmpError, 1024, NULL); + purple_debug_error("gfire", "get_process_cmdline: Could not read the command line string:\n(%u) %s", (guint)GetLastError(), tmpError); + } +#ifdef DEBUG + else + purple_debug_error("gfire", "get_process_cmdline: Could not read the command line string:\n Access denied/Partial Read\n"); +#endif // DEBUG + + g_free(cmdline_buff); + CloseHandle(process); + return FALSE; + } + + *p_cmd_line = g_utf16_to_utf8((gunichar2*)cmdline_buff, cmdline.Length / 2, NULL, NULL, NULL); + g_free(cmdline_buff); + +#ifdef DEBUG + if(!*p_cmd_line) + purple_debug_error("gfire", "get_process_cmdline: g_utf16_to_utf8 failed on cmdline\n"); +#endif // DEBUG + + // Get process executable + cmdline_buff = (WCHAR*)g_malloc(2048); + DWORD len = GetModuleFileNameExW(process, NULL, cmdline_buff, 1024); + if(len == 0) + { + if(GetLastError() != ERROR_ACCESS_DENIED) + { + gchar tmpError[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, tmpError, 1024, NULL); + purple_debug_error("gfire", "get_process_cmdline: Could not read the executable filename string:\n(%u) %s", (guint)GetLastError(), tmpError); + } +#ifdef DEBUG + else + purple_debug_error("gfire", "get_process_cmdline: Could not read the executable filename string:\n Access denied\n"); +#endif // DEBUG + + g_free(cmdline_buff); + g_free(*p_cmd_line); + *p_cmd_line = NULL; + CloseHandle(process); + return FALSE; + } + + *p_exe = g_utf16_to_utf8((gunichar2*)cmdline_buff, len, NULL, NULL, NULL); + g_free(cmdline_buff); + +#ifdef DEBUG + if(!*p_exe) + purple_debug_error("gfire", "get_process_cmdline: g_utf16_to_utf8 failed on exe\n"); +#endif // DEBUG + + CloseHandle(process); + + return (*p_exe && *p_cmd_line); +} + +void gfire_process_list_update(gfire_process_list *p_list) +{ + if(!p_list) + return; + + gfire_process_list_clear(p_list); + + acquirePrivileges(); + + PROCESSENTRY32 pe; + memset(&pe, 0, sizeof(pe)); + + pe.dwSize = sizeof(pe); + + HANDLE hProcSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + if(!hProcSnapShot) + return; + + if(!Process32First(hProcSnapShot, &pe)) + { + CloseHandle(hProcSnapShot); + return; + } + + do + { + if(pe.th32ProcessID > 0) + { +#ifdef DEBUG + purple_debug_info("gfire", "detection: probing %s\n", pe.szExeFile); +#endif // DEBUG + + gchar *cmdline = NULL; + gchar *executable_file = NULL; + if(!get_process_cmdline(pe.th32ProcessID, &executable_file, &cmdline)) + continue; + + // Extract the args from the command line + gchar *args = strstr(g_strstrip(cmdline), pe.szExeFile); + if(args) + { + args += strlen(pe.szExeFile); + if(args[0] == 0) + args = NULL; + // If the first char behind the process' name is ", strip it + else if(args[0] == '\"') + { + args++; + if(args[0] == 0) + args = NULL; + } + } +#ifdef DEBUG + purple_debug_info("gfire", "executable file: %s\n", executable_file); + purple_debug_info("gfire", "cmdline: %s\n", cmdline); +#endif // DEBUG + if(args) + { + g_strstrip(args); +#ifdef DEBUG + purple_debug_info("gfire", "args: %s\n", args); +#endif // DEBUG + } + + // Add the process + process_info *info = gfire_process_info_new(executable_file, pe.th32ProcessID, args); + g_free(cmdline); + g_free(executable_file); + + p_list->processes = g_list_append(p_list->processes, info); + } + } while(Process32Next(hProcSnapShot, &pe)); + + CloseHandle(hProcSnapShot); +} + +#endif // _WIN32 diff -Nru gfire-0.8.3/src/gf_games.c gfire-0.9.4/src/gf_games.c --- gfire-0.8.3/src/gf_games.c 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_games.c 2011-03-14 20:24:15.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -19,675 +18,1595 @@ * You should have received a copy of the GNU General Public License * along with Gfire. If not, see . */ -#include "gfire.h" -#include "gf_packet.h" -#include "gf_network.h" + #include "gf_games.h" +#include "gfire.h" +#include +// Static game data & configuration for game handling (shared by all Gfire instances) +static guint32 gfire_games_version = 0; +static GList *gfire_games = NULL; +static GList *gfire_games_external = NULL; +static GList *gfire_games_config = NULL; -void gfire_xml_download_cb( +void gfire_update_games_list_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const gchar *p_buf, gsize p_len, const gchar *p_error_message) +{ + gfire_games_update_done(); - PurpleUtilFetchUrlData *url_data, - gpointer data, - const char *buf, + if (!p_data || !p_buf || !p_len) + purple_debug_error("gfire", "An error occured while updating the games list. Website down?\n"); + else if(purple_util_write_data_to_file("gfire_games.xml", p_buf, p_len)) + { + gfire_game_load_games_xml(); + + gchar *version = gfire_game_get_version_str(); + gchar *msg = g_strdup_printf(_("The Games List has been updated to version: %s."), version); + g_free(version); +#ifdef USE_NOTIFICATIONS + if(purple_account_get_bool(purple_connection_get_account(p_data), "use_notify", TRUE)) + gfire_notify_system(_("New Gfire Game List Version"), msg); + else +#endif // USE_NOTIFICATIONS + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("New Gfire Game List Version"), + _("New Gfire Game List Version"), msg, NULL, NULL); + g_free(msg); + } + else + purple_debug_error("gfire", "An error occured while updating the games list. Website down?\n"); +} - gsize len, - const gchar *error_message - ); +void gfire_game_data_reset(gfire_game_data *p_game) +{ + if(!p_game) + return; + p_game->id = 0; + p_game->ip.value = 0; + p_game->port = 0; +} -/** - * Returns via *buffer the name of the game identified by int game - * if the game doesn't exist, it uses the game number as the name - * - * @param buffer pointer to string return value will be here - * @param game integer ID of the game to translate -*/ -char *gfire_game_name(PurpleConnection *gc, int game) +void gfire_game_data_ip_from_str(gfire_game_data *p_game, const gchar *p_ipstr) { - xmlnode *node = NULL; - const char *name = NULL; - const char *num = NULL; - char *ret = NULL; - int found = FALSE; - int id = 0; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return NULL; - - if (gfire->xml_games_list != NULL) { - node = xmlnode_get_child(gfire->xml_games_list, "game"); - while (node) { - name = xmlnode_get_attrib(node, "name"); - num = xmlnode_get_attrib(node, "id"); - id = atoi((const char *)num); - if (id == game) { - found = TRUE; - } - if (found) break; - node = xmlnode_get_next_twin(node); + if(!p_game || !p_ipstr) + return; + + gchar **ip_octet_strs = g_strsplit(p_ipstr, ".", -1); + if(!ip_octet_strs) + return; + + guint8 i = 0; + for(i = 4; i > 0; i--) + { + if(!ip_octet_strs[4 - i]) + { + p_game->ip.value = 0; + g_strfreev(ip_octet_strs); + return; } - /* if we didn't find the game just show game ID */ - if (!found) { - ret = g_strdup_printf("%d",game); - } else ret = g_strdup(gfire_escape_html(name)); - }else{ - /* uhh our gfire_games.xml was not found */ - ret = g_strdup_printf("%d",game); + + p_game->ip.octets[i - 1] = atoi(ip_octet_strs[4 - i]); } - return ret; + + g_strfreev(ip_octet_strs); } +gboolean gfire_game_data_is_valid(const gfire_game_data *p_game) +{ + return (p_game && (p_game->id != 0)); +} -/** - * Parses XML file to convert xfire game ID's to names - * - * @param filename The filename to parse (xml) - * - * @return TRUE if parsed ok, FALSE otherwise -*/ -gboolean gfire_parse_games_file(PurpleConnection *gc, const char *filename) +gboolean gfire_game_data_has_addr(const gfire_game_data *p_game) { - xmlnode *node = NULL; - GError *error = NULL; - gchar *contents = NULL; - gsize length; - gfire_data *gfire = NULL; + return (p_game && (p_game->ip.value != 0)); +} - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return FALSE; +gchar *gfire_game_data_ip_str(const gfire_game_data *p_game) +{ + if(!p_game) + return NULL; - purple_debug(PURPLE_DEBUG_INFO, "gfire", - "XML Games import, Reading %s\n", NN(filename)); + return g_strdup_printf("%u.%u.%u.%u", p_game->ip.octets[3], p_game->ip.octets[2], p_game->ip.octets[1], p_game->ip.octets[0]); +} + +gchar *gfire_game_data_port_str(const gfire_game_data *p_game) +{ + if(!p_game) + return NULL; - if (!g_file_test(filename, G_FILE_TEST_EXISTS)) { - /* file not found try to grab from url */ + return g_strdup_printf("%u", p_game->port); +} - purple_util_fetch_url(GFIRE_GAMES_XML_URL, TRUE, "Purple-xfire", TRUE, gfire_xml_download_cb, (void *)gc); +gchar *gfire_game_data_addr_str(const gfire_game_data *p_game) +{ + if(!p_game) + return NULL; - return FALSE; + return g_strdup_printf("%u.%u.%u.%u:%u", p_game->ip.octets[3], p_game->ip.octets[2], p_game->ip.octets[1], p_game->ip.octets[0], p_game->port); +} + +const gfire_game *gfire_game_by_id(guint32 p_gameid) +{ + GList *cur = gfire_games; + for(; cur; cur = g_list_next(cur)) + { + if(((gfire_game*)cur->data)->id == p_gameid) + return (gfire_game*)cur->data; } - if (!g_file_get_contents(filename, &contents, &length, &error)) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", - "XML Games import, Error reading game list: %s\n", NN(error->message)); - g_error_free(error); - return FALSE; + return NULL; +} + +static const gfire_game *gfire_game_by_name(const gchar *p_name) +{ + GList *cur = gfire_games; + for(; cur; cur = g_list_next(cur)) + { + if(!purple_utf8_strcasecmp(((gfire_game*)cur->data)->name, p_name)) + return (gfire_game*)cur->data; } - node = xmlnode_from_str(contents, length); - - if (!node) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", - "XML Games import, Error parsing XML file: %s\n", NN(filename)); - g_free(contents); - return FALSE; + return NULL; +} + +guint32 gfire_game_id_by_url(const gchar *p_url) +{ + if(!p_url) + return 0; + + gchar *url_down = g_ascii_strdown(p_url, -1); + + GList *cur = gfire_games_external; + for(; cur; cur = g_list_next(cur)) + { + gfire_game_detection_set *dset = NULL; + + GList *set = ((gfire_game*)cur->data)->detection_sets; + for(; set; set = g_list_next(set)) + { + dset = (gfire_game_detection_set*)set->data; + if(!dset->external) + continue; + + if(dset->detect_url) + { + if(strstr(url_down, dset->detect_url)) + { + g_free(url_down); + return ((gfire_game*)cur->data)->id; + } + } + + if(dset->launch_url) + { + if(strstr(url_down, dset->launch_url)) + { + g_free(url_down); + return ((gfire_game*)cur->data)->id; + } + } + } } - gfire->xml_games_list = node; - g_free(contents); - return TRUE; -}; + g_free(url_down); + return 0; +} -/** - * Parses launchinfo.xml file into memory for launching games - * directly from right click menu - * - * @param filename filename of the xml file to parse (dir+fname) - * - * @return boolean return true on success, false on failure -**/ -gboolean gfire_parse_launchinfo_file(PurpleConnection *gc, const char *filename) +gboolean gfire_game_have_list() { - gfire_data *gfire = NULL; - xmlnode *node = NULL; - GError *error = NULL; - gchar *contents = NULL; - gsize length; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !filename) return FALSE; - - purple_debug(PURPLE_DEBUG_INFO, "gfire", "launchinfo import Reading %s\n", NN(filename)); - if (!g_file_get_contents(filename, &contents, &length, &error)) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "launchinfo import Error reading launchinfo list: %s\n" - , NN(error->message)); - g_error_free(error); - return FALSE; + return (gfire_games != NULL); +} + +guint32 gfire_game_get_version() +{ + return gfire_games_version; +} + +gchar *gfire_game_get_version_str() +{ + time_t version = gfire_games_version; + struct tm *time_data = localtime(&version); + + gchar *local_str = g_malloc(100 * sizeof(gchar)); + strftime(local_str, 100, "%d %B %Y", time_data); + + gchar *ret = g_locale_to_utf8(local_str, -1, NULL, NULL, NULL); + g_free(local_str); + + if(!ret) + return g_strdup(_("Unknown")); + + return ret; +} + +guint32 gfire_game_id(const gchar *p_name) +{ + const gfire_game *game = gfire_game_by_name(p_name); + if(!game) + return 0; + + return game->id; +} + +gchar *gfire_game_name(guint32 p_gameid, gboolean p_html) +{ + const gfire_game *game = gfire_game_by_id(p_gameid); + if(!game) + return g_strdup_printf("%u", p_gameid); + + if(p_html) + return gfire_escape_html(game->name); + else + return g_strdup(game->name); +} + +gchar *gfire_game_short_name(guint32 p_gameid) +{ + const gfire_game *game = gfire_game_by_id(p_gameid); + if(!game) + return g_strdup_printf("%u", p_gameid); + + return gfire_escape_html(game->short_name); +} + +GList *gfire_game_excluded_ports_copy(const gfire_game *p_game) +{ + if(!p_game) + return NULL; + + GList *copy = NULL; + // Check the first set, servers should be the same for all different detection sets + gfire_game_detection_set *dset = (gfire_game_detection_set*)p_game->detection_sets->data; + if(dset) + { + GList *port = dset->excluded_ports; + while(port) + { + copy = g_list_append(copy, g_memdup(port->data, sizeof(guint16))); + port = g_list_next(port); + } } - node = xmlnode_from_str(contents, length); - - if (!node) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "launchinfo import Error parsing XML file: %s\n", NN(filename)); - g_free(contents); - return FALSE; + return copy; +} + +const gchar *gfire_game_server_query_type(guint32 p_gameid) +{ + const gfire_game *game = gfire_game_by_id(p_gameid); + if(!game) + return NULL; + + // Check the first set, servers should be the same for all different detection sets + if(game->detection_sets) + { + gfire_game_detection_set *dset = (gfire_game_detection_set*)game->detection_sets->data; + if(dset) + return dset->server_status_type; } - gfire->xml_launch_info = node; - g_free(contents); - return TRUE; + return NULL; } -/** - * Determines of a game is configured, and is playable - * - * @param gc Valid PurpleConnection - * @param game integer ID of game to check to see if its playable - * - * @return TRUE if game is playable, FALSE if not -*/ -gboolean gfire_game_playable(PurpleConnection *gc, int game) +gboolean gfire_game_foreach_dset(const gfire_game *p_game, GCallback p_callback, gpointer p_data, gboolean p_external) { - gfire_linfo *foo = NULL; - gfire_data *gfire = NULL; + if(!p_game || !p_callback) + return FALSE; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !game) return FALSE; - - foo = gfire_linfo_get(gc, game); - if (!foo) return FALSE; - gfire_linfo_free(foo); - return TRUE; + GList *cur = p_game->detection_sets; + while(cur) + { + gfire_game_detection_set *dset = (gfire_game_detection_set*)cur->data; + if(!p_external && dset->external) + { + cur = g_list_next(cur); + continue; + } + if(((gboolean(*)(const gfire_game*,const gfire_game_detection_set*,gpointer))p_callback)(p_game, dset, p_data)) + return TRUE; + + cur = g_list_next(cur); + } + + return FALSE; } +static gfire_game_detection_set *gfire_game_detection_set_create_from_xml(xmlnode *p_node) +{ + gfire_game_detection_set *ret = g_malloc0(sizeof(gfire_game_detection_set)); -/** - * gives the integer representation of the game the buddy is playing - * - * @param gc Valid PurpleConnection - * @param b Buddy to get game number of - * - * @return returns the game or 0 if the buddy is not playing -*/ -int gfire_get_buddy_game(PurpleConnection *gc, PurpleBuddy *b) + gchar *tmp = NULL; + + // Enable server detection + xmlnode *cur_node = xmlnode_get_child(p_node, "server_detection"); + if(cur_node) + { + tmp = xmlnode_get_data_unescaped(cur_node); + if(tmp) + { + if(!g_utf8_collate(tmp, "enabled")) + ret->detect_server = TRUE; + g_free(tmp); + } + } + + // Excluded ports + cur_node = xmlnode_get_child(p_node, "server_excluded_ports"); + if(cur_node) + { + tmp = xmlnode_get_data_unescaped(cur_node); + if(tmp) + { + gchar **parray = g_strsplit(tmp, ";", -1); + if(parray) + { + int i; + for(i = 0; i < g_strv_length(parray); i++) + { + if(parray[i][0] == 0) + continue; + + guint16 *port = g_malloc0(sizeof(guint16)); + sscanf(parray[i], "%hu", port); + + ret->excluded_ports = g_list_append(ret->excluded_ports, port); + } + g_strfreev(parray); + } + g_free(tmp); + } + } + + // Broadcast ports + cur_node = xmlnode_get_child(p_node, "server_broadcast_ports"); + if(cur_node) + { + tmp = xmlnode_get_data_unescaped(cur_node); + if(tmp) + { + gchar **parray = g_strsplit(tmp, ";", -1); + if(parray) + { + int i; + for(i = 0; i < g_strv_length(parray); i++) + { + if(parray[i][0] == 0) + continue; + + ret->server_broadcast_ports = g_list_append(ret->server_broadcast_ports, g_strdup(parray[i])); + } + g_strfreev(parray); + } + g_free(tmp); + } + } + + // Server game name + cur_node = xmlnode_get_child(p_node, "server_game_name"); + if(cur_node) + { + ret->server_game_name = xmlnode_get_data_unescaped(cur_node); + } + + // Server status type + cur_node = xmlnode_get_child(p_node, "server_status_type"); + if(cur_node) + { + ret->server_status_type = xmlnode_get_data_unescaped(cur_node); + } + + // Launch PW args + cur_node = xmlnode_get_child(p_node, "launch_password_args"); + if(cur_node) + { + ret->password_args = xmlnode_get_data_unescaped(cur_node); + } + + // Launch network args + cur_node = xmlnode_get_child(p_node, "launch_network_args"); + if(cur_node) + { + ret->network_args = xmlnode_get_data_unescaped(cur_node); + } + + // Launch args + cur_node = xmlnode_get_child(p_node, "launch_args"); + if(cur_node) + { + ret->launch_args = xmlnode_get_data_unescaped(cur_node); + } + + // Arguments + cur_node = xmlnode_get_child(p_node, "arguments"); + if(cur_node) + { + // Invalid args + if(xmlnode_get_attrib(cur_node, "invalid")) + { + gchar **args = g_strsplit(xmlnode_get_attrib(cur_node, "invalid"), ";", -1); + if(args) + { + int i; + for(i = 0; i < g_strv_length(args); i++) + { + if(args[i][0] == 0) + continue; + + ret->invalid_args = g_list_append(ret->invalid_args, g_strdup(args[i])); + } + + g_strfreev(args); + } + } + + // Required args + if(xmlnode_get_attrib(cur_node, "required")) + { + gchar **args = g_strsplit(xmlnode_get_attrib(cur_node, "required"), ";", -1); + if(args) + { + int i; + for(i = 0; i < g_strv_length(args); i++) + { + if(args[i][0] == 0) + continue; + + ret->required_args = g_list_append(ret->required_args, g_strdup(args[i])); + } + + g_strfreev(args); + } + } + } + + // External + cur_node = xmlnode_get_child(p_node, "external"); + if(cur_node) + { + ret->external = TRUE; + + // Detection URL + if(xmlnode_get_attrib(cur_node, "url")) + { + ret->detect_url = g_strdup(xmlnode_get_attrib(cur_node, "url")); + } + + // Launch URL + if(xmlnode_get_attrib(cur_node, "launchurl")) + { + ret->launch_url = g_strdup(xmlnode_get_attrib(cur_node, "launchurl")); + } + } + + return ret; +} + +static void gfire_game_detection_set_free(gfire_game_detection_set *p_dset) { - gfire_data *gfire = NULL; - GList *l = NULL; - gfire_buddy *gb = NULL; + gfire_list_clear(p_dset->excluded_ports); + gfire_list_clear(p_dset->server_broadcast_ports); + + if(p_dset->server_game_name) + g_free(p_dset->server_game_name); - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !b || !b->name) return 0; + if(p_dset->server_status_type) + g_free(p_dset->server_status_type); - l = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)b->name, GFFB_NAME); - if (!l || !(l->data)) return 0; - gb = (gfire_buddy *)l->data; - return gb->gameid; + if(p_dset->password_args) + g_free(p_dset->password_args); + + if(p_dset->network_args) + g_free(p_dset->network_args); + + if(p_dset->launch_args) + g_free(p_dset->launch_args); + + gfire_list_clear(p_dset->invalid_args); + gfire_list_clear(p_dset->required_args); + + if(p_dset->detect_url) + g_free(p_dset->detect_url); + + if(p_dset->launch_url) + g_free(p_dset->launch_url); + + g_free(p_dset); } +static gfire_game *gfire_game_create_from_xml(xmlnode *p_node, gboolean *p_external) +{ + gfire_game *ret = g_malloc0(sizeof(gfire_game)); + + if(xmlnode_get_attrib(p_node, "id")) + sscanf(xmlnode_get_attrib(p_node, "id"), "%u", &ret->id); -/** - * get port number of the game the buddy is playing - * - * @param gc Valid PurpleConnection - * @param b Buddy to get game number of - * - * @return returns the game or 0 if the buddy is not playing -*/ -int gfire_get_buddy_port(PurpleConnection *gc, PurpleBuddy *b) + if(xmlnode_get_attrib(p_node, "name")) + ret->name = g_strdup(xmlnode_get_attrib(p_node, "name")); + + if(xmlnode_get_attrib(p_node, "shortname")) + ret->short_name = g_strdup(xmlnode_get_attrib(p_node, "shortname")); + + if(xmlnode_get_child(p_node, "voice")) + ret->is_voice = TRUE; + + // Get all detection sets + xmlnode *dset_node = xmlnode_get_child(p_node, "detection"); + while(dset_node) + { + gfire_game_detection_set *dset = gfire_game_detection_set_create_from_xml(dset_node); + if(dset) + { + ret->detection_sets = g_list_append(ret->detection_sets, dset); + + *p_external = (*p_external || dset->external); + } + + dset_node = xmlnode_get_next_twin(dset_node); + } + + return ret; +} + +static void gfire_game_free(gfire_game *p_game) { - gfire_data *gfire = NULL; - GList *l = NULL; - gfire_buddy *gb = NULL; + if(p_game->name) + g_free(p_game->name); - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !b || !b->name) return 0; + if(p_game->short_name) + g_free(p_game->short_name); + + GList *cur = p_game->detection_sets; + while(cur) + { + gfire_game_detection_set_free((gfire_game_detection_set*)cur->data); + cur = g_list_next(cur); + } - l = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)b->name, GFFB_NAME); - if (!l || !(l->data)) return 0; - gb = (gfire_buddy *)l->data; - return gb->gameport; + g_list_free(p_game->detection_sets); + + g_free(p_game); } +gboolean gfire_game_load_games_xml() +{ + xmlnode *node = NULL; -/** - * get ip address of server where buddy is in game - * - * @param gc Valid PurpleConnection - * @param b Buddy to get game ip number of - * - * @return returns the ip address as a string or NULL if budy isn't playing -*/ -const gchar *gfire_get_buddy_ip(PurpleConnection *gc, PurpleBuddy *b) + gchar *filename = g_build_filename(purple_user_dir(), "gfire_games.xml", NULL); + if(filename) + { + purple_debug(PURPLE_DEBUG_INFO, "gfire", "Loading Game Data from: %s\n", filename); + g_free(filename); + } + + node = purple_util_read_xml_from_file("gfire_games.xml", "Gfire Games List"); + if(!node) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_game_load_games_xml: Couldn't load game list.\n"); + return FALSE; + } + + // Delete all old games + gfire_game_cleanup(); + + // Read the games version + if(g_utf8_collate(node->name, "games")) + { + xmlnode_free(node); + return FALSE; + } + + if(!xmlnode_get_attrib(node, "version")) + gfire_games_version = 0; + else + sscanf(xmlnode_get_attrib(node, "version"), "%u", &gfire_games_version); + + // Read all games + xmlnode *game_node = xmlnode_get_child(node, "game"); + while(game_node) + { + gboolean external = FALSE; + gfire_game *game = gfire_game_create_from_xml(game_node, &external); + if(game) + { + gfire_games = g_list_append(gfire_games, game); + if(external) + gfire_games_external = g_list_append(gfire_games_external, game); + } + + game_node = xmlnode_get_next_twin(game_node); + } + + xmlnode_free(node); + + return TRUE; +} + +void gfire_game_cleanup() { - gfire_data *gfire = NULL; - GList *l = NULL; - gfire_buddy *gb = NULL; - gchar *tmp = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !b || !b->name) return 0; - - l = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)b->name, GFFB_NAME); - if (!l || !(l->data)) return NULL; - gb = (gfire_buddy *)l->data; - if(gfire_get_buddy_game(gc ,b) != 0){ - tmp = g_malloc0(XFIRE_GAMEIP_LEN); - memcpy(tmp, gb->gameip, XFIRE_GAMEIP_LEN); -// g_sprintf(tmp, "%d.%d.%d.%d", gb->gameip[3], gb->gameip[2], gb->gameip[1], gb->gameip[0]); - return tmp; - } - return NULL; + GList *cur = gfire_games; + while(cur) + { + gfire_game_free((gfire_game*)cur->data); + + cur = g_list_next(cur); + } + g_list_free(gfire_games); + g_list_free(gfire_games_external); + gfire_games = NULL; + gfire_games_external = NULL; } +static gfire_game_configuration *gfire_game_configuration_create_from_xml(xmlnode *p_node) +{ + xmlnode *command_node = xmlnode_get_child(p_node, "command"); + if(!command_node) + return NULL; -/** - * Creates a newly allocated and zeroed launch info struct - * - * @return pointer to newly created zeroed structure -*/ -gfire_linfo *gfire_linfo_new() + gfire_game_configuration *ret = g_malloc0(sizeof(gfire_game_configuration)); + + if(xmlnode_get_attrib(p_node, "id")) + sscanf(xmlnode_get_attrib(p_node, "id"), "%u", &ret->game_id); + + xmlnode *cur_node = xmlnode_get_child(command_node, "detect"); + if(cur_node) + ret->detect_file = xmlnode_get_data_unescaped(cur_node); + + cur_node = xmlnode_get_child(command_node, "launch"); + if(cur_node) + ret->launch_file = xmlnode_get_data_unescaped(cur_node); + + cur_node = xmlnode_get_child(command_node, "prefix"); + if(cur_node) + ret->launch_prefix = xmlnode_get_data_unescaped(cur_node); + + return ret; +} + +// Only used by game manager +#ifdef HAVE_GTK +static gfire_game_configuration *gfire_game_configuration_create(guint32 p_gameid, const gchar *p_detect_file, + const gchar *p_launch_file, const gchar *p_prefix) { - gfire_linfo *ret = NULL; - ret = g_malloc0(sizeof(gfire_linfo)); + gfire_game_configuration *ret = g_malloc0(sizeof(gfire_game_configuration)); + + ret->game_id = p_gameid; + if(p_detect_file) + ret->detect_file = g_strdup(p_detect_file); + if(p_launch_file) + ret->launch_file = g_strdup(p_launch_file); + if(p_prefix) + ret->launch_prefix = g_strdup(p_prefix); + return ret; } +#endif // HAVE_GTK +static void gfire_game_configuration_free(gfire_game_configuration *p_gconf) +{ + if(p_gconf->detect_file) + g_free(p_gconf->detect_file); -/** - * Frees memory associated with launch info structure, passing null pointer - * causes function to return. - * - * @param *l pointer to associated structure to free (null ok) -*/ -void gfire_linfo_free(gfire_linfo *l) + if(p_gconf->launch_file) + g_free(p_gconf->launch_file); + + if(p_gconf->launch_prefix) + g_free(p_gconf->launch_prefix); + + g_free(p_gconf); +} + +static gint gfire_game_configuration_compare(const gfire_game_configuration *p_a, const gfire_game_configuration *p_b) { - if (!l) return; - g_free(l->name); - g_free(l->xqfname); - g_free(l->xqfmods); - g_free(l->c_bin); - g_free(l->c_wdir); - g_free(l->c_gmod); - g_free(l->c_connect); - g_free(l->c_options); - g_free(l->c_cmd); - g_free(l); + const gfire_game *game_a = gfire_game_by_id(p_a->game_id); + const gfire_game *game_b = gfire_game_by_id(p_b->game_id); + + if(!game_a) + return 1; + else if(!game_b) + return -1; + else + return g_strcmp0(game_a->name, game_b->name); } +static void gfire_game_config_sort() +{ + if(!gfire_games_config) + return; -/** - * Searches launch.xml node structure for associated game, and then returns launch - * info struct associated with that game. Returns NULL if game is not found. - * - * @param game integer xfire game ID of game to get and return - * - * @return Returns launch info structure with fields filled or - * NULL if game can't be found -*/ -gfire_linfo *gfire_linfo_get(PurpleConnection *gc, int game) + gfire_games_config = g_list_sort(gfire_games_config, (GCompareFunc)gfire_game_configuration_compare); +} + +gboolean gfire_game_load_config_xml(gboolean p_force) { - gfire_data *gfire = NULL; - gfire_linfo *l = NULL; + if(!p_force && gfire_games_config) + return TRUE; + xmlnode *node = NULL; - xmlnode *cnode = NULL; - xmlnode *command = NULL; - const char *name, *num; - int found = 0; - int id = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !game) return NULL; - - if (gfire->xml_launch_info != NULL) { - node = xmlnode_get_child(gfire->xml_launch_info, "game"); - while (node) { - name = xmlnode_get_attrib(node, "name"); - num = xmlnode_get_attrib(node, "id"); - id = atoi((const char *)num); -// printf("linfo id=%d\tname=\"%s\"\n", id, name); - if (id == game) { - found = 1; - } - if (found) break; - node = xmlnode_get_next_twin(node); - } - /* if we didn't find the game */ - if (!found) { - return NULL; - } - /* got the game */ - l = gfire_linfo_new(); - if (!l) return NULL; /* Out of Memory */ - - l->gameid = game; - l->name = g_strdup(name); - for (cnode = node->child; cnode; cnode = cnode->next) { - if (cnode->type != XMLNODE_TYPE_TAG) - continue; - if (!strcmp(cnode->name, "xqf")) { - l->xqfname = g_strdup((gchar *)xmlnode_get_attrib(cnode, "name")); - l->xqfmods = g_strdup((gchar *)xmlnode_get_attrib(cnode, "modlist")); - } - - if (!strcmp(cnode->name, "command")) { - if ((command = xmlnode_get_child(cnode, "bin"))) - l->c_bin = g_strdup(xmlnode_get_data(command)); - if ((command = xmlnode_get_child(cnode, "dir"))) - l->c_wdir = g_strdup(xmlnode_get_data(command)); - if ((command = xmlnode_get_child(cnode, "gamemod"))) - l->c_gmod = g_strdup(xmlnode_get_data(command)); - if ((command = xmlnode_get_child(cnode, "options"))) - l->c_options = g_strdup(xmlnode_get_data(command)); - if ((command = xmlnode_get_child(cnode, "connect"))) - l->c_connect = g_strdup(xmlnode_get_data(command)); - if ((command = xmlnode_get_child(cnode, "launch"))) - l->c_cmd = g_strdup(xmlnode_get_data(command)); - } - } + + gchar *filename = g_build_filename(purple_user_dir(), "gfire_game_config.xml", NULL); + if(filename) + { + purple_debug(PURPLE_DEBUG_INFO, "gfire", "Loading Game Launch Data from: %s\n", filename); + g_free(filename); } - - return l; -} + node = purple_util_read_xml_from_file("gfire_game_config.xml", "Gfire Game Config List"); + if(!node) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_game_load_config_xml: Couldn't load game config.\n"); + return FALSE; + } -/** - * Parses launch field for delim and replaces it with data. Returns pointer to newly - * created string with all subsitutions. - * - * @param src string to search for delimeters (usually @xxxx@) - * @param data string to replace delimeter with. (ip address, ports, etc) - * @param delim the matching string that needs to be replaced (ex: @port@) - * - * @return pointer to string with delimeter replaced with data. memory - * is allocated using glib, free with g_free when done. -*/ -gchar *gfire_launch_parse(const char *src, const char *data, const char *delim) + // Check for a valid game config + if(g_utf8_collate(node->name, "game_config")) + { + xmlnode_free(node); + return FALSE; + } + + // Check for a valid version + if(!xmlnode_get_attrib(node, "version") || g_utf8_collate(xmlnode_get_attrib(node, "version"), "2")) + { + xmlnode_free(node); + return FALSE; + } + + // Delete all old configurations + gfire_game_config_cleanup(); + + // Parse all games + xmlnode *game_node = xmlnode_get_child(node, "game"); + while(game_node) + { + gfire_game_configuration *gconf = gfire_game_configuration_create_from_xml(game_node); + if(gconf) + gfire_games_config = g_list_append(gfire_games_config, gconf); + + game_node = xmlnode_get_next_twin(game_node); + } + + gfire_game_config_sort(); + + xmlnode_free(node); + + return TRUE; +} + +// Only used by game manager +#ifdef HAVE_GTK +static xmlnode *gfire_game_configuration_to_xmlnode(const gfire_game_configuration *p_gconf) { - char **sv; - gchar *tmp = NULL; - - if (!data || !delim || !src) { - /* no data or delim return empty string */ - return g_strdup(""); + xmlnode *ret = xmlnode_new("game"); + gchar *id_str = g_strdup_printf("%u", p_gconf->game_id); + xmlnode_set_attrib(ret, "id", id_str); + g_free(id_str); + + xmlnode *command_node = xmlnode_new_child(ret, "command"); + + if(p_gconf->detect_file) + { + xmlnode *detect_node = xmlnode_new_child(command_node, "detect"); + xmlnode_insert_data(detect_node, p_gconf->detect_file, -1); } - - sv = g_strsplit(src, delim, 0); - if (g_strv_length(sv) <= 1) { - /* no matches */ - return g_strdup(src); + + if(p_gconf->launch_file) + { + xmlnode *launch_node = xmlnode_new_child(command_node, "launch"); + xmlnode_insert_data(launch_node, p_gconf->launch_file, -1); } - if (g_strv_length(sv) > 2 ) { - return g_strdup(""); -// fprintf(stderr, "ERR: (xfire_launch_parse) Only 1 delimeter allowed per subsitution!\n"); + if(p_gconf->launch_prefix) + { + xmlnode *prefix_node = xmlnode_new_child(command_node, "prefix"); + xmlnode_insert_data(prefix_node, p_gconf->launch_prefix, -1); } - tmp = g_strjoinv(data, sv); - g_strfreev(sv); - return tmp; + return ret; } +static void gfire_game_save_config_xml() +{ + xmlnode *game_config = xmlnode_new("game_config"); + xmlnode_set_attrib(game_config, "version", "2"); + + GList *cur = gfire_games_config; + while(cur) + { + xmlnode_insert_child(game_config, gfire_game_configuration_to_xmlnode((gfire_game_configuration*)cur->data)); -/** - * takes launch info struct, and returns a command line that is parsed with information - * in struct and replaced with data provided by other function arguments. String should be - * freed after use. - * - * @param l populated launch info struct - * @param ip binary representation of the ip address - * @param prt integer port number for connect line - * @param mod string name of mod that needs to be run (only used in xqf) - * - * @return pointer to string command line fully parsed. if l is NULL function - returns NULL. String should be freed after use. g_free() -*/ -gchar *gfire_linfo_get_cmd(gfire_linfo *l, const guint8 *ip, int prt, const gchar *mod) + cur = g_list_next(cur); + } + + gchar *xml_str = xmlnode_to_formatted_str(game_config, NULL); + + purple_util_write_data_to_file("gfire_game_config.xml", xml_str, -1); + g_free(xml_str); + + xmlnode_free(game_config); +} +#endif // HAVE_GTK + +void gfire_game_config_cleanup() { - gchar *old = NULL; - gchar *cmd = NULL; - gchar *options = NULL; - gchar *connect = NULL; - gchar *gamemod = NULL; - gchar *port = NULL; - gchar *sip = NULL; - - if (!l || !ip) return NULL; - - port = g_strdup_printf("%d",prt); - sip = g_strdup_printf("%d.%d.%d.%d", ip[3], ip[2], ip[1], ip[0]); - connect = gfire_launch_parse(l->c_connect, sip, "@ip@"); - old = connect; - connect = gfire_launch_parse(connect, port, "@port@"); - g_free(old); - - if(l->c_gmod) { - gamemod = gfire_launch_parse(l->c_gmod, mod, "@mod@"); - } - - cmd = gfire_launch_parse(l->c_cmd, connect, "@connect@"); - old = cmd; - if(gamemod) { - cmd = gfire_launch_parse(cmd, gamemod, "@gamemod@"); - g_free(old); old = cmd; - } - - if(l->c_options) { - cmd = gfire_launch_parse(cmd, l->c_options, "@options@"); - g_free(old); g_strstrip(cmd); old = cmd; - } - cmd = g_strdup_printf("%s %s", l->c_bin, cmd); - g_free(gamemod); g_free(options); g_free(connect); g_free(port); g_free(old); g_free(sip); - return cmd; + GList *cur = gfire_games_config; + while(cur) + { + gfire_game_configuration_free((gfire_game_configuration*)cur->data); + cur = g_list_next(cur); + } + g_list_free(gfire_games_config); + gfire_games_config = NULL; } +const gfire_game_configuration *gfire_game_config_by_id(guint32 p_gameid) +{ + GList *cur = gfire_games_config; + while(cur) + { + if(((gfire_game_configuration*)cur->data)->game_id == p_gameid) + return (gfire_game_configuration*)cur->data; -/** - * produces a new xqf_linfo struct zeroed out needs to be freed using - * xqf_linfo_free(), returns struct pointer on success, NULL on failure - * - * @return pointer to newly created xfire_xqf_linfo struct or - * NULL on memory allocation error -*/ -gfire_xqf_linfo *gfire_xqf_linfo_new() + cur = g_list_next(cur); + } + + return NULL; +} + +gboolean gfire_game_config_foreach(GCallback p_callback, gpointer p_data) { - gfire_xqf_linfo *l = NULL; - l = g_malloc0(sizeof(gfire_xqf_linfo)); - if (!l) return NULL; - return l; + if(!gfire_games_config || !p_callback) + return FALSE; + + GList *cur = gfire_games_config; + while(cur) + { + if(((gboolean(*)(const gfire_game_configuration*,gpointer))p_callback)((const gfire_game_configuration*)cur->data, + p_data)) + return TRUE; + + cur = g_list_next(cur); + } + + return FALSE; } +gboolean gfire_game_playable(guint32 p_gameid) +{ + GList *cur = gfire_games_config; + while(cur) + { + if(((gfire_game_configuration*)cur->data)->game_id == p_gameid) + return TRUE; -/** - * frees memory from struct created by xqf_linfo_new(), passing - * a null pointer is ok. - * - * @param l pointer to structure -*/ -void gfire_xqf_linfo_free(gfire_xqf_linfo *l) + cur = g_list_next(cur); + } + + return FALSE; +} + +// FIXME: Changes needed +static gchar *gfire_game_config_get_command(const gfire_game_configuration *p_gconf, const gfire_game_data *p_game_data) { - if (!l) return; - g_free(l->gtype); - g_free(l->sname); - g_free(l->ip); - g_free(l->mod); - g_free(l); + if (!p_gconf) + { + purple_debug_error("gfire", "Invalid game config info.\n"); + return NULL; + } + + const gfire_game *game = gfire_game_by_id(p_gconf->game_id); + if(!game) + { + purple_debug_error("gfire", "gfire_game_config_get_command: Game not existing.\n"); + return NULL; + } + + if (!game->detection_sets || !((gfire_game_detection_set*)game->detection_sets->data)->launch_args || + !p_gconf->launch_file) + { + purple_debug_error("gfire", "Insufficient information available!\n"); + return NULL; + } + + // Get the first detection set + gfire_game_detection_set *dset = (gfire_game_detection_set*)game->detection_sets->data; + + gchar *username_args = NULL; + /* This is not implemented yet, so let it stay NULL for now + if(dset->username_args) + { + username_args = purple_strreplace(dset->username_args, "%UA_GAME_HOST_USERNAME%", ""); + }*/ + + gchar *password_args = NULL; + /* This is not implemented yet, so let it stay NULL for now + if(dset->password_args) + { + password_args = purple_strreplace(dset->password_args, "%UA_GAME_HOST_PASSWORD%", ""); + }*/ + + gchar *tmp, *tmp2; + gchar *network_args = NULL; + + if(dset->network_args && p_game_data && p_game_data->ip.value) + { + gchar *server_ip_tmp = NULL, *server_port_tmp = NULL, *tmp = NULL, *tmp2 = NULL; + + server_port_tmp = gfire_game_data_port_str(p_game_data); + server_ip_tmp = gfire_game_data_ip_str(p_game_data); + + // Replace IP and port + tmp = purple_strreplace(dset->network_args, "%UA_GAME_HOST_NAME%", server_ip_tmp); + tmp2 = purple_strreplace(tmp, "%UA_GAME_HOST_PORT%", server_port_tmp); + g_free(tmp); + g_free(server_port_tmp); + g_free(server_ip_tmp); + + // Replace username + tmp = purple_strreplace(tmp2, "%UA_LAUNCHER_USERNAME_ARGS%", username_args ? username_args : ""); + g_free(tmp2); + + // Replace password + network_args = purple_strreplace(tmp, "%UA_LAUNCHER_PASSWORD_ARGS%", password_args ? password_args : ""); + g_free(tmp); + } + g_free(username_args); + g_free(password_args); + + gchar *exe; + +#ifdef _WIN32 + exe = g_strdup_printf("\"%s\"", p_gconf->launch_file); +#else + // Checks for Wine compatibility if needed + exe = g_strdup_printf("%s \"%s\"", gfire_filetype_use_wine(p_gconf->launch_file) ? "wine": "", p_gconf->launch_file); +#endif + + tmp = purple_strreplace(dset->launch_args, "%UA_LAUNCHER_EXE_PATH%", exe); + g_free(exe); + + tmp2 = purple_strreplace(tmp, "%UA_LAUNCHER_EXTRA_ARGS%", ""); // Unknown + g_free(tmp); + + gchar *launch_cmd = purple_strreplace(tmp2, "%UA_LAUNCHER_NETWORK_ARGS%", network_args ? network_args : ""); + g_free(network_args); + g_free(tmp2); + + return launch_cmd; } +static void gfire_join_game_parse_prefix(const gchar *p_prefix, gchar **p_exe_prefix, GList **p_env_keys, + GList **p_env_values) +{ + if(!p_prefix || !p_exe_prefix || !p_env_keys || !p_env_values) + return; -/** - * searches the xml data structure provided by launch.xml to - * to find a game that matches the xfq_linfo struct that is passed - * as an argument (if one can be found). matches are done case- - * insenitve. xqfname="" property of game must match the LaunchInfo.txt - * game name. The xqf mod in LI.txt must match one in the modlist in the - * xml file. This allows you to have many games in the xml file with - * the same xqfname but different sets of mods. So that we can accurately - * identify what xfire game id must be used. - * - * @param xqfs pointer to xqf_linfo struct that has the parsed - * xqf data. (provided by linfo_parse_xqf()) - * - * @return returns the game id of the matching game in the - * launch.xml file or 0 if no game was found -*/ -int gfire_xqf_search(PurpleConnection *gc, gfire_xqf_linfo *xqfs) + GString *prefix = g_string_new(""); + + const gchar *pos = p_prefix; + const gchar *end = NULL; + do + { + // Find the next space / end of string + const gchar *space = strchr(pos, ' '); + if(!space) + space = p_prefix + strlen(p_prefix); + // Find the next equal + const gchar *equal = strchr(pos, '='); + + // We got an env var setting + if(equal && (equal < space)) + { + if((equal + 1) <= (p_prefix + strlen(p_prefix))) + { + end = equal + 1; + + gchar *key = g_strndup(pos, equal - pos); + + if(*key != 0) + { + gchar *value = NULL; + if(*(equal + 1) == '"') + { + const gchar *quote = strchr(equal + 2, '"'); + if(quote) + { + value = g_strndup(equal + 2, quote - equal - 2); + end = quote; + } + } + else + { + value = g_strndup(equal + 1, space - equal - 1); + end = space; + } + + if(value) + { + *p_env_keys = g_list_append(*p_env_keys, key); + *p_env_values = g_list_append(*p_env_values, value); + } + else + g_free(key); + + if(end == (p_prefix + strlen(p_prefix))) + end = NULL; + else + end += 1; + } + else + g_free(key); + } + else + end = NULL; + } + else + { + gchar *chunk = g_strndup(pos, space - pos); + g_string_append_printf(prefix, " %s", chunk); + g_free(chunk); + + if(space == (p_prefix + strlen(p_prefix))) + end = NULL; + else + end = space + 1; + } + } while((pos = end)); + + *p_exe_prefix = g_string_free(prefix, FALSE); +} + +void gfire_join_game(const gfire_game_data *p_game_data) { - xmlnode *node = NULL; - xmlnode *cnode = NULL; - const char *name, *num; - gchar *mod, *xqfname; - int found = 0; - int game = 0; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !xqfs) return 0; - - if (gfire->xml_launch_info == NULL) return 0; - - node = xmlnode_get_child(gfire->xml_launch_info, "game"); - while (node) { - name = g_strdup(xmlnode_get_attrib(node, "name")); - num = xmlnode_get_attrib(node, "id"); - game = atoi((const char *)num); - for (cnode = node->child; cnode; cnode = cnode->next) { - if (cnode->type != XMLNODE_TYPE_TAG) - continue; - if (!strcmp(cnode->name, "xqf")) { - xqfname = (gchar *)xmlnode_get_attrib(cnode, "name"); - mod = (gchar *)xmlnode_get_attrib(cnode, "modlist"); - if ( 0 == g_ascii_strcasecmp(xqfname, xqfs->gtype) ){ - if (((NULL == mod) && (NULL == xqfs->mod)) || g_strrstr(mod, xqfs->mod) ){ - found = TRUE; + const gfire_game_configuration *gconf = gfire_game_config_by_id(p_game_data->id); + if(!gconf) + { + purple_debug_error("gfire", "gfire_join_game: Game not configured!\n"); + return; + } + + gchar *game_launch_command = gfire_game_config_get_command(gconf, p_game_data); + if (!game_launch_command) + { + purple_debug_error("gfire", "gfire_join_game: Couldn't generate game launch command!\n"); + return; + } + + GString *command = g_string_new(game_launch_command); + g_free(game_launch_command); + + // Set environment if needed + gchar **env = NULL; + gint env_len = 0; + if(gconf->launch_prefix) + { + gchar *prefix = NULL; + GList *env_keys = NULL; + GList *env_values = NULL; + + gfire_join_game_parse_prefix(gconf->launch_prefix, &prefix, &env_keys, &env_values); + if(prefix) + { + g_string_prepend_c(command, ' '); + g_string_prepend(command, prefix); + g_free(prefix); + } + + if(env_keys) + { + gchar **cur_env = g_listenv(); + gint i = 0; + for(; i < g_strv_length(cur_env); i++) + { + env_len++; + env = (gchar**)g_realloc(env, sizeof(gchar*) * (env_len + 1)); + env[env_len - 1] = g_strdup_printf("%s=%s", cur_env[i], g_getenv(cur_env[i])); + env[env_len] = NULL; + } + + GList *cur_key = env_keys; + GList *cur_value = env_values; + while(cur_key) + { + for(i = 0; i < g_strv_length(cur_env); i++) + { + if(g_strcmp0(cur_env[i], (gchar*)cur_key->data) == 0) break; - } } + + if(i == g_strv_length(cur_env)) + { + env_len++; + env = (gchar**)g_realloc(env, sizeof(gchar*) * (env_len + 1)); + env[env_len - 1] = g_strdup_printf("%s=%s", (gchar*)cur_key->data, (gchar*)cur_value->data); + env[env_len] = NULL; + } + else + { + g_free(env[i]); + env[i] = g_strdup_printf("%s=%s", (gchar*)cur_key->data, (gchar*)cur_value->data); + } + + cur_key = g_list_next(cur_key); + cur_value = g_list_next(cur_value); } + + g_strfreev(cur_env); + + gfire_list_clear(env_keys); + gfire_list_clear(env_values); } + } + + // Launch command + gchar **argv = NULL; + if(!g_shell_parse_argv(command->str, NULL, &argv, NULL)) + { + purple_debug_error("gfire", "g_shell_parse_argv failed!"); + g_string_free(command, TRUE); + g_strfreev(env); + return; + } + + purple_debug_misc("gfire", "Launching game and joining server: %s\n", command->str); + g_string_free(command, TRUE); + + // Get working directory + gchar *wd = g_path_get_dirname(argv[0]); - if (found) break; - node = xmlnode_get_next_twin(node); - } - if (found) return game; - else return 0; + // Launch + g_spawn_async(wd, argv, env, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); + g_free(wd); + g_strfreev(argv); + g_strfreev(env); } +#ifdef HAVE_GTK +static GtkBuilder *gfire_gtk_builder = NULL; -/** - * parses XQF launchinfo.txt file into a struct that can be used - * to search for the game id, and server/port information. This - * data can be used to send join_game messages to the xfire network - * - * @param fname string filename of the file to parse as a - * launchinfo.txt formatted file - * - * @return returns xqf_linfo structure if parsed ok - * otherwise it returns NULL -*/ -gfire_xqf_linfo *gfire_linfo_parse_xqf(gchar *fname) +static void gfire_game_manager_reload_ui() { - gfire_xqf_linfo *l = NULL; - GError *error = NULL; - gchar *contents = NULL; - gsize length; - gchar **sv = NULL; - gchar **svtmp = NULL; - int i = 0; - gchar *tmp = NULL; + if(!gfire_gtk_builder) + return; - if (!g_file_get_contents(fname, &contents, &length, &error)) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(XQF launchinfo import): Error reading LaunchInfo.txt: %s\n", - NN(error->message)); - g_error_free(error); - return NULL; + GtkWidget *add_game_entry = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_game_entry")); + GtkWidget *add_detection_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_detection_button")); + GtkWidget *add_executable_check_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_executable_check_button")); + GtkWidget *add_launch_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_launch_button")); + GtkWidget *add_advanced_expander = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_advanced_expander")); + GtkWidget *add_prefix_entry = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_prefix_entry")); + GtkWidget *edit_game_combo = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_game_combo")); + GtkListStore *edit_game_list_store = GTK_LIST_STORE(gtk_builder_get_object(gfire_gtk_builder, "edit_game_list_store")); + GtkWidget *edit_detection_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_detection_button")); + GtkWidget *edit_executable_check_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_executable_check_button")); + GtkWidget *edit_launch_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_launch_button")); + GtkWidget *edit_prefix_entry = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_prefix_entry")); + + // Reset widgets on "add" tab + gtk_entry_set_text(GTK_ENTRY(add_game_entry), ""); + gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(add_detection_button)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(add_executable_check_button), TRUE); + gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(add_launch_button)); + gtk_expander_set_expanded(GTK_EXPANDER(add_advanced_expander), FALSE); + gtk_entry_set_text(GTK_ENTRY(add_prefix_entry), ""); + + // Reset widgets on "edit" tab + gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(edit_detection_button)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_executable_check_button), TRUE); + gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(edit_launch_button)); + gtk_entry_set_text(GTK_ENTRY(edit_prefix_entry), ""); + + // Clear games list combo box + gtk_list_store_clear(edit_game_list_store); + + // Add all new configured games + GList *cur = gfire_games_config; + while(cur) + { + const gfire_game *game = gfire_game_by_id(((gfire_game_configuration*)cur->data)->game_id); + if(game) + { + gtk_combo_box_append_text(GTK_COMBO_BOX(edit_game_combo), game->name); + } + cur = g_list_next(cur); } - if ( !(l = gfire_xqf_linfo_new()) ) { - g_free(contents); - return NULL; +} + +static void gfire_game_manager_update_executable_toggled_cb(GtkBuilder *p_builder, GtkWidget *p_executable_check_button) +{ + if (!p_builder) + { + purple_debug_error("gfire", "Couldn't access game manager interface."); + return; } - sv = g_strsplit(contents, "\n", 0); - for (i = 0; i < g_strv_length(sv); i++) { - if ( 0 == strlen(sv[i]) ) continue; - if (0 == g_ascii_strncasecmp(sv[i], "GameType", 8)) { - tmp = (gchar *)&(sv[i][9]); - l->gtype = g_strdup(tmp); - } - if (0 == g_ascii_strncasecmp(sv[i], "ServerName", 10)) { - tmp = (gchar *)&(sv[i][11]); - l->sname = g_strdup(tmp); - } - if (0 == g_ascii_strncasecmp(sv[i], "ServerAddr", 10)) { - tmp = (gchar *)&(sv[i][11]); - svtmp = g_strsplit(tmp, ":", 0); - l->ip = g_strdup(svtmp[0]); - l->port = atoi((const char *)svtmp[1]); - g_strfreev(svtmp); - } - if (0 == g_ascii_strncasecmp(sv[i], "ServerMod", 9)) { - tmp = (gchar *)&(sv[i][10]); - if (g_strrstr(tmp, ",")) { - svtmp = g_strsplit(tmp, ",", 0); - l->mod = g_strdup(svtmp[0]); - g_strfreev(svtmp); - } else l->mod = g_strdup(tmp); - } - } // end of for loop - if (NULL == l->ip) l->ip = g_strdup("0.0.0.0"); - return l; -} - -/** - * Return ip address struct initialized with data supplied by argument - * When done with structure, it should be freed with xfire_ip_struct_free() - * - * @param ip string ip address to fill struct with ex ("127.0.0.1") - * - * @return returns NULL if no string provided. Otherwise returns - * pointer to struct. ex: s = struct, - * - * s->octet = { 127, 0, 0, 1 } - * s->ipstr = "127.0.0.1" - * - * Structure should be freed with xfire_ip_struct_free() -*/ -gchar *gfire_ipstr_to_bin(const gchar *ip) + + GtkWidget *add_executable_check_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_executable_check_button")); + GtkWidget *add_launch_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_launch_button")); + GtkWidget *edit_executable_check_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_executable_check_button")); + GtkWidget *edit_launch_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_launch_button")); + + gboolean check_button_state; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_executable_check_button))) + check_button_state = FALSE; + else + check_button_state = TRUE; + + gtk_widget_set_sensitive(add_launch_button, check_button_state); + + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_executable_check_button))) + check_button_state = FALSE; + else + check_button_state = TRUE; + + gtk_widget_set_sensitive(edit_launch_button, check_button_state); +} + +static void gfire_game_manager_add_cb(GtkBuilder *p_builder, GtkWidget *p_button) { - gchar **ss = NULL; - int i = 0; int j = 3; - gchar *ret = NULL; - - if (strlen(ip) <= 0) return NULL; - - ss = g_strsplit(ip,".", 0); - if (g_strv_length(ss) != 4) { - g_strfreev(ss); - return NULL; + if(!p_builder) + { + purple_debug_error("gfire", "Couldn't access game manager interface.\n"); + return; } - ret = g_malloc0(sizeof(gchar) * XFIRE_GAMEIP_LEN); - if (!ret) { - g_strfreev(ss); - return NULL; + + GtkWidget *add_game_entry = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_game_entry")); + GtkWidget *add_detection_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_detection_button")); + GtkWidget *add_executable_check_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_executable_check_button")); + GtkWidget *add_launch_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_launch_button")); + + GtkWidget *add_prefix_entry = GTK_WIDGET(gtk_builder_get_object(p_builder, "add_prefix_entry")); + + const gchar *game_name = gtk_entry_get_text(GTK_ENTRY(add_game_entry)); + gchar *game_detect = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(add_detection_button)); + gboolean game_launch_use_detect = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_executable_check_button)); + gchar *game_launch = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(add_launch_button)); + + const gchar *game_prefix = gtk_entry_get_text(GTK_ENTRY(add_prefix_entry)); + + if (game_name && game_detect && ((!game_launch_use_detect && game_launch) || game_launch_use_detect)) + { + guint32 game_id; + + game_id = gfire_game_id(game_name); + + if(game_id == 0) + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, _("Manage Games: error"), _("Couldn't add game"), + _("There's no such game, please try again."), NULL, NULL); + g_free(game_detect); + g_free(game_launch); + return; + } + + if(!gfire_game_config_by_id(game_id)) + { +#ifndef _WIN32 + gchar real_game_detect[PATH_MAX]; + if(!realpath(game_detect, real_game_detect)) + strncpy(real_game_detect, game_detect, PATH_MAX); +#else + gchar *real_game_detect = game_detect; +#endif // _WIN32 + + gfire_game_configuration *gconf = gfire_game_configuration_create(game_id, real_game_detect, + game_launch_use_detect ? real_game_detect : + game_launch, game_prefix); + + gfire_games_config = g_list_append(gfire_games_config, gconf); + gfire_game_config_sort(); + gfire_game_save_config_xml(); + + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("Manage Games: game added"), + game_name, _("The game has been successfully added."), NULL, NULL); + } + else + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("Manage Games: warning"), _("Game already added"), + _("This game is already added, you can configure it if you want."), NULL, NULL); + + g_free(game_launch); + g_free(game_detect); + + return; + } + + g_free(game_launch); + g_free(game_detect); } - j = 3; - for (i=0; i < 4; i++) { - ret[j--] = atoi(ss[i]); + else + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, _("Manage Games: error"), + _("Couldn't add game"), _("Please try again. Make sure you fill in all fields."), NULL, NULL); + return; } - g_strfreev(ss); - return ret; + + gfire_game_manager_reload_ui(p_builder); } +static void gfire_game_manager_edit_cb(GtkBuilder *p_builder, GtkWidget *p_button) +{ + if (!p_builder) + { + purple_debug_error("gfire", "Couldn't access game manager interface.\n"); + return; + } + + GtkWidget *edit_game_combo = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_game_combo")); + GtkWidget *edit_detection_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_detection_button")); + GtkWidget *edit_executable_check_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_executable_check_button")); + GtkWidget *edit_launch_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_launch_button")); + GtkWidget *edit_prefix_entry = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_prefix_entry")); + + gchar *game_name = gtk_combo_box_get_active_text(GTK_COMBO_BOX(edit_game_combo)); + gchar *game_detect = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(edit_detection_button)); + gboolean game_launch_use_detect = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_executable_check_button)); + gchar *game_launch = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(edit_launch_button)); + + const gchar *game_prefix = gtk_entry_get_text(GTK_ENTRY(edit_prefix_entry)); + + if (game_name && game_detect && ((!game_launch_use_detect && game_launch) || game_launch_use_detect)) + { + guint32 game_id; + + game_id = gfire_game_id(game_name); + + gfire_game_configuration *gconf = (gfire_game_configuration*)gfire_game_config_by_id(game_id); -void gfire_xml_download_cb( PurpleUtilFetchUrlData *url_data, gpointer data, const char *buf, gsize len, const gchar *error_message) -{ - char *successmsg = NULL; - PurpleConnection *gc = NULL; - const char *filename = g_build_filename(purple_user_dir(), "gfire_games.xml", NULL); - - if (! data || !buf || !len) { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "XFire games Download", "Will attempt to download gfire_games.xml from the Gfire server.", "Unable to download gfire_games.xml", NULL, NULL); - return; - } - gc = (PurpleConnection *)data; - if ( purple_util_write_data_to_file("gfire_games.xml", buf, len) ) { - /* we may be called when we are no longer connected gfire-> may not be vaild */ - if ( PURPLE_CONNECTION_IS_VALID(gc) && PURPLE_CONNECTION_IS_CONNECTED(gc) ) { - gfire_parse_games_file(gc, filename); - } - if(strcmp(gfire_game_name(gc, 100), "100")) { - successmsg = g_strdup_printf("Successfully downloaded gfire_games.xml\nNew Games List Version: %s", gfire_game_name(gc, 100)); - } else { - successmsg = g_strdup_printf("Successfully downloaded gfire_games.xml"); - } - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "XFire games Download", "Will attempt to download gfire_games.xml from the Gfire server.", successmsg, NULL, NULL); - - } else { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "XFire games Download", "Will attempt to download gfire_games.xml from the Gfire server.", "Unable to write gfire_games.xml", NULL, NULL); + if (gconf) + { +#ifndef _WIN32 + gchar real_game_detect[PATH_MAX]; + if(!realpath(game_detect, real_game_detect)) + strncpy(real_game_detect, game_detect, PATH_MAX); +#else + gchar *real_game_detect = game_detect; +#endif // _WIN32 + + if(gconf->detect_file) + g_free(gconf->detect_file); + + gconf->detect_file = g_strdup(real_game_detect); + + if(gconf->launch_file) + g_free(gconf->launch_file); + + gconf->launch_file = g_strdup(game_launch_use_detect ? real_game_detect : game_launch); + + if(gconf->launch_prefix) + g_free(gconf->launch_prefix); + + gconf->launch_prefix = g_strdup(game_prefix); + } + else + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("Manage Games: warning"), _("Game launch data not found"), + _("This game is not yet added as it seems, please add it first!"), NULL, NULL); + g_free(game_launch); + g_free(game_detect); + g_free(game_name); + + return; + } + + g_free(game_launch); + g_free(game_detect); + g_free(game_name); + + gfire_game_save_config_xml(); + + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("Manage Games: game edited"), _("Game edited"), _("The game has been successfully edited."), NULL, NULL); + } + else + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, _("Manage Games: error"), + _("Couldn't edit game"), _("Please try again. Make sure you fill in all fields."), NULL, NULL); + return; + } + + gfire_game_manager_reload_ui(p_builder); +} + +static void gfire_game_manager_remove_cb(GtkBuilder *p_builder, GtkWidget *p_button) +{ + if (!p_builder) + { + purple_debug_error("gfire", "Couldn't build game manager interface.\n"); + return; + } + + GtkWidget *edit_game_combo = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_game_combo")); + + gchar *selected_game = gtk_combo_box_get_active_text(GTK_COMBO_BOX(edit_game_combo)); + if (selected_game) + { + guint32 game_id = gfire_game_id(selected_game); + g_free(selected_game); + + if(game_id == 0) + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, _("Manage Games: error"), + _("Couldn't remove game"), _("No such game, please try again!"), NULL, NULL); + return; + } + + GList *cur = gfire_games_config; + while(cur) + { + if(((gfire_game_configuration*)cur->data)->game_id == game_id) + break; + cur = g_list_next(cur); + } + + if(!cur) + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, _("Manage Games: error"), + _("Couldn't remove game"), _("This game is not yet added as it seems, please add it first!"), NULL, NULL); + return; + } + + gfire_game_configuration_free((gfire_game_configuration*)cur->data); + gfire_games_config = g_list_delete_link(gfire_games_config, cur); + + gfire_game_save_config_xml(); + + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("Manage Games: game removed"), + _("Game removed"), _("The game has been successfully removed."), NULL, NULL); + } + else + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, _("Manage Games: error"), + _("Couldn't remove game"), _("Please try again. Make sure you select a game to remove."), NULL, NULL); + + gfire_game_manager_reload_ui(p_builder); +} + +static void gfire_game_manager_edit_update_fields_cb(GtkBuilder *p_builder, GtkWidget *p_edit_game_combo) +{ + if (!p_builder) + { + purple_debug_error("gfire", "Couldn't access game manager interface.\n"); + return; + } + + GtkWidget *edit_detection_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_detection_button")); + GtkWidget *edit_executable_check_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_executable_check_button")); + GtkWidget *edit_launch_button = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_launch_button")); + + GtkWidget *edit_prefix_entry = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_prefix_entry")); + GtkWidget *edit_game_combo = GTK_WIDGET(gtk_builder_get_object(p_builder, "edit_game_combo")); + + gchar *selected_game = gtk_combo_box_get_active_text(GTK_COMBO_BOX(edit_game_combo)); + + guint32 game_id = gfire_game_id(selected_game); + g_free(selected_game); + if(game_id == 0) + { + // ERROR + return; + } + + const gfire_game_configuration *gconf = gfire_game_config_by_id(game_id); + + if(!gconf) + { + // ERROR + return; } + + if (!g_utf8_collate(gconf->detect_file ? gconf->detect_file : "", gconf->launch_file ? gconf->launch_file : "")) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_executable_check_button), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_executable_check_button), FALSE); + + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(edit_detection_button), gconf->detect_file ? gconf->detect_file : ""); + gtk_entry_set_text(GTK_ENTRY(edit_prefix_entry), gconf->launch_prefix ? gconf->launch_prefix : ""); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(edit_launch_button), gconf->launch_file ? gconf->launch_file : ""); +} + +static void gfire_game_manager_update_executable_cb(GtkWidget *p_launch_button, GtkWidget *p_detect_button) +{ + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(p_launch_button), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(p_detect_button))); } +static void gfire_game_manager_closed_cb(GtkObject *p_object, gpointer *p_data) +{ + if(gfire_gtk_builder) + { + g_object_unref(G_OBJECT(gfire_gtk_builder)); + gfire_gtk_builder = NULL; + } +} + +void gfire_game_manager_show(PurplePluginAction *p_action) +{ + // Only one manager at a time + if(gfire_gtk_builder) + return; + + gfire_gtk_builder = gtk_builder_new(); + + if(!gfire_gtk_builder) + { + purple_debug_error("gfire", "Couldn't build game manager interface.\n"); + return; + } + + gtk_builder_set_translation_domain(gfire_gtk_builder, GETTEXT_PACKAGE); + + gchar *builder_file = g_build_filename(DATADIR, "purple", "gfire", "games.glade", NULL); + gtk_builder_add_from_file(gfire_gtk_builder, builder_file, NULL); + g_free(builder_file); + + GtkWidget *manage_games_window = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "manage_games_window")); + GtkWidget *add_game_entry = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_game_entry")); + GtkWidget *add_detection_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_detection_button")); + GtkWidget *add_executable_check_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_executable_check_button")); + GtkWidget *add_launch_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_launch_button")); + GtkWidget *add_close_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_close_button")); + GtkWidget *add_add_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "add_add_button")); + GtkWidget *edit_game_combo = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_game_combo")); + GtkWidget *edit_detection_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_detection_button")); + GtkWidget *edit_executable_check_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_executable_check_button")); + GtkWidget *edit_launch_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_launch_button")); + GtkWidget *edit_close_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_close_button")); + GtkWidget *edit_apply_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_apply_button")); + GtkWidget *edit_remove_button = GTK_WIDGET(gtk_builder_get_object(gfire_gtk_builder, "edit_remove_button")); + + g_signal_connect(manage_games_window, "destroy", G_CALLBACK(gfire_game_manager_closed_cb), NULL); + g_signal_connect_swapped(add_detection_button, "current-folder-changed", G_CALLBACK(gfire_game_manager_update_executable_cb), add_launch_button); + g_signal_connect_swapped(add_executable_check_button, "toggled", G_CALLBACK(gfire_game_manager_update_executable_toggled_cb), gfire_gtk_builder); + g_signal_connect_swapped(add_close_button, "clicked", G_CALLBACK(gtk_widget_destroy), manage_games_window); + g_signal_connect_swapped(add_add_button, "clicked", G_CALLBACK(gfire_game_manager_add_cb), gfire_gtk_builder); + g_signal_connect_swapped(edit_game_combo, "changed", G_CALLBACK(gfire_game_manager_edit_update_fields_cb), gfire_gtk_builder); + g_signal_connect_swapped(edit_executable_check_button, "toggled", G_CALLBACK(gfire_game_manager_update_executable_toggled_cb), gfire_gtk_builder); + g_signal_connect_swapped(edit_close_button, "clicked", G_CALLBACK(gtk_widget_destroy), manage_games_window); + g_signal_connect_swapped(edit_apply_button, "clicked", G_CALLBACK(gfire_game_manager_edit_cb), gfire_gtk_builder); + g_signal_connect_swapped(edit_remove_button, "clicked", G_CALLBACK(gfire_game_manager_remove_cb), gfire_gtk_builder); + + // Add filters to filechoosers + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_set_name(filter, "Executable files"); + + gtk_file_filter_add_mime_type(filter, "application/x-ms-dos-executable"); + gtk_file_filter_add_mime_type(filter, "application/x-executable"); + gtk_file_filter_add_mime_type(filter, "application/x-msdownload"); + + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(add_detection_button), filter); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(add_launch_button), filter); + + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(edit_detection_button), filter); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(edit_launch_button), filter); + + GtkFileFilter *filter_all = gtk_file_filter_new(); + gtk_file_filter_set_name(filter_all, "All files"); + + gtk_file_filter_add_pattern (filter_all, "*"); + + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(add_detection_button), filter_all); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(add_launch_button), filter_all); + + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(edit_detection_button), filter_all); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(edit_launch_button), filter_all); + + // Add all games to the combo box + GtkListStore *add_list_store = gtk_list_store_new(1, G_TYPE_STRING); + GtkTreeIter iter; + + GList *cur = gfire_games; + while(cur) + { + gtk_list_store_append(add_list_store, &iter); + gtk_list_store_set(add_list_store, &iter, 0, + ((gfire_game*)cur->data)->name ? ((gfire_game*)cur->data)->name : "", -1); + cur = g_list_next(cur); + } + + GtkEntryCompletion *add_completion = gtk_entry_completion_new(); + gtk_entry_completion_set_model(add_completion, GTK_TREE_MODEL(add_list_store)); + gtk_entry_completion_set_text_column(add_completion, 0); + gtk_entry_set_completion(GTK_ENTRY(add_game_entry), add_completion); + + gfire_game_manager_reload_ui(); + + gtk_widget_show_all(manage_games_window); +} +#endif // HAVE_GTK diff -Nru gfire-0.8.3/src/gf_games.h gfire-0.9.4/src/gf_games.h --- gfire-0.8.3/src/gf_games.h 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_games.h 2011-03-14 20:24:11.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -19,57 +18,115 @@ * You should have received a copy of the GNU General Public License * along with Gfire. If not, see . */ + #ifndef _GF_GAMES_H #define _GF_GAMES_H -#include "gfire.h" - -typedef struct _gfire_linfo gfire_linfo; -typedef struct _gfire_xqf_linfo gfire_xqf_linfo; +#include "gf_base.h" +// GFIRE GAME DATA ////////////////////////////////////////////////// +typedef struct _gfire_game_data +{ + guint32 id; + guint16 port; + union _ip_data + { + guint32 value; + guint8 octets[4]; + } ip; +} gfire_game_data; + +// Resetting +void gfire_game_data_reset(gfire_game_data *p_game); + +// Validity checks +gboolean gfire_game_data_is_valid(const gfire_game_data *p_game); +gboolean gfire_game_data_has_addr(const gfire_game_data *p_game); + +// String <-> Address conversions +void gfire_game_data_ip_from_str(gfire_game_data *p_game, const gchar *p_ipstr); +gchar *gfire_game_data_ip_str(const gfire_game_data *p_game); +gchar *gfire_game_data_port_str(const gfire_game_data *p_game); +gchar *gfire_game_data_addr_str(const gfire_game_data *p_game); +// GFIRE GAME JOINING +void gfire_join_game(const gfire_game_data *p_game_data); -struct _gfire_linfo +// GFIRE GAMES XML ////////////////////////////////////////////////// +typedef struct _gfire_game_detection_set { - int gameid; - gchar *name; - gchar *xqfname; - gchar *xqfmods; - gchar *c_bin; - gchar *c_wdir; - gchar *c_gmod; - gchar *c_connect; - gchar *c_options; - gchar *c_cmd; -}; + // Detection + GList *required_args; + GList *invalid_args; + + gboolean external; + gchar *detect_url; + + // Server info + gchar *server_game_name; + gchar *server_status_type; + GList *server_broadcast_ports; + + // Launching + gchar *password_args; + gchar *network_args; + gchar *launch_args; + gchar *launch_url; + + // Server detection + gboolean detect_server; + GList *excluded_ports; +} gfire_game_detection_set; -struct _gfire_xqf_linfo +typedef struct _gfire_game { - gchar *gtype; /* qstat/xqf game type ie: xqfname in gfire_launch.xml */ - gchar *sname; /* server name */ - gchar *ip; /* ip address of server */ - int port; /* port to connect to game */ - gchar *mod; /* game mod ie: xqf modlist in gfire_launch.xml */ -}; - - -void gfire_xml_download_cb(PurpleUtilFetchUrlData *url_data, gpointer data, const char *buf, gsize len, const gchar *error_message); -gboolean gfire_parse_games_file(PurpleConnection *gc, const char *filename); -char *gfire_game_name(PurpleConnection *gc, int game); -gboolean gfire_parse_launchinfo_file(PurpleConnection *gc, const char *filename); -gboolean gfire_game_playable(PurpleConnection *gc, int game); -int gfire_get_buddy_game(PurpleConnection *gc, PurpleBuddy *b); -int gfire_get_buddy_port(PurpleConnection *gc, PurpleBuddy *b); -const gchar *gfire_get_buddy_ip(PurpleConnection *gc, PurpleBuddy *b); -gfire_linfo *gfire_linfo_new(); -void gfire_linfo_free(gfire_linfo *l); -gfire_linfo *gfire_linfo_get(PurpleConnection *gc, int game); -gchar *gfire_linfo_get_cmd(gfire_linfo *l, const guint8 *ip, int prt, const gchar *mod); -gfire_xqf_linfo *gfire_xqf_linfo_new(); -void gfire_xqf_linfo_free(gfire_xqf_linfo *l); -int gfire_xqf_search(PurpleConnection *gc, gfire_xqf_linfo *xqfs); -gfire_xqf_linfo *gfire_linfo_parse_xqf(gchar *fname); -gchar *gfire_ipstr_to_bin(const gchar *ip); + guint32 id; + gchar *name; + gchar *short_name; + + gboolean is_voice; + + GList *detection_sets; +} gfire_game; + +gboolean gfire_game_load_games_xml(); +gboolean gfire_game_have_list(); +guint32 gfire_game_get_version(); +gchar *gfire_game_get_version_str(); +guint32 gfire_game_id(const gchar *p_name); +gchar *gfire_game_name(guint32 p_gameid, gboolean p_html); +gchar *gfire_game_short_name(guint32 p_gameid); +void gfire_update_version_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const gchar *p_buf, gsize p_len, const gchar *p_error_message); +void gfire_update_games_list_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const gchar *p_buf, gsize p_len, const gchar *p_error_message); +const gfire_game *gfire_game_by_id(guint32 p_gameid); +guint32 gfire_game_id_by_url(const gchar *p_url); +const gchar *gfire_game_server_query_type(guint32 p_gameid); +GList *gfire_game_excluded_ports_copy(const gfire_game *p_game); +gboolean gfire_game_foreach_dset(const gfire_game *p_game, GCallback p_callback, gpointer p_data, gboolean p_external); +void gfire_game_cleanup(); +// GFIRE GAME CONFIG XML //////////////////////////////////////////// +typedef struct _gfire_game_configuration +{ + guint32 game_id; + gchar *launch_prefix; + gchar *detect_file; + gchar *launch_file; +} gfire_game_configuration; + +// Loading / Cleanup +gboolean gfire_game_load_config_xml(gboolean p_force); +void gfire_game_config_cleanup(); + +// Usage +const gfire_game_configuration *gfire_game_config_by_id(guint32 p_gameid); +gboolean gfire_game_config_foreach(GCallback p_callback, gpointer p_data); + +gboolean gfire_game_playable(guint32 p_gameid); + +// GFIRE GAME MANAGER /////////////////////////////////////////////// +#ifdef HAVE_GTK +void gfire_game_manager_show(PurplePluginAction *p_action); +#endif // HAVE_GTK -#endif /* _GF_GAMES_H */ +#endif // _GF_GAMES_H diff -Nru gfire-0.8.3/src/gf_groups.c gfire-0.9.4/src/gf_groups.c --- gfire-0.8.3/src/gf_groups.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_groups.c 2011-03-14 20:24:05.000000000 +0000 @@ -0,0 +1,183 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_groups.h" +#include "gf_network.h" +#include "gf_groups_proto.h" + +gfire_group *gfire_group_create(gfire_data *p_owner, const gchar *p_name, guint32 p_groupid) +{ + if(!p_owner || !p_name) + return NULL; + + gfire_group *ret = g_malloc0(sizeof(gfire_group)); + + ret->owner = p_owner; + ret->groupid = p_groupid; + ret->group = purple_find_group(p_name); + + // Create the PurpleGroup if we couldn't find it + if(!ret->group) + { + ret->group = purple_group_new(p_name); + purple_blist_add_group(ret->group, NULL); + } + + // Tell Xfire to create the group + if(!ret->groupid) + { + guint16 len = gfire_group_proto_create_create_group(p_name); + if(len > 0) gfire_send(gfire_get_connection(ret->owner), len); + } + + return ret; +} + +void gfire_group_free(gfire_group *p_group, gboolean p_remove) +{ + if(!p_group) + return; + + // Tell Xfire to remove the group + if(p_remove || p_group->groupid) + { + guint16 len = gfire_group_proto_create_remove_group(p_group->groupid); + if(len > 0) gfire_send(gfire_get_connection(p_group->owner), len); + } + + gfire_list_clear(p_group->buddies); + g_free(p_group); +} + +void gfire_group_rename(gfire_group *p_group, const gchar *p_name) +{ + if(!p_group || !p_name) + return; + + // PurpleGroup has already been renamed when we're called, so just tell Xfire + if(p_group->groupid) + { + guint16 len = gfire_group_proto_create_rename_group(p_group->groupid, p_name); + if(len > 0) gfire_send(gfire_get_connection(p_group->owner), len); + } +} + +void gfire_group_added(gfire_group *p_group, guint32 p_groupid) +{ + if(!p_group) + return; + + p_group->groupid = p_groupid; + + // Add all yet added buddies + GList *cur = p_group->buddies; + while(cur) + { + guint16 len = gfire_group_proto_create_add_buddy_to_group(p_group->groupid, *((guint32*)cur->data)); + if(len > 0) gfire_send(gfire_get_connection(p_group->owner), len); + + cur = g_list_next(cur); + } +} + +PurpleGroup *gfire_group_get_group(gfire_group *p_group) +{ + return (p_group ? p_group->group : NULL); +} + +void gfire_group_add_buddy(gfire_group *p_group, guint32 p_buddyid, gboolean p_byuser) +{ + if(!p_group) + return; + + guint32 *id = g_malloc(sizeof(p_buddyid)); + *id = p_buddyid; + p_group->buddies = g_list_append(p_group->buddies, id); + + if(p_group->groupid && p_byuser) + { + guint16 len = gfire_group_proto_create_add_buddy_to_group(p_group->groupid, p_buddyid); + if(len > 0) gfire_send(gfire_get_connection(p_group->owner), len); + } + + purple_debug_info("gfire", "Added buddy to group: Group=%s / UserID=%u\n", + purple_group_get_name(p_group->group), + p_buddyid); +} + +void gfire_group_remove_buddy(gfire_group *p_group, guint32 p_buddyid) +{ + if(!p_group) + return; + + GList *cur = p_group->buddies; + while(cur) + { + if(*((guint32*)cur->data) == p_buddyid) + { + if(p_group->groupid) + { + guint16 len = gfire_group_proto_create_remove_buddy_from_group(p_group->groupid, *((guint32*)cur->data)); + if(len > 0) gfire_send(gfire_get_connection(p_group->owner), len); + } + + g_free(cur->data); + p_group->buddies = g_list_delete_link(p_group->buddies, cur); + return; + } + + cur = g_list_next(cur); + } +} + +gboolean gfire_group_has_buddy(const gfire_group *p_group, guint32 p_buddyid) +{ + if(!p_group) + return FALSE; + + GList *cur = p_group->buddies; + while(cur) + { + if(*((guint32*)cur->data) == p_buddyid) + { + return TRUE; + } + + cur = g_list_next(cur); + } + + return FALSE; +} + +gboolean gfire_group_is_by_purple_group(const gfire_group *p_group, const PurpleGroup *p_prpl_group) +{ + return (p_group && p_prpl_group && (p_group->group == p_prpl_group)); +} + +gboolean gfire_group_is_by_name(const gfire_group *p_group, const gchar *p_name) +{ + return (p_group && p_name && !strcmp(purple_group_get_name(p_group->group), p_name)); +} + +gboolean gfire_group_is_by_id(const gfire_group *p_group, guint32 p_groupid) +{ + return (p_group && (p_group->groupid == p_groupid)); +} diff -Nru gfire-0.8.3/src/gf_groups.h gfire-0.9.4/src/gf_groups.h --- gfire-0.8.3/src/gf_groups.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_groups.h 2011-03-14 20:24:01.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_GROUPS_H +#define _GF_GROUPS_H + +typedef struct _gfire_group gfire_group; + +#include "gf_base.h" +#include "gf_buddies.h" +#include "gfire.h" + +struct _gfire_group +{ + PurpleGroup *group; + guint32 groupid; + GList *buddies; + gfire_data *owner; +}; + +// Creation and freeing +gfire_group *gfire_group_create(gfire_data *p_owner, const gchar *p_name, guint32 p_groupid); +void gfire_group_free(gfire_group *p_group, gboolean p_remove); + +// Group handling +void gfire_group_rename(gfire_group *p_group, const gchar *p_name); +void gfire_group_added(gfire_group *p_group, guint32 p_groupid); +PurpleGroup *gfire_group_get_group(gfire_group *p_group); + +// Buddy handling +void gfire_group_add_buddy(gfire_group *p_group, guint32 p_buddyid, gboolean p_byuser); +void gfire_group_remove_buddy(gfire_group *p_group, guint32 p_buddyid); +gboolean gfire_group_has_buddy(const gfire_group *p_group, guint32 p_buddyid); + +// Identification +gboolean gfire_group_is_by_purple_group(const gfire_group *p_group, const PurpleGroup *p_prpl_group); +gboolean gfire_group_is_by_name(const gfire_group *p_group, const gchar *p_name); +gboolean gfire_group_is_by_id(const gfire_group *p_group, guint32 p_groupid); + +#endif // _GF_GROUPS_H diff -Nru gfire-0.8.3/src/gf_groups_proto.c gfire-0.9.4/src/gf_groups_proto.c --- gfire-0.8.3/src/gf_groups_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_groups_proto.c 2011-03-14 20:23:55.000000000 +0000 @@ -0,0 +1,202 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_groups_proto.h" +#include "gf_protocol.h" +#include "gf_groups.h" + +guint16 gfire_group_proto_create_create_group(const gchar *p_name) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // '1A' Group name + offset = gfire_proto_write_attr_bs(0x1A, 0x01, p_name, strlen(p_name), offset); + + gfire_proto_write_header(offset, 0x1A, 1, 0); + return offset; +} + +guint16 gfire_group_proto_create_remove_group(guint32 p_groupid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // '19' Group ID + p_groupid = GUINT32_TO_LE(p_groupid); + offset = gfire_proto_write_attr_bs(0x19, 0x02, &p_groupid, sizeof(p_groupid), offset); + + gfire_proto_write_header(offset, 0x1B, 1, 0); + return offset; +} + +guint16 gfire_group_proto_create_rename_group(guint32 p_groupid, const gchar *p_name) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // '19' Group ID + p_groupid = GUINT32_TO_LE(p_groupid); + offset = gfire_proto_write_attr_bs(0x19, 0x02, &p_groupid, sizeof(p_groupid), offset); + + // '1A' New group name + offset = gfire_proto_write_attr_bs(0x1A, 0x01, p_name, strlen(p_name), offset); + + gfire_proto_write_header(offset, 0x1C, 2, 0); + return offset; +} + +guint16 gfire_group_proto_create_add_buddy_to_group(guint32 p_groupid, guint32 p_userid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // '01' User ID + p_userid = GUINT32_TO_LE(p_userid); + offset = gfire_proto_write_attr_bs(0x01, 0x02, &p_userid, sizeof(p_userid), offset); + + // '19' Group ID + p_groupid = GUINT32_TO_LE(p_groupid); + offset = gfire_proto_write_attr_bs(0x19, 0x02, &p_groupid, sizeof(p_groupid), offset); + + gfire_proto_write_header(offset, 0x1D, 2, 0); + return offset; +} + +guint16 gfire_group_proto_create_remove_buddy_from_group(guint32 p_groupid, guint32 p_userid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // '01' User ID + p_userid = GUINT32_TO_LE(p_userid); + offset = gfire_proto_write_attr_bs(0x01, 0x02, &p_userid, sizeof(p_userid), offset); + + // '19' Group ID + p_groupid = GUINT32_TO_LE(p_groupid); + offset = gfire_proto_write_attr_bs(0x19, 0x02, &p_groupid, sizeof(p_groupid), offset); + + gfire_proto_write_header(offset, 0x1E, 2, 0); + return offset; +} + +void gfire_group_proto_groups(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + GList *groupids = NULL; + GList *groupnames = NULL; + + guint32 offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &groupids, 0x19, offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !groupids) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &groupnames, 0x1A, offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !groupnames) + { + gfire_list_clear(groupids); + return; + } + + GList *id = groupids; + GList *name = groupnames; + + while(id) + { + gfire_group *group = gfire_group_create(p_gfire, (gchar*)name->data, *((guint32*)id->data)); + gfire_add_group(p_gfire, group); + + id = g_list_next(id); + name = g_list_next(name); + } + + gfire_list_clear(groupids); + gfire_list_clear(groupnames); +} + +void gfire_group_proto_buddies_in_groups(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + GList *userids = NULL; + GList *groupids = NULL; + + guint32 offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &userids, 0x01, offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !userids) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &groupids, 0x19, offset); + // Parsing error or empty list -> skip further parsing + if(offset == -1 || !groupids) + { + gfire_list_clear(userids); + return; + } + + GList *cur_user = userids; + GList *cur_group = groupids; + + while(cur_user) + { + gfire_group *group = gfire_find_group(p_gfire, cur_group->data, GFFG_GID); + if(group) + { + gfire_group_add_buddy(group, *((guint32*)cur_user->data), FALSE); + } + + cur_user = g_list_next(cur_user); + cur_group = g_list_next(cur_group); + } + + gfire_list_clear(userids); + gfire_list_clear(groupids); +} + +void gfire_group_proto_group_added(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 groupid = 0; + gchar *groupname = NULL; + + guint32 offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &groupid, 0x19, offset); + // Parsing error -> skip further parsing + if(offset == -1) + return; + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &groupname, 0x1A, offset); + // Parsing error -> skip further parsing + if(offset == -1 || !groupname) + return; + + gfire_group *group = gfire_find_group(p_gfire, groupname, GFFG_NAME); + if(group) + gfire_group_added(group, groupid); + + g_free(groupname); +} diff -Nru gfire-0.8.3/src/gf_groups_proto.h gfire-0.9.4/src/gf_groups_proto.h --- gfire-0.8.3/src/gf_groups_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_groups_proto.h 2011-03-14 20:23:49.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_GROUPS_PROTO_H +#define _GF_GROUPS_PROTO_H + +#include "gf_base.h" +#include "gfire.h" + +// Packet creation +guint16 gfire_group_proto_create_create_group(const gchar *p_name); +guint16 gfire_group_proto_create_remove_group(guint32 p_groupid); +guint16 gfire_group_proto_create_rename_group(guint32 p_groupid, const gchar *p_name); +guint16 gfire_group_proto_create_add_buddy_to_group(guint32 p_groupid, guint32 p_userid); +guint16 gfire_group_proto_create_remove_buddy_from_group(guint32 p_groupid, guint32 p_userid); + +// Packet parsing +void gfire_group_proto_groups(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_group_proto_buddies_in_groups(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_group_proto_group_added(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // _GF_GROUPS_PROTO_H diff -Nru gfire-0.8.3/src/gfire.c gfire-0.9.4/src/gfire.c --- gfire-0.8.3/src/gfire.c 2009-08-19 15:18:22.000000000 +0000 +++ gfire-0.9.4/src/gfire.c 2011-03-14 20:19:32.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -20,2223 +19,1508 @@ * along with Gfire. If not, see . */ -#include "gfire.h" +#include "gfire_proto.h" #include "gf_network.h" -#include "gf_packet.h" #include "gf_games.h" -#include "gf_chat.h" +#include "gfire.h" -static const char *gfire_blist_icon(PurpleAccount *a, PurpleBuddy *b); -static const char *gfire_blist_emblems(PurpleBuddy *b); -static void gfire_blist_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full); -static GList *gfire_status_types(PurpleAccount *account); -static int gfire_im_send(PurpleConnection *gc, const char *who, const char *what, PurpleMessageFlags flags); -static void gfire_login(PurpleAccount *account); -static void gfire_login_cb(gpointer data, gint source, const gchar *error_message); -static void gfire_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); -static void gfire_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); -void gfire_buddy_menu_profile_cb(PurpleBlistNode *node, gpointer *data); -GList * gfire_node_menu(PurpleBlistNode *node); - -void gfire_join_game(PurpleConnection *gc, const gchar *sip, int sport, int game); -void gfire_game_watch_cb(GPid pid, int status, gpointer *data); -char *gfire_escape_html(const char *html); - -#ifdef IS_NOT_WINDOWS -static void gfire_action_manage_games_cb(PurplePluginAction *action); -static void gfire_add_game_cb(manage_games_callback_args *args, GtkWidget *button); -static void gfire_edit_game_cb(manage_games_callback_args *args, GtkWidget *button); -static void gfire_manage_games_add_update_label_cb(GtkWidget *add_path_label, GtkWidget *add_type_combo_box); -static void gfire_manage_games_edit_update_fields_cb(GtkBuilder *builder, GtkWidget *edit_games_combo_box); -static void gfire_remove_game_cb(manage_games_callback_args *args, GtkWidget *button); -static void gfire_reload_lconfig(PurpleConnection *gc); -xmlnode *gfire_manage_game_xml(char *game_id, char *game_name, char *game_type, char *game_bin, - char *game_dir, char *game_mod, char *game_connect, char *game_launch, char *unix_process, char *windows_process); - -gboolean separe_path(char *path, char **file); -gboolean check_process(char *process); -#endif - -static PurplePlugin *_gfire_plugin = NULL; - -static const char *gfire_blist_icon(PurpleAccount *a, PurpleBuddy *b) { - return "gfire"; -} +#ifdef USE_GAME_DETECTION +# include "gf_server_detection.h" +# include "gf_game_detection.h" +#endif // USE_GAME_DETECTION +static guint gfire_update_count = 0; +static PurpleUtilFetchUrlData *gfire_update_data = NULL; -static const char *gfire_blist_emblems(PurpleBuddy *b) -{ - gfire_data *gfire = NULL; - gfire_buddy *gf_buddy = NULL; - GList *tmp = NULL; - PurplePresence *p = NULL; - PurpleConnection *gc = NULL; +gfire_data *gfire_create(PurpleConnection *p_gc) +{ + if(!p_gc) + return NULL; - if (!b || (NULL == b->account) || !(gc = purple_account_get_connection(b->account)) || - !(gfire = (gfire_data *) gc->proto_data) || (NULL == gfire->buddies)) + gfire_data *ret = (gfire_data*)g_malloc0(sizeof(gfire_data)); + if(!ret) return NULL; - tmp = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)b->name, GFFB_NAME); - if ((NULL == tmp) || (NULL == tmp->data)) return NULL; - gf_buddy = (gfire_buddy *)tmp->data; - - p = purple_buddy_get_presence(b); - - if (purple_presence_is_online(p) == TRUE){ - if (0 != gf_buddy->gameid) - return "game"; - } + ret->gc = p_gc; - return NULL; -} + ret->sid = (guint8*)g_malloc0(XFIRE_SID_LEN); + if(!ret->sid) + goto error; + ret->buff_in = (guint8*)g_malloc0(GFIRE_BUFFIN_SIZE); + if(!ret->buff_in) + goto error; -static char *gfire_status_text(PurpleBuddy *buddy) -{ - char msg[100]; - GList *gfbl = NULL; - gfire_data *gfire = NULL; - gfire_buddy *gf_buddy = NULL; - PurplePresence *p = NULL; - PurpleConnection *gc = NULL; - char *game_name = NULL; + ret->prefs = gfire_preferences_create(); - if (!buddy || (NULL == buddy->account) || !(gc = purple_account_get_connection(buddy->account)) || - !(gfire = (gfire_data *) gc->proto_data) || (NULL == gfire->buddies)) - return NULL; + ret->fd = -1; - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)buddy->name, GFFB_NAME); - if (NULL == gfbl) return NULL; + gfire_network_init(); - gf_buddy = (gfire_buddy *)gfbl->data; - p = purple_buddy_get_presence(buddy); + return ret; - if (TRUE == purple_presence_is_online(p)) { - if (0 != gf_buddy->gameid) { - game_name = gfire_game_name(gc, gf_buddy->gameid); - g_sprintf(msg, "Playing %s", game_name); - g_free(game_name); - return g_strdup(msg); - } - if (gf_buddy->away) { - g_sprintf(msg,"%s", gf_buddy->away_msg); - return gfire_escape_html(msg); - } - } + error: + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_create: Out of memory!\n"); + gfire_free(ret); return NULL; } - -static void gfire_blist_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) +void gfire_free(gfire_data *p_gfire) { - PurpleConnection *gc = NULL; - gfire_data *gfire = NULL; - GList *gfbl = NULL; - gfire_buddy *gf_buddy = NULL; - PurplePresence *p = NULL; - gchar *game_name = NULL; - guint32 *magic = NULL; - gchar ipstr[16] = ""; - - if (!buddy || (NULL == buddy->account) || !(gc = purple_account_get_connection(buddy->account)) || - !(gfire = (gfire_data *) gc->proto_data) || (NULL == gfire->buddies)) + if(!p_gfire) return; - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)buddy->name, GFFB_NAME); - if (NULL == gfbl) return; - - gf_buddy = (gfire_buddy *)gfbl->data; - p = purple_buddy_get_presence(buddy); + if(p_gfire->sid) g_free(p_gfire->sid); + if(p_gfire->buff_in) g_free(p_gfire->buff_in); - if (TRUE == purple_presence_is_online(p)) { + // Free all buddies + while(p_gfire->buddies) + { + gfire_buddy_free((gfire_buddy*)p_gfire->buddies->data); + p_gfire->buddies = g_list_delete_link(p_gfire->buddies, p_gfire->buddies); + } - if (0 != gf_buddy->gameid) { - game_name = gfire_game_name(gc, gf_buddy->gameid); + // Free all clans + while(p_gfire->clans) + { + gfire_clan_free((gfire_clan*)p_gfire->clans->data); + p_gfire->clans = g_list_delete_link(p_gfire->clans, p_gfire->clans); + } - purple_notify_user_info_add_pair(user_info,"Game",game_name); + // Free all groups + while(p_gfire->groups) + { + gfire_group_free((gfire_group*)p_gfire->groups->data, FALSE); + p_gfire->groups = g_list_delete_link(p_gfire->groups, p_gfire->groups); + } - g_free(game_name); - magic = (guint32 *)gf_buddy->gameip; - if ((NULL != gf_buddy->gameip) && (0 != *magic)) { + // Free all chats + while(p_gfire->chats) + { + gfire_chat_free((gfire_chat*)p_gfire->chats->data); + p_gfire->chats = g_list_delete_link(p_gfire->chats, p_gfire->chats); + } - g_sprintf(ipstr, "%d.%d.%d.%d", gf_buddy->gameip[3], gf_buddy->gameip[2], - gf_buddy->gameip[1], gf_buddy->gameip[0]); + if(p_gfire->p2p) + gfire_p2p_connection_close(p_gfire->p2p); - gchar * value = g_strdup_printf("%s:%d", ipstr, gf_buddy->gameport); - purple_notify_user_info_add_pair(user_info,"Server",value); - g_free(value); +#ifdef USE_GAME_DETECTION + // Unregister this Gfire session with game detection + gfire_game_detector_unregister(p_gfire); +#endif // USE_GAME_DETECTION - } - } - if (gf_buddy->away) { - char * escaped_away = gfire_escape_html(gf_buddy->away_msg); + // Free client preferences + gfire_preferences_free(p_gfire->prefs); - purple_notify_user_info_add_pair(user_info,"Away",escaped_away); + g_free(p_gfire); - g_free(escaped_away); - } - } + gfire_network_cleanup(); } +PurpleConnection *gfire_get_connection(const gfire_data *p_gfire) +{ + if(!p_gfire) + return NULL; + return p_gfire->gc; +} -static GList *gfire_status_types(PurpleAccount *account) +const gchar *gfire_get_name(const gfire_data *p_gfire) { - PurpleStatusType *type; - GList *types = NULL; - - type = purple_status_type_new(PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE); - types = g_list_append(types, type); + if(!p_gfire) + return NULL; - type = purple_status_type_new_with_attrs( - PURPLE_STATUS_AWAY, NULL, NULL, FALSE, TRUE, FALSE, - "message", "Message", purple_value_new(PURPLE_TYPE_STRING), - NULL); - types = g_list_append(types, type); + return purple_account_get_username(purple_connection_get_account(gfire_get_connection(p_gfire))); +} - type = purple_status_type_new(PURPLE_STATUS_OFFLINE, NULL, NULL, TRUE); - types = g_list_append(types, type); +const gchar *gfire_get_nick(const gfire_data *p_gfire) +{ + if(!p_gfire) + return NULL; - return types; + return p_gfire->alias; } - -static void gfire_login(PurpleAccount *account) +static void gfire_update_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const gchar *p_buf, gsize p_len, const gchar *p_error_message) { - gfire_data *gfire; - int err = 0; - - PurpleConnection *gc = purple_account_get_connection(account); - /* set connection flags for chats and im's tells purple what we can and can't handle */ - gc->flags |= PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_FONTSIZE - | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_NO_IMAGES; - - purple_connection_update_progress(gc, "Connecting", 0, XFIRE_CONNECT_STEPS); - - gc->proto_data = gfire = g_new0(gfire_data, 1); - gfire->fd = -1; - gfire->buff_out = gfire->buff_in = NULL; - /* load game xml from user dir */ - gfire_parse_games_file(gc, g_build_filename(purple_user_dir(), "gfire_games.xml", NULL)); - gfire_parse_launchinfo_file(gc, g_build_filename(purple_user_dir(), "gfire_launch.xml", NULL)); + gfire_update_data = NULL; - if (!purple_account_get_connection(account)) { - purple_connection_error(gc, "Couldn't create socket."); - return; + if (!p_data || !p_buf || !p_len) + { + purple_debug_error("gfire", "Unable to query latest Gfire and games list version. Website down?\n"); + gfire_update_count--; } + else + { + xmlnode *version_node = xmlnode_from_str(p_buf, p_len); + if (!version_node) + purple_debug_error("gfire", "Unable to query latest Gfire and games list version. Website down?\n"); + else + { + // Get current Gfire and games list version + guint32 gfire_latest_version = 0; + if(xmlnode_get_attrib(version_node, "version")) + sscanf(xmlnode_get_attrib(version_node, "version"), "%u", &gfire_latest_version); + + guint32 games_list_version = 0; + if(xmlnode_get_attrib(version_node, "games_list_version")) + sscanf(xmlnode_get_attrib(version_node, "games_list_version"), "%u", &games_list_version); + + // Notify user if Gfire can be updated +#ifdef UPDATE_NOTIFY + const gchar *gfire_latest_suffix = xmlnode_get_attrib(version_node, "suffix"); + + // Higher version number + if ((GFIRE_VERSION < gfire_latest_version) || + // Same version, current one is not SVN + ((GFIRE_VERSION == gfire_latest_version) && (g_strcmp0(GFIRE_VERSION_SUFFIX, "svn") != 0) && + // Released suffix is higher than the current + strlen(GFIRE_VERSION_SUFFIX) && (g_strcmp0(gfire_latest_suffix, GFIRE_VERSION_SUFFIX) > 0))) + { + gchar *msg = NULL; +#ifdef USE_NOTIFICATIONS + if(purple_account_get_bool(purple_connection_get_account(p_data), "use_notify", TRUE)) + { + msg = g_strdup_printf(_("Gfire %u.%u.%u%s%s is now available.\nVisit the Gfire website for " + "more information!"), (gfire_latest_version & (0xFF << 16)) >> 16, + (gfire_latest_version & (0xFF << 8)) >> 8, gfire_latest_version & 0xFF, + (gfire_latest_suffix && strlen(gfire_latest_suffix)) ? "-" : "", + gfire_latest_suffix ? gfire_latest_suffix : ""); + gfire_notify_system(_("New Gfire Version"), msg); + } + else +#endif // USE_NOTIFICATIONS + { + // FIXME: implement a way to disable this notification + msg = g_strdup_printf(_("Gfire %u.%u.%u%s%s is now available.\nVisit the Gfire website for more " + "information!"), (gfire_latest_version & (0xFF << 16)) >> 16, + (gfire_latest_version & (0xFF << 8)) >> 8, gfire_latest_version & 0xFF, + (gfire_latest_suffix && strlen(gfire_latest_suffix)) ? "-" : "", + gfire_latest_suffix ? gfire_latest_suffix : ""); + purple_notify_message(p_data, PURPLE_NOTIFY_MSG_WARNING, _("New Gfire Version"), _("New Gfire Version"), + msg, NULL, NULL); + } - if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "server", XFIRE_SERVER), - purple_account_get_int(account, "port", XFIRE_PORT), - gfire_login_cb, gc) == NULL){ - purple_connection_error(gc, "Couldn't create socket."); - return; - } -} + g_free(msg); + } +#endif // UPDATE_NOTIFY + // Update games list if needed + gboolean update_games_list = FALSE; -static void gfire_login_cb(gpointer data, gint source, const gchar *error_message) -{ - PurpleConnection *gc = data; - guint8 packet[1024]; - int length; - PurpleAccount *account = purple_connection_get_account(gc); - gfire_data *gfire = (gfire_data *)gc->proto_data; - gfire->buddies = NULL; + if(!gfire_game_have_list()) + update_games_list = TRUE; + else + { + guint32 local_games_list_version = gfire_game_get_version(); + if (local_games_list_version < games_list_version) + update_games_list = TRUE; + } - purple_debug(PURPLE_DEBUG_MISC, "gfire", "connected source=%d\n",source); - if (!g_list_find(purple_connections_get_all(), gc)) { - close(source); - return; - } + if (update_games_list) + { + purple_debug_info("gfire", "Updating games list to version %u\n", games_list_version); + gfire_update_data = purple_util_fetch_url(GFIRE_GAMES_XML_URL, TRUE, "purple-xfire", TRUE, + gfire_update_games_list_cb, p_data); + } + } - if (source < 0) { - purple_connection_error(gc, "Unable to connect to host."); - return; + xmlnode_free(version_node); } +} + +static void gfire_update(gfire_data *p_gfire) +{ + if(!gfire_update_count) + { + gfire_game_load_games_xml(); - gfire->fd = source; + // Load game xml from user dir; these don't need to work unless we are connected + gfire_game_load_config_xml(FALSE); - /* Update the login progress status display */ + gfire_update_data = purple_util_fetch_url(GFIRE_CURRENT_VERSION_XML_URL, TRUE, "purple-xfire", TRUE, + gfire_update_cb, gfire_get_connection(p_gfire)); + } - purple_connection_update_progress(gc, "Login", 1, XFIRE_CONNECT_STEPS); + gfire_update_count++; +} - gfire_send(gc, (const guint8 *)"UA01", 4); /* open connection */ +static void gfire_update_abort() +{ + if(gfire_update_count == 0) + return; - length = gfire_client_version(packet,purple_account_get_int(account, "version", XFIRE_PROTO_VERSION)); - gfire_send(gc, packet, length); + gfire_update_count--; - gc->inpa = purple_input_add(gfire->fd, PURPLE_INPUT_READ, gfire_input_cb, gc); + if(!gfire_update_count && gfire_update_data) + { + purple_util_fetch_url_cancel(gfire_update_data); + gfire_update_data = NULL; + } } +// Called by gfire_update_games_list_cb() in gf_games.c +void gfire_games_update_done() +{ + gfire_update_data = NULL; +} -void gfire_close(PurpleConnection *gc) +static void gfire_login_cb(gpointer p_data, gint p_source, const gchar *p_error_message) { - gfire_data *gfire = NULL; - GList *buddies = NULL; - GList *chats = NULL; - gfire_buddy *b = NULL; - gfire_chat *gf_chat = NULL; + gfire_data *gfire = (gfire_data*)p_data; + if(!gfire) + return; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONNECTION: close requested.\n"); - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: closing, but either no GC or ProtoData.\n"); + if(p_source < 0) + { + purple_connection_error_reason(gfire_get_connection(gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, p_error_message); return; } - if (gc->inpa) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: removing input handler\n"); - purple_input_remove(gc->inpa); - } + PurpleAccount *account = purple_connection_get_account(gfire_get_connection(gfire)); - if (gfire->xqf_source > 0) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: removing xqf file watch callback\n"); - g_source_remove(gfire->xqf_source); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "connected file descriptor = %d\n", p_source); + if(!g_list_find(purple_connections_get_all(), gfire_get_connection(gfire))) + { + close(p_source); + return; } - if (gfire->det_source > 0) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: removing game detection callback\n"); - g_source_remove(gfire->det_source); - } + gfire->fd = p_source; - if (gfire->fd >= 0) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: closing source file descriptor\n"); - close(gfire->fd); - } + // Initiate the keep-alive mechanism + GTimeVal gtv; + g_get_current_time(>v); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: freeing buddy list\n"); - buddies = gfire->buddies; - while (NULL != buddies) { - b = (gfire_buddy *)buddies->data; - if (NULL != b->away_msg) g_free(b->away_msg); - if (NULL != b->name) g_free(b->name); - if (NULL != b->alias) g_free(b->alias); - if (NULL != b->userid) g_free(b->userid); - if (NULL != b->uid_str) g_free(b->uid_str); - if (NULL != b->sid) g_free(b->sid); - if (NULL != b->sid_str) g_free(b->sid_str); - if (NULL != b->gameip) g_free(b->gameip); - g_free(b); - buddies->data = NULL; - buddies = g_list_next(buddies); - } - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: freeing chat sturct\n"); - chats = gfire->chats; - while (NULL != buddies) { - gf_chat = (gfire_chat *)chats->data; - if (NULL != gf_chat->members) g_list_free(gf_chat->members); - if (NULL != gf_chat->chat_id) g_free(gf_chat->chat_id); - if (NULL != gf_chat->topic) g_free(gf_chat->topic); - if (NULL != gf_chat->motd) g_free(gf_chat->motd); - if (NULL != gf_chat->c) g_free(gf_chat->c); - g_free(gf_chat); - chats->data = NULL; - chats = g_list_next(chats); - } + gfire->last_pong = gtv.tv_sec; + // Update the login progress status display + purple_connection_update_progress(gfire_get_connection(gfire), "Login", 1, XFIRE_CONNECT_STEPS); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: freeing gfire struct\n"); - if (NULL != gfire->im) { - if (NULL != gfire->im->sid_str) g_free(gfire->im->sid_str); - if (NULL != gfire->im->im_str) g_free(gfire->im->im_str); - g_free(gfire->im); gfire->im = NULL; - } - - if (NULL != gfire->email) g_free(gfire->email); - if (NULL != gfire->buff_out) g_free(gfire->buff_out); - if (NULL != gfire->buff_in) g_free(gfire->buff_in); - if (NULL != gfire->buddies) g_list_free(gfire->buddies); - if (NULL != gfire->chats) g_list_free(gfire->chats); - if (NULL != gfire->xml_games_list) xmlnode_free(gfire->xml_games_list); - if (NULL != gfire->xml_launch_info) xmlnode_free(gfire->xml_launch_info); - if (NULL != gfire->userid) g_free(gfire->userid); - if (NULL != gfire->sid) g_free(gfire->sid); - if (NULL != gfire->alias) g_free(gfire->alias); + gfire_network_buffout_write("UA01", 4, 0); + gfire_send(gfire_get_connection(gfire), 4); /* open connection */ - g_free(gfire); - gc->proto_data = NULL; -} + // Send client version + guint16 length = gfire_proto_create_client_version(purple_account_get_int(account, "version", XFIRE_PROTO_VERSION)); + if(length) gfire_send(gfire_get_connection(gfire), length); + + gfire_get_connection(gfire)->inpa = purple_input_add(gfire->fd, PURPLE_INPUT_READ, gfire_input_cb, gfire); + gfire->clans = gfire_clan_get_existing(); +} -static int gfire_im_send(PurpleConnection *gc, const char *who, const char *what, PurpleMessageFlags flags) +void gfire_login(gfire_data *p_gfire) { - PurplePresence *p = NULL; - gfire_data *gfire = NULL; - gfire_buddy *gf_buddy = NULL; - GList *gfbl = NULL; - PurpleAccount *account = NULL; - PurpleBuddy *buddy = NULL; - int packet_len = 0; - - if (!gc || !(gfire = (gfire_data*)gc->proto_data)) - return 1; - - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)who, GFFB_NAME); - if (NULL == gfbl) return 1; - - gf_buddy = (gfire_buddy *)gfbl->data; - account = purple_connection_get_account(gc); - buddy = purple_find_buddy(account, gf_buddy->name); - if(buddy == NULL){ - purple_conv_present_error(who, account, "Message could not be sent. Buddy not in contact list"); - return 1; - } + if(!p_gfire) + return; - p = purple_buddy_get_presence(buddy); + if(!g_thread_supported()) + g_thread_init(NULL); - if (TRUE == purple_presence_is_online(p)) { - /* in 2.0 the gtkimhtml stuff started escaping special chars & now = & - ** XFire native clients don't handle it. */ - what = purple_unescape_html(what); - packet_len = gfire_create_im(gc, gf_buddy, what); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(im send): %s: %s\n", NN(buddy->name), NN(what)); - gfire_send(gc, gfire->buff_out, packet_len); - g_free((void *)what); - return 1; - } else { - purple_conv_present_error(who, account, "Message could not be sent. Buddy offline"); - return 1; - } + PurpleAccount *account = purple_connection_get_account(gfire_get_connection(p_gfire)); + purple_connection_update_progress(gfire_get_connection(p_gfire), _("Connecting"), 0, XFIRE_CONNECT_STEPS); + + if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "server", XFIRE_SERVER), + purple_account_get_int(account, "port", XFIRE_PORT), + gfire_login_cb, p_gfire) == NULL) + { + purple_connection_error_reason(gfire_get_connection(p_gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Couldn't create socket.")); + return; + } } -static unsigned int gfire_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) +void gfire_close(gfire_data *p_gfire) { - gfire_buddy *gf_buddy = NULL; - gfire_data *gfire = NULL; - GList *gfbl = NULL; - int packet_len = 0; - gboolean typenorm = TRUE; + if(!p_gfire) + return; - if (!gc || !(gfire = (gfire_data*)gc->proto_data)) - return 1; + gfire_update_abort(); - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)who, GFFB_NAME); - if (NULL == gfbl) return 1; + PurpleConnection *gc = gfire_get_connection(p_gfire); - gf_buddy = (gfire_buddy *)gfbl->data; + // Save client preferences + if(p_gfire->userid) + { + if(gfire_preferences_get(p_gfire->prefs, 0x08) != purple_account_get_bool(purple_connection_get_account(gc), "show_fofs", TRUE)) + gfire_preferences_set(p_gfire->prefs, 0x08, purple_account_get_bool(purple_connection_get_account(gc), "show_fofs", TRUE)); + gfire_preferences_send(p_gfire->prefs, gc); + } - typenorm = purple_account_get_bool(purple_connection_get_account(gc), "typenorm", TRUE); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONNECTION: close requested.\n"); - if (!typenorm) - return 0; + if(gc->inpa) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: removing input handler\n"); + purple_input_remove(gc->inpa); + } - if (state == PURPLE_NOT_TYPING) - return 0; +#ifdef HAVE_GTK + // Server browser clean-up code + gfire_server_browser_free(p_gfire->server_browser); +#endif // HAVE_GTK - if (state == PURPLE_TYPING){ - packet_len = gfire_send_typing_packet(gc, gf_buddy); - gfire_send(gc, gfire->buff_out, packet_len); + if(p_gfire->fd >= 0) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "CONN: closing source file descriptor\n"); + close(p_gfire->fd); + p_gfire->fd = -1; } - return XFIRE_SEND_TYPING_TIMEOUT; -} + gfire_free(p_gfire); + gc->proto_data = NULL; +} -static void gfire_get_info(PurpleConnection *gc, const char *who) +gfire_buddy *gfire_find_buddy(gfire_data *p_gfire, const void *p_data, gfire_find_buddy_mode p_mode) { - PurpleAccount *account; - PurpleBuddy *buddy; - PurpleNotifyUserInfo *user_info; - gfire_buddy *gf_buddy; - gfire_data *gfire; - GList *gfbl = NULL; - PurplePresence *p = NULL; - char *status = NULL; - guint32 *magic = NULL; - gchar ipstr[16] = ""; - char *server = NULL; + gfire_buddy *b = NULL; - account = purple_connection_get_account(gc); - buddy = purple_find_buddy(account, who); - user_info = purple_notify_user_info_new(); - p = purple_buddy_get_presence(buddy); + if (!p_gfire || !p_data) + return NULL; + + GList *buddy = p_gfire->buddies; + for(; buddy; buddy = g_list_next(buddy)) + { + b = (gfire_buddy *)buddy->data; + switch(p_mode) + { + case GFFB_NAME: + if(0 == g_ascii_strcasecmp((const gchar*)p_data, gfire_buddy_get_name(b))) + return b; + break; + case GFFB_ALIAS: + if(0 == g_ascii_strcasecmp((const gchar*)p_data, gfire_buddy_get_alias(b))) + return b; + break; + case GFFB_USERID: + if(gfire_buddy_is_by_userid(b, *(const guint32*)p_data)) + return b; + break; + case GFFB_SID: + if(gfire_buddy_is_by_sid(b, (const guint8*)p_data)) + return b; + break; + default: + /* mode not implemented */ + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_find_buddy: called with invalid mode\n"); + return NULL; + break; + } + } + return NULL; +} - if (!gc || !(gfire = (gfire_data*)gc->proto_data)) +void gfire_add_buddy(gfire_data *p_gfire, gfire_buddy *p_buddy, gfire_group *p_group) +{ + if(!p_gfire || !p_buddy) return; - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)who, GFFB_NAME); - if (NULL == gfbl) return; + p_buddy->gc = gfire_get_connection(p_gfire); + p_gfire->buddies = g_list_append(p_gfire->buddies, p_buddy); + gfire_buddy_prpl_add(p_buddy, p_group); - gf_buddy = (gfire_buddy *)gfbl->data; + purple_debug_info("gfire", "Added Buddy: Name=%s / Alias=%s / Type=%u\n", + gfire_buddy_get_name(p_buddy), gfire_buddy_get_alias(p_buddy), p_buddy->type); +} - if (gfire_status_text(buddy) == NULL){ - if (purple_presence_is_online(p) == TRUE){ - status = "Available"; - } else { - status = "Offline"; - } - } else { - status = gfire_status_text(buddy); - } +void gfire_remove_buddy(gfire_data *p_gfire, gfire_buddy *p_buddy, gboolean p_fromServer, gboolean p_force) +{ + if(!p_gfire || !p_buddy) + return; - purple_notify_user_info_add_pair(user_info, "Nickname", gf_buddy->alias); - purple_notify_user_info_add_pair(user_info, "Status", status); - if ((0 != gf_buddy->gameid) && (gf_buddy->away)) - purple_notify_user_info_add_pair(user_info, "Away", gf_buddy->away_msg); - magic = (guint32 *)gf_buddy->gameip; - if ((NULL != gf_buddy->gameip) && (0 != *magic)) { - g_sprintf(ipstr, "%d.%d.%d.%d", gf_buddy->gameip[3], gf_buddy->gameip[2], - gf_buddy->gameip[1], gf_buddy->gameip[0]); - server = g_strdup_printf("%s:%d", ipstr, gf_buddy->gameport); - purple_notify_user_info_add_pair(user_info,"Server",server); - g_free(server); + // Delete from server + if(p_fromServer && gfire_buddy_is_friend(p_buddy)) + { + guint16 packet_len = gfire_proto_create_delete_buddy(p_buddy->userid); + gfire_send(gfire_get_connection(p_gfire), packet_len); } - purple_notify_user_info_add_section_break(user_info); - - - purple_notify_userinfo(gc, who, user_info, NULL, NULL); - purple_notify_user_info_destroy(user_info); + if(p_force) gfire_buddy_prpl_remove(p_buddy); + gfire_buddy_free(p_buddy); + // Delete from list + GList *entry = g_list_find(p_gfire->buddies, p_buddy); + if(!entry) + return; + p_gfire->buddies = g_list_delete_link(p_gfire->buddies, entry); } -static void gfire_set_status(PurpleAccount *account, PurpleStatus *status) +void gfire_authenticate(gfire_data *p_gfire, const gchar *p_salt) { - PurpleConnection *gc = NULL; - gfire_data *gfire = NULL; - char *msg = NULL; - int freemsg=0; - if (!purple_status_is_active(status)) + if(!p_gfire || !p_salt) return; - gc = purple_account_get_connection(account); - gfire = (gfire_data *)gc->proto_data; + PurpleAccount *account = purple_connection_get_account(gfire_get_connection(p_gfire)); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(status): got status change to name: %s id: %s\n", - NN(purple_status_get_name(status)), - NN(purple_status_get_id(status))); + // Generate password hash + gchar *username = g_utf8_strdown(purple_account_get_username(account), -1); + gchar *tmp_str = g_strdup_printf("%s%sUltimateArena", username, purple_account_get_password(account)); - if (purple_status_is_available(status)) { - if (gfire->away) msg = ""; - gfire->away = FALSE; - } else { - gfire->away = TRUE; - msg =(char *)purple_status_get_attr_string(status, "message"); - if ((msg == NULL) || (*msg == '\0')) { - msg = "(AFK) Away From Keyboard"; - } else { - msg = purple_unescape_html(msg); - freemsg = 1; - } - } - gfire_send_away(gc, msg); - if (freemsg) g_free(msg); -} + gchar pw_hash[41]; + hashSha1(tmp_str, pw_hash); + g_free(tmp_str); + tmp_str = g_strdup_printf("%s%s", pw_hash, p_salt); + hashSha1(tmp_str, pw_hash); + g_free(tmp_str); -static void gfire_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) -{ - gfire_data *gfire = NULL; - int packet_len = 0; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !buddy || !buddy->name) return; - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Adding buddy: %s\n", NN(buddy->name)); - packet_len = gfire_add_buddy_create(gc, buddy->name); - gfire_send(gc, gfire->buff_out, packet_len); + // Send the packet + guint16 len = gfire_proto_create_auth(username, pw_hash); + if(len > 0) gfire_send(gfire_get_connection(p_gfire), len); + g_free(username); + purple_connection_update_progress(gfire_get_connection(p_gfire), _("Login sent"), 2, XFIRE_CONNECT_STEPS); } - -static void gfire_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) +void gfire_login_successful(gfire_data *p_gfire) { - gfire_data *gfire = NULL; - int packet_len = 0; - gfire_buddy *gf_buddy = NULL; - GList *b = NULL; - PurpleAccount *account = NULL; - gboolean buddynorm = TRUE; - char tmp[255] = ""; + // Send collective statistics + guint16 len = gfire_proto_create_collective_statistics(getenv("LANG") ? getenv("LANG") : "en_GB", + "Gfire", GFIRE_VERSION_STRING, ""); + if(len > 0) gfire_send(gfire_get_connection(p_gfire), len); - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !buddy || !buddy->name) return; +#ifdef HAVE_GTK + // Setup server browser + p_gfire->server_browser = gfire_server_browser_create(gfire_get_connection(p_gfire)); +#endif // HAVE_GTK - if (!(account = purple_connection_get_account(gc))) return; + // Setup P2P connection + if(purple_account_get_bool(purple_connection_get_account(gfire_get_connection(p_gfire)), "p2p_option", TRUE)) + p_gfire->p2p = gfire_p2p_connection_create(); - b = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)buddy->name, GFFB_NAME); - if (b == NULL) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "gfire_remove_buddy: buddy find returned NULL\n"); - return; - } - gf_buddy = (gfire_buddy *)b->data; - if (!gf_buddy) return; + // Update Gfire if needed + gfire_update(p_gfire); - buddynorm = purple_account_get_bool(account, "buddynorm", TRUE); - if (buddynorm) { - g_sprintf(tmp, "Not Removing %s", NN(buddy->name)); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "gfire_remove_buddy: buddynorm TRUE not removing buddy %s.\n", - NN(buddy->name)); - purple_notify_message((void *)_gfire_plugin, PURPLE_NOTIFY_MSG_INFO, "Xfire Buddy Removal Denied", tmp, "Account settings are set to not remove buddies\n" "The buddy will be restored on your next login", NULL, NULL); - return; - } + // Update current status + gfire_set_current_status(p_gfire); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Removing buddy: %s\n", NN(gf_buddy->name)); - packet_len = gfire_remove_buddy_create(gc, gf_buddy); - gfire_send(gc, gfire->buff_out, packet_len); +#ifdef USE_GAME_DETECTION + // Register this Gfire session with the game detection + if(purple_account_get_bool(purple_connection_get_account(gfire_get_connection(p_gfire)), "ingamedetectionnorm", TRUE)) + gfire_game_detector_register(p_gfire); -} + // Send detection data + if(gfire_game_detector_current_gameid()) + gfire_set_game_status(p_gfire, gfire_game_detector_current_game()); + if(gfire_game_detector_current_voipid()) + gfire_set_voip_status(p_gfire, gfire_game_detector_current_voip()); +#endif // USE_GAME_DETECTION + // Tell libpurple that we're ready now + purple_connection_set_state(gfire_get_connection(p_gfire), PURPLE_CONNECTED); +} -GList *gfire_find_buddy_in_list( GList *blist, gpointer *data, int mode ) +void gfire_set_status(gfire_data *p_gfire, const PurpleStatus *p_status) { - gfire_buddy *b = NULL; - guint8 *u = NULL; - guint8 *f = NULL; - gchar *n = NULL; - - if ((NULL == blist) || (NULL == data)) return NULL; - - blist = g_list_first(blist); - switch(mode) - { - case GFFB_NAME: - n = (gchar *)data; - while (NULL != blist){ - b = (gfire_buddy *)blist->data; - if ( 0 == g_ascii_strcasecmp(n, b->name)) return blist; - blist = g_list_next(blist); - } - return NULL; - break; - case GFFB_ALIAS: - n = (gchar *)data; - while (NULL != blist){ - b = (gfire_buddy *)blist->data; - if ( 0 == g_ascii_strcasecmp(n, b->alias)) return blist; - blist = g_list_next(blist); - } - return NULL; - break; - case GFFB_USERID: - n = (gchar *)data; - while (NULL != blist){ - b = (gfire_buddy *)blist->data; - if ( 0 == g_ascii_strcasecmp(n, b->uid_str)) return blist; - blist = g_list_next(blist); - } - return NULL; - break; - case GFFB_UIDBIN: - u = (guint8 *)data; - while (NULL != blist) { - b = (gfire_buddy *)blist->data; - f = b->userid; - if ( (u[0] == f[0]) && (u[1] == f[1]) && (u[2] == f[2]) && (u[3] == f[3])) - return blist; - blist = g_list_next(blist); - } - return NULL; + if(!p_gfire || !p_status) + return; + + gchar *nohtmltags = purple_markup_strip_html(purple_status_get_attr_string(p_status, "message")); + gchar *msg = purple_unescape_html(nohtmltags); + g_free(nohtmltags); + gchar *status = NULL; + switch(purple_status_type_get_primitive(purple_status_get_type(p_status))) + { + case PURPLE_STATUS_AVAILABLE: + if(msg) + status = g_strdup(msg); + else + status = g_strdup(""); break; - case GFFB_SIDS: - n = (gchar *)data; - while (NULL != blist){ - b = (gfire_buddy *)blist->data; - if (!(NULL == b->sid_str) && (0 == g_ascii_strcasecmp(n, b->sid_str))) - return blist; - blist = g_list_next(blist); - } - return NULL; + case PURPLE_STATUS_AWAY: + if(msg && strlen(msg) > 0) + status = g_strdup_printf("(AFK) %s", msg); + else + // TRANSLATORS: Keep "(AFK)" as is! + // Suggestion: Use Xfires original AFK message here + status = g_strdup(_("(AFK) Away From Keyboard")); break; - case GFFB_SIDBIN: - while (NULL != blist){ - b = (gfire_buddy *)blist->data; - if ((NULL != b->sid) && (memcmp(b->sid, data, XFIRE_SID_LEN) == 0)) - return blist; - blist = g_list_next(blist); - } - return NULL; + case PURPLE_STATUS_UNAVAILABLE: + if(msg && strlen(msg) > 0) + status = g_strdup_printf("(Busy) %s", msg); + else + // TRANSLATORS: Keep "(Busy)" as is! + status = g_strdup(_("(Busy) I'm busy!")); break; default: - /* mode not implemented */ - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: gfire_find_buddy_in_list, called with invalid mode\n"); - return NULL; + return; } -} + g_free(msg); -void gfire_new_buddy(PurpleConnection *gc, gchar *alias, gchar *name) -{ - PurpleBuddy *buddy = NULL; - PurpleAccount *account = NULL; - PurpleGroup *default_purple_group = NULL; + purple_debug(PURPLE_DEBUG_INFO, "gfire", "Setting status message to \"%s\"\n", status); + guint16 len = gfire_proto_create_status_text(status); + if(len > 0) gfire_send(gfire_get_connection(p_gfire), len); - account = purple_connection_get_account(gc); - default_purple_group = purple_find_group(GFIRE_DEFAULT_GROUP_NAME); - buddy = purple_find_buddy(account, name); - if (NULL == buddy) { - if (NULL == default_purple_group) { - default_purple_group = purple_group_new(GFIRE_DEFAULT_GROUP_NAME); - purple_blist_add_group(default_purple_group, NULL); - } - buddy = purple_buddy_new(account, name, NULL); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(buddylist): buddy %s not found in Pidgin buddy list, adding.\n", - NN(name)); - purple_blist_add_buddy(buddy, NULL, default_purple_group, NULL); - serv_got_alias(gc, name, g_strdup(alias)); - } else { - serv_got_alias(gc, name, g_strdup(alias)); - } + g_free(status); } - -void gfire_new_buddies(PurpleConnection *gc) +void gfire_set_current_status(gfire_data *p_gfire) { - gfire_data *gfire = (gfire_data *)gc->proto_data; - gfire_buddy *b = NULL; - GList *tmp = gfire->buddies; + if(!p_gfire) + return; - while (NULL != tmp) { - b = (gfire_buddy *)tmp->data; - if (!b) return; - gfire_new_buddy(gc, b->alias, b->name); - tmp = g_list_next(tmp); - } + gfire_set_status(p_gfire, purple_account_get_active_status(purple_connection_get_account(gfire_get_connection(p_gfire)))); } - -void gfire_handle_im(PurpleConnection *gc) +gboolean gfire_is_self(const gfire_data *p_gfire, guint32 p_userid) { - gfire_data *gfire = NULL; - gfire_im *im = NULL; - GList *gfbl = NULL; - gfire_buddy *gf_buddy = NULL; - PurpleAccount *account = NULL; - PurpleBuddy *buddy = NULL; + if(!p_gfire) + return FALSE; - if ( !gc || !(gfire = (gfire_data *)gc->proto_data) || !(im = gfire->im) ) - return; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "im_handle: looking for sid %s\n", NN(im->sid_str)); - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer *) im->sid_str, GFFB_SIDS); - if (NULL == gfbl) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "im_handle: buddy find returned NULL\n"); - g_free(im->im_str); - g_free(im->sid_str); - g_free(im); - gfire->im = NULL; + return (p_gfire->userid == p_userid); +} + +void gfire_add_clan(gfire_data *p_gfire, gfire_clan *p_clan) +{ + if(!p_gfire || !p_clan) return; - } - gf_buddy = (gfire_buddy *)gfbl->data; - account = purple_connection_get_account(gc); - buddy = purple_find_buddy(account, gf_buddy->name); - if (NULL == buddy) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "im_handle: PIDGIN buddy find returned NULL for %s\n", - NN(gf_buddy->name)); - g_free(im->im_str); - g_free(im->sid_str); - g_free(im); - gfire->im = NULL; + + p_gfire->clans = g_list_append(p_gfire->clans, p_clan); +} + +void gfire_remove_clan(gfire_data *p_gfire, gfire_clan *p_clan) +{ + if(!p_gfire || !p_clan) return; - } - if (PURPLE_BUDDY_IS_ONLINE(buddy)) { - if (!purple_privacy_check(account, buddy->name)) + // Delete from list + GList *entry = g_list_find(p_gfire->clans, p_clan); + if(!entry) return; - switch (im->type) + gfire_clan_prpl_remove((gfire_clan*)entry->data); + gfire_clan_free((gfire_clan*)entry->data); + p_gfire->clans = g_list_delete_link(p_gfire->clans, entry); +} + +gfire_clan *gfire_find_clan(gfire_data *p_gfire, guint32 p_clanid) +{ + if(!p_gfire) + return NULL; + + GList *cur = p_gfire->clans; + for(; cur; cur = g_list_next(cur)) + if(gfire_clan_is((gfire_clan*)cur->data, p_clanid)) + return (gfire_clan*)cur->data; + + return NULL; +} + +gfire_group *gfire_find_group(gfire_data *p_gfire, const void *p_data, gfire_find_group_mode p_mode) +{ + if(!p_gfire) + return NULL; + + GList *cur = p_gfire->groups; + while(cur) + { + switch(p_mode) { - case 0: /* got an im */ - serv_got_im(gc, buddy->name, gfire_escape_html(im->im_str), 0, time(NULL)); + case GFFG_GID: + if(gfire_group_is_by_id((gfire_group*)cur->data, *((const guint32*)p_data))) + return (gfire_group*)cur->data; break; - case 1: /* got an ack packet... we shouldn't be here */ + case GFFG_PURPLE: + if(gfire_group_is_by_purple_group((gfire_group*)cur->data, (const PurpleGroup*)p_data)) + return (gfire_group*)cur->data; break; - case 2: /* got a p2p thing... */ + case GFFG_NAME: + if(gfire_group_is_by_name((gfire_group*)cur->data, (const gchar*)p_data)) + return (gfire_group*)cur->data; break; - case 3: /* got typing */ - serv_got_typing(gc, buddy->name, 10, PURPLE_TYPING); + case GFFG_BUDDY: + if(gfire_group_has_buddy((gfire_group*)cur->data, *((const guint32*)p_data))) + return (gfire_group*)cur->data; break; } + + cur = g_list_next(cur); } - if (NULL != im->im_str) g_free(im->im_str); - if (NULL != im->sid_str) g_free(im->sid_str); - g_free(im); - gfire->im = NULL; + return NULL; } +void gfire_add_group(gfire_data *p_gfire, gfire_group *p_group) +{ + if(!p_gfire || !p_group) + return; -/* connection keep alive. We send a packet to the xfire server - * saying we are still around. Otherwise they will forcibly close our connection - * purple allows for this, but calls us every 30 seconds. We keep track of *all* sent - * packets. We only need to send this keep alive if we haven't sent anything in a long(tm) - * time. So we watch and wait. -*/ -void gfire_keep_alive(PurpleConnection *gc){ - static int count = 1; - int packet_len; - gfire_data *gfire = NULL; - GTimeVal gtv; + p_gfire->groups = g_list_append(p_gfire->groups, p_group); - g_get_current_time(>v); - if ((purple_connection_get_state(gc) != PURPLE_DISCONNECTED) && - (NULL != (gfire = (gfire_data *)gc->proto_data)) && - ((gtv.tv_sec - gfire->last_packet) > XFIRE_KEEPALIVE_TIME)) - { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "send keep_alive packet (PING)\n"); - packet_len = gfire_ka_packet_create(gc); - if (packet_len > 0) gfire_send(gc, gfire->buff_out, packet_len); - count = 1; - } - count++; + purple_debug_info("gfire", "Added Group: Name=%s / ID=%u\n", + purple_group_get_name(gfire_group_get_group(p_group)), + p_group->groupid); } - -void gfire_update_buddy_status(PurpleConnection *gc, GList *buddies, int status) +void gfire_remove_group(gfire_data *p_gfire, gfire_group *p_group, gboolean p_remove) { - gfire_buddy *gf_buddy = NULL; - GList *b = g_list_first(buddies); - PurpleBuddy *gbuddy = NULL; - - if (!buddies || !gc || !gc->account) { - if (buddies) g_list_free(buddies); + if(!p_gfire || !p_group) return; - } - - while ( NULL != b ) { - gf_buddy = (gfire_buddy *)b->data; - if ((NULL != (gf_buddy = (gfire_buddy *)b->data)) && (NULL != gf_buddy->name)) { - gbuddy = purple_find_buddy(gc->account, gf_buddy->name); - if (NULL == gbuddy) { b = g_list_next(b); continue; } - switch (status) - { - case GFIRE_STATUS_ONLINE: - if ( 0 == g_ascii_strcasecmp(XFIRE_SID_OFFLINE_STR,gf_buddy->sid_str)) { - - purple_prpl_got_user_status(gc->account, gf_buddy->name, "offline", NULL); - } else { - if ( gf_buddy->away ) { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "away", NULL); - } else { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "available", NULL); - } - } - break; - case GFIRE_STATUS_GAME: - - if ( gf_buddy->gameid > 0 ) { - if ( gf_buddy->away ) { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "away", NULL); - } else { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "available", NULL); - } - } else { - if ( gf_buddy->away ) { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "away", NULL); - } else { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "available", NULL); - } - } - - break; - case GFIRE_STATUS_AWAY: - if ( gf_buddy->away ) { - - purple_prpl_got_user_status(gc->account, gf_buddy->name, "away", NULL); - } else { - purple_prpl_got_user_status(gc->account, gf_buddy->name, "available", NULL); - } + GList *node = g_list_find(p_gfire->groups, p_group); + if(node) + { + gfire_group_free(p_group, p_remove); + p_gfire->groups = g_list_delete_link(p_gfire->groups, node); + } +} - break; - default: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "update_buddy_status: Unknown mode specified\n"); - } +static void gfire_buddy_invitation_authorize_cb(void *data) +{ + invitation_callback_args *args = (invitation_callback_args*)data; + if(!args || !args->gfire || !args->name) + { + if(args) + { + if(args->name) g_free(args->name); + g_free(args); } - b = g_list_next(b); } - g_list_free(buddies); -} + purple_debug(PURPLE_DEBUG_INFO, "gfire", "Authorizing buddy invitation: %s\n", args->name); + guint16 packet_len = gfire_proto_create_invitation_accept(args->name); + if(packet_len > 0) gfire_send(gfire_get_connection(args->gfire), packet_len); + g_free(args->name); + g_free(args); +} -void gfire_buddy_add_authorize_cb(void *data) +static void gfire_buddy_invitation_deny_cb(void *data) { - PurpleConnection *gc = NULL; - gfire_buddy *b = (gfire_buddy *)data; - gfire_data *gfire = NULL; - int packet_len = 0; - - if (!b) { - if (b->name) g_free(b->name); - if (b->alias) g_free(b->alias); - if (b->uid_str) g_free(b->uid_str); - g_free(b); - return; - } - gc = (PurpleConnection *)b->sid; - b->sid = NULL; - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) { - if (b->name) g_free(b->name); - if (b->alias) g_free(b->alias); - if (b->uid_str) g_free(b->uid_str); - g_free(b); - return; + invitation_callback_args *args = (invitation_callback_args*)data; + if(!args || !args->gfire || !args->name) + { + if(args) + { + if(args->name) g_free(args->name); + g_free(args); + } } - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Authorizing buddy invitation: %s\n", NN(b->name)); - packet_len = gfire_invitation_accept(gc, b->name); - gfire_send(gc, gfire->buff_out, packet_len); - - if (b->name) g_free(b->name); - if (b->alias) g_free(b->alias); - if (b->uid_str) g_free(b->uid_str); - g_free(b); + purple_debug(PURPLE_DEBUG_INFO, "gfire", "Rejecting buddy invitation: %s\n", args->name); + guint16 packet_len = gfire_proto_create_invitation_reject(args->name); + if(packet_len > 0) gfire_send(gfire_get_connection(args->gfire), packet_len); + g_free(args->name); + g_free(args); } - -void gfire_buddy_add_deny_cb(void *data) +void gfire_got_invitation(gfire_data *p_gfire, const gchar *p_name, const gchar *p_alias, const gchar *p_msg) { - PurpleConnection *gc = NULL; - gfire_buddy *b = (gfire_buddy *)data; - gfire_data *gfire = NULL; - int packet_len = 0; + if(!p_gfire || !p_name || !p_alias || !p_msg) + return; - if (!b) { - if (b->name) g_free(b->name); - if (b->alias) g_free(b->alias); - if (b->uid_str) g_free(b->uid_str); - g_free(b); - return; - } - gc = (PurpleConnection *)b->sid; - b->sid = NULL; - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) { - if (b->name) g_free(b->name); - if (b->alias) g_free(b->alias); - if (b->uid_str) g_free(b->uid_str); - g_free(b); - return; - } - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Denying buddy invitation: %s\n", NN(b->name)); - packet_len = gfire_invitation_deny(gc, b->name); - gfire_send(gc, gfire->buff_out, packet_len); - - if (b->name) g_free(b->name); - if (b->alias) g_free(b->alias); - if (b->uid_str) g_free(b->uid_str); - g_free(b); + invitation_callback_args *args = g_malloc0(sizeof(invitation_callback_args)); + args->gfire = p_gfire; + args->name = g_strdup(p_name); + purple_account_request_authorization(purple_connection_get_account(gfire_get_connection(p_gfire)), p_name, + NULL, p_alias, p_msg, TRUE, gfire_buddy_invitation_authorize_cb, + gfire_buddy_invitation_deny_cb, args); } - -void gfire_buddy_menu_profile_cb(PurpleBlistNode *node, gpointer *data) +void gfire_set_userid(gfire_data *p_gfire, guint32 p_userid) { - PurpleBuddy *b =(PurpleBuddy *)node; - if (!b || !(b->name)) return; - - char uri[256] = ""; - g_sprintf(uri, "%s%s", XFIRE_PROFILE_URL, b->name); - purple_notify_uri((void *)_gfire_plugin, uri); - } - + if(!p_gfire || p_gfire->userid != 0) + return; - /** - * Callback function for pidgin buddy list right click menu. This callback - * is what the interface calls when the Join Game ... menu option is selected - * - * @param node BuddyList node provided by interface - * @param data Gpointer data (not used) -*/ - void gfire_buddy_menu_joingame_cb(PurpleBlistNode *node, gpointer *data) -{ - int game = 0; - gchar *serverip = NULL; - int serverport = 0; - PurpleBuddy *b = (PurpleBuddy *)node; - PurpleConnection *gc = NULL; - - if (!b || !b->account || !(gc = purple_account_get_connection(b->account))) return; - - game = gfire_get_buddy_game(gc, b); - if (game && gfire_game_playable(gc, game)) { - serverport = gfire_get_buddy_port(gc, b); - if (serverport) serverip = (gchar *)gfire_get_buddy_ip(gc, b); - - gfire_join_game(gc, serverip, serverport, game); - } - } + p_gfire->userid = p_userid; + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Our user ID: %u\n", p_gfire->userid); +} -/* - * purple callback function. Not used directly. Purple calls this callback - * when user right clicks on Xfire buddy (but before menu is displayed) - * Function adds right click "Join Game . . ." menu option. If game is - * playable (configured through launch.xml), and user is not already in - * a game. - * - * @param node Pidgin buddy list node entry that was right clicked - * - * @return Glist list of menu items with callbacks attached (or null) -*/ -GList * gfire_node_menu(PurpleBlistNode *node) +void gfire_set_sid(gfire_data *p_gfire, guint8 *p_sid) { - GList *ret = NULL; - PurpleMenuAction *me = NULL; - PurpleBuddy *b =(PurpleBuddy *)node; - gfire_buddy *gb = NULL; - GList *l = NULL; - PurpleConnection *gc = NULL; - gfire_data *gfire = NULL; - - - if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { - - if (!b || !b->account || !(gc = purple_account_get_connection(b->account)) || - !(gfire = (gfire_data *) gc->proto_data)) - return NULL; - - l = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)b->name, GFFB_NAME); - if (!l) return NULL; /* can't find the buddy? not our plugin? */ - gb = (gfire_buddy *)l->data; - - if (gb && !gfire->gameid && gb->gameid && gfire_game_playable(gc, gb->gameid)){ - /* don't show menu if we are in game */ + if(!p_gfire || !p_sid) + return; - me = purple_menu_action_new("Join Game ...", - PURPLE_CALLBACK(gfire_buddy_menu_joingame_cb),NULL, NULL); + memcpy(p_gfire->sid, p_sid, XFIRE_SID_LEN); - if (!me) { - return NULL; - } - ret = g_list_append(ret, me); - } + gchar *sid = gfire_hex_bin_to_str(p_sid, XFIRE_SID_LEN); + purple_debug_info("gfire", "SessionID: %s\n", sid); + g_free(sid); +} - me = purple_menu_action_new("Xfire Profile", - PURPLE_CALLBACK(gfire_buddy_menu_profile_cb),NULL, NULL); +void gfire_set_alias(gfire_data *p_gfire, const gchar* p_alias) +{ + if(!p_gfire || !p_alias) + return; - if (!me) { - return NULL; - } - ret = g_list_append(ret, me); - } - return ret; + if(p_gfire->alias) + g_free(p_gfire->alias); - } + if(!p_alias) + p_gfire->alias = NULL; + else + p_gfire->alias = g_strdup(p_alias); + purple_connection_set_display_name(gfire_get_connection(p_gfire), p_alias); +} -static void gfire_change_nick(PurpleConnection *gc, const char *entry) +void gfire_remove_buddy_from_clan(gfire_data *p_gfire, gfire_buddy *p_buddy, guint32 p_clanid) { - gfire_data *gfire = NULL; - int packet_len = 0; - gfire_buddy *b = NULL; - GList *l = NULL; - PurpleBuddy *buddy = NULL; - PurpleAccount *account = purple_connection_get_account(gc); - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; + if(!p_gfire || !p_buddy) + return; - packet_len = gfire_create_change_alias(gc, (char *)entry); - if (packet_len) { - gfire_send(gc, gfire->buff_out, packet_len); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Changed server nick (alias) to \"%s\"\n", NN(entry)); - } else { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", - "ERROR: During alias change, _create_change_alias returned 0 length\n"); + if(!gfire_buddy_is_clan_member_of(p_buddy, p_clanid)) return; - } - purple_connection_set_display_name(gc, entry); - l = gfire_find_buddy_in_list(gfire->buddies, (gpointer *)gfire->userid, GFFB_UIDBIN); - if (l) { - /* we are in our own buddy list... change our server alias :) */ - b = (gfire_buddy *)l->data; - buddy = purple_find_buddy(account, b->name); - if (buddy){ - purple_blist_server_alias_buddy(buddy, entry); + guint32 newclanid = 0; + GList *cur = p_gfire->clans; + for(; cur; cur = g_list_next(cur)) + { + if(((gfire_clan*)cur->data)->id == p_clanid) + continue; + + if(gfire_buddy_is_clan_member_of(p_buddy, ((gfire_clan*)cur->data)->id)) + { + newclanid = ((gfire_clan*)cur->data)->id; + break; } } -} - -static void gfire_action_nick_change_cb(PurplePluginAction *action) -{ - PurpleConnection *gc = (PurpleConnection *)action->context; - PurpleAccount *account = purple_connection_get_account(gc); - - purple_request_input(gc, NULL, "Change Xfire nickname", "Leaving empty will clear your current nickname.", purple_connection_get_display_name(gc), - FALSE, FALSE, NULL, "OK", G_CALLBACK(gfire_change_nick), "Cancel", NULL, account, NULL, NULL, gc); + if(!newclanid) + gfire_remove_buddy(p_gfire, p_buddy, FALSE, TRUE); + else + gfire_buddy_remove_clan(p_buddy, p_clanid, newclanid); } -#ifdef IS_NOT_WINDOWS -/* - * Callback function showing the manage games window. - * - * @param action The menu action, passed by the signal connection function - * -*/ -static void gfire_action_manage_games_cb(PurplePluginAction *action) +void gfire_leave_clan(gfire_data *p_gfire, guint32 p_clanid) { - PurpleConnection *gc = (PurpleConnection *)action->context; - GtkBuilder *builder = gtk_builder_new(); - gchar *builder_file; - - if(!gc) { - purple_debug_error("gfire: gfire_action_manage_games_cb", "GC not set.\n"); + if(!p_gfire) return; - } - gfire_reload_lconfig(gc); - builder_file = g_build_filename(DATADIR, "purple", "gfire", "gfire_manage.glade", NULL); - gtk_builder_add_from_file(builder, builder_file, NULL); - g_free(builder_file); - - if(!builder) { - purple_debug_error("gfire: gfire_action_manage_games_cb", "Couldn't build interface.\n"); + gfire_clan *clan = gfire_find_clan(p_gfire, p_clanid); + if(!clan) return; - } - - GtkWidget *manage_games_window = GTK_WIDGET(gtk_builder_get_object(builder, "manage_games_window")); - GtkWidget *add_path_label = GTK_WIDGET(gtk_builder_get_object(builder, "add_path_label")); - GtkWidget *add_type_combo_box = GTK_WIDGET(gtk_builder_get_object(builder, "add_type_combo_box")); - GtkWidget *add_close_button = GTK_WIDGET(gtk_builder_get_object(builder, "add_close_button")); - GtkWidget *add_add_button = GTK_WIDGET(gtk_builder_get_object(builder, "add_add_button")); - GtkWidget *edit_games_combo_box = GTK_WIDGET(gtk_builder_get_object(builder, "edit_games_combo_box")); - GtkWidget *edit_games_list_store = GTK_WIDGET(gtk_builder_get_object(builder, "edit_games_list_store")); - GtkWidget *edit_close_button = GTK_WIDGET(gtk_builder_get_object(builder, "edit_close_button")); - GtkWidget *edit_apply_button = GTK_WIDGET(gtk_builder_get_object(builder, "edit_apply_button")); - GtkWidget *edit_remove_button = GTK_WIDGET(gtk_builder_get_object(builder, "edit_remove_button")); - manage_games_callback_args *args; - - args = g_new0(manage_games_callback_args, 1); - args->gc = gc; - args->builder = builder; + GList *cur = p_gfire->buddies; + for(; cur; cur = g_list_next(cur)) + { + gfire_buddy *buddy = (gfire_buddy*)cur->data; - g_signal_connect_swapped(add_type_combo_box, "changed", G_CALLBACK(gfire_manage_games_add_update_label_cb), add_path_label); - g_signal_connect_swapped(add_close_button, "clicked", G_CALLBACK(gtk_widget_destroy), manage_games_window); - g_signal_connect_swapped(add_add_button, "clicked", G_CALLBACK(gfire_add_game_cb), args); - g_signal_connect_swapped(edit_games_combo_box, "changed", G_CALLBACK(gfire_manage_games_edit_update_fields_cb), builder); - g_signal_connect_swapped(edit_close_button, "clicked", G_CALLBACK(gtk_widget_destroy), manage_games_window); - g_signal_connect_swapped(edit_apply_button, "clicked", G_CALLBACK(gfire_edit_game_cb), args); - g_signal_connect_swapped(edit_remove_button, "clicked", G_CALLBACK(gfire_remove_game_cb), args); + if(gfire_buddy_is_clan_member(buddy) && gfire_buddy_get_default_clan(buddy) == p_clanid) + gfire_remove_buddy_from_clan(p_gfire, buddy, p_clanid); + } - xmlnode *gfire_launch = purple_util_read_xml_from_file("gfire_launch.xml", "gfire_launch.xml"); + gfire_clan_prpl_remove(clan); +} - if(gfire_launch) - { - GtkTreeIter iter; - xmlnode *node_child; +static void gfire_get_info_parse_gamerig_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const gchar *p_buf, gsize p_len, const gchar *p_error_message) +{ + get_info_callback_args *args = (get_info_callback_args*)p_data; - for(node_child = xmlnode_get_child(gfire_launch, "game"); node_child != NULL; - node_child = xmlnode_get_next_twin(node_child)) + if (!args || !p_buf || !p_len) { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "User Info Gamerig XML Download: Download failed.\n"); + if(args) { - const char *game_name = xmlnode_get_attrib(node_child, "name"); - - gtk_list_store_append(GTK_LIST_STORE(edit_games_list_store), &iter); - gtk_list_store_set(GTK_LIST_STORE(edit_games_list_store), &iter, 0, game_name, -1); + purple_notify_user_info_add_section_break(args->user_info); + purple_notify_user_info_add_pair(args->user_info, _("Error"), _("Retrieving gamerig data failed!")); } } + else + { + purple_notify_user_info_add_section_break(args->user_info); + xmlnode *gamerig = xmlnode_from_str(p_buf, p_len); + if(!gamerig) + { + purple_notify_user_info_add_pair(args->user_info, _("Error"), _("Invalid gamerig data received!")); + } + else if(xmlnode_get_child(gamerig, "error")) + { + gchar *tmp = xmlnode_get_data(xmlnode_get_child(gamerig, "error")); + purple_notify_user_info_add_pair(args->user_info, "Gaming Rig", NN(tmp)); + if(tmp) g_free(tmp); + xmlnode_free(gamerig); + } + else + { + gchar *tmp = NULL; - #ifdef IS_WINDOWS - gtk_combo_box_remove_text(GTK_COMBO_BOX(add_type_combo_box), 1); - #endif - gtk_window_set_keep_above(GTK_WINDOW(manage_games_window), TRUE); - gtk_widget_show_all(manage_games_window); -} - + // Heading + gchar *escaped_alias = gfire_escape_html(gfire_buddy_get_alias(args->gf_buddy)); + tmp = g_strdup_printf(_("%ss Gaming Rig:"), escaped_alias); + g_free(escaped_alias); + purple_notify_user_info_add_pair(args->user_info, tmp, NULL); + g_free(tmp); + + // Manufacturer + xmlnode *data = xmlnode_get_child(gamerig, "manufacturer"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Manufacturer"), tmp); + g_free(tmp); + } -/* - * Callback function to add a game by getting the values from the manage games window. - * -*/ -static void gfire_add_game_cb(manage_games_callback_args *args, GtkWidget *button) -{ - PurpleConnection *gc = args->gc; - GtkBuilder *builder = args->builder; - - if(!gc || !builder) { - purple_debug_error("gfire: gfire_add_game_cb", "GC not set and/or couldn't access interface.\n"); - return; - } + // CPU + data = xmlnode_get_child(gamerig, "processor"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Processor"), tmp); + g_free(tmp); + } - GtkWidget *id_entry = GTK_WIDGET(gtk_builder_get_object(builder, "add_id_entry")); - GtkWidget *path_entry = GTK_WIDGET(gtk_builder_get_object(builder, "add_path_entry")); - GtkWidget *connect_entry = GTK_WIDGET(gtk_builder_get_object(builder, "add_connect_entry")); - GtkWidget *type_combo_box = GTK_WIDGET(gtk_builder_get_object(builder, "add_type_combo_box")); - GtkWidget *manage_games_window = GTK_WIDGET(gtk_builder_get_object(builder, "manage_games_window")); - - const char *id_value = gtk_entry_get_text(GTK_ENTRY(id_entry)); - const char *path_value = gtk_entry_get_text(GTK_ENTRY(path_entry)); - const char *connect_value = gtk_entry_get_text(GTK_ENTRY(connect_entry)); - char *type_value = gtk_combo_box_get_active_text(GTK_COMBO_BOX(type_combo_box)); - - if(id_value && path_value && connect_value && type_value) - { - char *file; - char *path = path_value; - - if(strcmp(type_value, "Native game") == NULL) - { - gboolean separe = separe_path(path, &file); - if(!separe) { - purple_debug_error("gfire: gfire_add_game_cb", "Couldn't separe path and file.\n"); - return; - } - } - else { - file = path_value; - path = ""; - } - - int game_id = atoi(id_value); - char *game_name = gfire_game_name(gc, game_id); - gboolean game_check = gfire_game_playable(gc, game_id); - - if(!game_check) - { - xmlnode *gfire_launch_new = xmlnode_new("launchinfo"); - xmlnode *gfire_launch = purple_util_read_xml_from_file("gfire_launch.xml", "gfire_launch.xml"); - if(gfire_launch) - { - xmlnode *node_child; - for(node_child = xmlnode_get_child(gfire_launch, "game"); node_child != NULL; - node_child = xmlnode_get_next_twin(node_child)) { - xmlnode_insert_child(gfire_launch_new, node_child); - } + // Memory + data = xmlnode_get_child(gamerig, "memory"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Memory"), tmp); + g_free(tmp); } - - char *unix_process = ""; - char *windows_process = ""; - xmlnode *gfire_processes = purple_util_read_xml_from_file("gfire_processes.xml", "gfire_processes.xml"); - xmlnode *node_child; - - for(node_child = xmlnode_get_child(gfire_processes, "game"); node_child != NULL; - node_child = xmlnode_get_next_twin(node_child)) { - char *game_id_processes = xmlnode_get_attrib(node_child, "id"); - if(game_id == atoi(game_id_processes)) { - unix_process = xmlnode_get_attrib(node_child, "unix_process"); - windows_process = xmlnode_get_attrib(node_child, "windows_process"); - } - } - - xmlnode *game_node = gfire_manage_game_xml(id_value, game_name, type_value, file, path, - "", connect_value, "@options@ @gamemod@ @connect@", unix_process, windows_process); - if(!game_node) { - purple_debug_error("gfire: gfire_add_game_cb", "Couldn't create the new game node.\n"); + + // Video Card + data = xmlnode_get_child(gamerig, "videocard"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Video Card"), tmp); + g_free(tmp); } - else + + // Sound Card + data = xmlnode_get_child(gamerig, "soundcard"); + tmp = xmlnode_get_data(data); + if(tmp) { - xmlnode_insert_child(gfire_launch_new, game_node); - char *gfire_launch_new_str = xmlnode_to_formatted_str(gfire_launch_new, NULL); + purple_notify_user_info_add_pair(args->user_info, _("Sound Card"), tmp); + g_free(tmp); + } - gboolean write_xml = purple_util_write_data_to_file("gfire_launch.xml", gfire_launch_new_str, -1); - if(!write_xml) { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", - "Couldn't add game", "Please try again. An error occured while adding the game.", NULL, NULL); - } - else - { - gfire_reload_lconfig(gc); - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "Manage games: game added", - game_name, "The game has been successfully added.", NULL, NULL); - } - xmlnode_free(gfire_launch_new); + // Mainboard + data = xmlnode_get_child(gamerig, "mainboard"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Mainboard"), tmp); + g_free(tmp); } - } - else { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "Manage games: warning", "Game already added", - "This game is already added, you can configure it if you want.", NULL, NULL); - } - } - else { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", - "Couldn't add game", "Please try again. Make sure you fill in all fields.", NULL, NULL); - } - gtk_widget_destroy(manage_games_window); -} + // Hard Drive + data = xmlnode_get_child(gamerig, "harddrive"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Hard Drive"), tmp); + g_free(tmp); + } -/* - * Callback function editing the game in gfire_launch.xml by getting the new values from - * the manage games window. - * -*/ -static void gfire_edit_game_cb(manage_games_callback_args *args, GtkWidget *button) -{ - PurpleConnection *gc = args->gc; - GtkBuilder *builder = args->builder; - if(!gc || !builder) { - purple_debug_error("gfire: gfire_edit_game_cb", "GC not set and/or couldn't build interface.\n"); - return; - } + // Monitor + data = xmlnode_get_child(gamerig, "monitor"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Monitor"), tmp); + g_free(tmp); + } - GtkWidget *manage_games_window = GTK_WIDGET(gtk_builder_get_object(builder, "manage_games_window")); - GtkWidget *edit_path_entry = GTK_WIDGET(gtk_builder_get_object(builder, "edit_path_entry")); - GtkWidget *edit_connect_entry = GTK_WIDGET(gtk_builder_get_object(builder, "edit_connect_entry")); - GtkWidget *edit_launch_entry = GTK_WIDGET(gtk_builder_get_object(builder, "edit_launch_entry")); - GtkWidget *edit_games_combo_box = GTK_WIDGET(gtk_builder_get_object(builder, "edit_games_combo_box")); - - const gchar *edit_path = gtk_entry_get_text(GTK_ENTRY(edit_path_entry)); - const gchar *edit_connect = gtk_entry_get_text(GTK_ENTRY(edit_connect_entry)); - const gchar *edit_launch = gtk_entry_get_text(GTK_ENTRY(edit_launch_entry)); - gchar *selected_item = gtk_combo_box_get_active_text(GTK_COMBO_BOX(edit_games_combo_box)); - - if(edit_path && edit_connect && edit_launch) - { - xmlnode *gfire_launch_new = xmlnode_new("launchinfo"); - xmlnode *gfire_launch = purple_util_read_xml_from_file("gfire_launch.xml", "gfire_launch.xml"); - if(gfire_launch) - { - xmlnode *node_child; - for(node_child = xmlnode_get_child(gfire_launch, "game"); node_child != NULL; - node_child = xmlnode_get_next_twin(node_child)) - { - char *game_id = xmlnode_get_attrib(node_child, "id"); - int game_id_int = atoi(game_id); - char *game_name = gfire_game_name(gc, game_id_int); - const char *game_type = xmlnode_get_attrib(node_child, "type"); - - xmlnode *processes_node = xmlnode_get_child(node_child, "processes"); - char *unix_process = xmlnode_get_attrib(processes_node, "unix_process"); - char *windows_process = xmlnode_get_attrib(processes_node, "windows_process"); + // Keyboard + data = xmlnode_get_child(gamerig, "keyboard"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Keyboard"), tmp); + g_free(tmp); + } - if(strcmp(game_name, selected_item) == 0) - { - char *game_path = edit_path; - char *game_bin; + // Mouse + data = xmlnode_get_child(gamerig, "mouse"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Mouse"), tmp); + g_free(tmp); + } - - if(strcmp(game_type, "Native game") == 0) - { - - gboolean separe = separe_path(game_path, &game_bin); - if(!separe) { - purple_debug_error("gfire: gfire_add_game_cb", "Couldn't separe path and file.\n"); - return; - } - } - else { - game_bin = edit_path; - game_path = ""; - } + // Mouse Surface + data = xmlnode_get_child(gamerig, "mousesurface"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Mouse Surface"), tmp); + g_free(tmp); + } - xmlnode *game_node = gfire_manage_game_xml(game_id, game_name, game_type, game_bin, game_path, "", edit_connect, edit_launch, unix_process, windows_process); - xmlnode_insert_child(gfire_launch_new, game_node); - } - else { - xmlnode_insert_child(gfire_launch_new, node_child); - } + // Speakers + data = xmlnode_get_child(gamerig, "speakers"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Speakers"), tmp); + g_free(tmp); } - char *gfire_launch_new_str = xmlnode_to_formatted_str(gfire_launch_new, NULL); - gboolean write_xml = purple_util_write_data_to_file("gfire_launch.xml", gfire_launch_new_str, -1); - if(!write_xml) { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", "Couldn't edit game'", - "Please try again. An error occured while editing the game.", NULL, NULL); + // Computer Case + data = xmlnode_get_child(gamerig, "computer_case"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Computer Case"), tmp); + g_free(tmp); } - else + + // Operating System + data = xmlnode_get_child(gamerig, "operatingsystem"); + tmp = xmlnode_get_data(data); + if(tmp) { - gfire_reload_lconfig(gc); - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "Manage games: game edited", "Game edited", - "The game has been successfully edited.", NULL, NULL); + purple_notify_user_info_add_pair(args->user_info, _("Operating System"), tmp); + g_free(tmp); } - xmlnode_free(gfire_launch_new); + + xmlnode_free(gamerig); } } - else { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", - "Couldn't edit game", "Please try again. Make sure you fill in all fields.", NULL, NULL); - } - gtk_widget_destroy(manage_games_window); -} + purple_debug(PURPLE_DEBUG_MISC, "gfire", "User Info Gamerig XML Download: Download successful.\n"); -/* - * Callback function updating the label in the manage games window, depending on the game type. - * -*/ -static void gfire_manage_games_add_update_label_cb(GtkWidget *add_path_label, GtkWidget *add_type_combo_box) -{ - gchar *selected_item = gtk_combo_box_get_active_text(GTK_COMBO_BOX(add_type_combo_box)); - if(strcmp(selected_item, "Native game") == NULL) { - gtk_label_set_text(GTK_LABEL(add_path_label), "Game path:"); - } - else { - gtk_label_set_text(GTK_LABEL(add_path_label), "Game command:"); + if(args) + { + purple_notify_userinfo(args->gfire->gc, gfire_buddy_get_name(args->gf_buddy), args->user_info, NULL, NULL); + + purple_notify_user_info_destroy(args->user_info); + g_free(args); } } - -/* - * Callback function getting and showing the current values from gfire_launch.xml - * for editing the selected game in te manage games window. - * -*/ -static void gfire_manage_games_edit_update_fields_cb(GtkBuilder *builder, GtkWidget *edit_games_combo_box) +static void gfire_get_info_parse_profile_cb(PurpleUtilFetchUrlData *p_url_data, gpointer p_data, const gchar *p_buf, gsize p_len, const gchar *p_error_message) { - if(!builder) { - purple_debug_error("gfire: gfire_manage_games_edit_update_fields_cb", "Couldn't access interface.\n"); - return; + get_info_callback_args *args = (get_info_callback_args*)p_data; + + if (!args || !p_buf || !p_len) { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "User Info Profile XML Download: Download failed.\n"); + if(args) + { + purple_notify_user_info_add_section_break(args->user_info); + purple_notify_user_info_add_pair(args->user_info, _("Error"), _("Retrieving profile data failed!")); + } } + else + { + purple_notify_user_info_add_section_break(args->user_info); + xmlnode *profile = xmlnode_from_str(p_buf, p_len); + if(!profile) + { + purple_notify_user_info_add_pair(args->user_info, _("Error"), _("Invalid profile data received!")); + } + else if(xmlnode_get_child(profile, "error")) + { + gchar *tmp = xmlnode_get_data(xmlnode_get_child(profile, "error")); + purple_notify_user_info_add_pair(args->user_info, _("Profile"), NN(tmp)); + if(tmp) g_free(tmp); + xmlnode_free(profile); + } + else + { + gchar *tmp = NULL; - GtkWidget *manage_games_window = GTK_WIDGET(gtk_builder_get_object(builder, "manage_games_window")); - GtkWidget *edit_path_label = GTK_WIDGET(gtk_builder_get_object(builder, "edit_path_label")); - GtkWidget *edit_path = GTK_WIDGET(gtk_builder_get_object(builder, "edit_path_entry")); - GtkWidget *edit_connect = GTK_WIDGET(gtk_builder_get_object(builder, "edit_connect_entry")); - GtkWidget *edit_launch = GTK_WIDGET(gtk_builder_get_object(builder, "edit_launch_entry")); - gchar *selected_item = gtk_combo_box_get_active_text(GTK_COMBO_BOX(edit_games_combo_box)); - - xmlnode *gfire_launch = purple_util_read_xml_from_file("gfire_launch.xml", "gfire_launch.xml"); - if(gfire_launch) - { - xmlnode *node_child; - for(node_child = xmlnode_get_child(gfire_launch, "game"); node_child != NULL; - node_child = xmlnode_get_next_twin(node_child)) - { - const char *game = xmlnode_get_attrib(node_child, "name"); - gchar *game_name = (gchar *)game; - if(strcmp(selected_item, game_name) == NULL) - { - xmlnode *command_node = xmlnode_get_child(node_child, "command"); - xmlnode *dir_node = xmlnode_get_child(command_node, "dir"); - xmlnode *bin_node = xmlnode_get_child(command_node, "bin"); - xmlnode *connect_node = xmlnode_get_child(command_node, "connect"); - xmlnode *launch_node = xmlnode_get_child(command_node, "launch"); - - const char *path_dir = xmlnode_get_data(dir_node); - const char *path_bin = xmlnode_get_data(bin_node); - const char *game_type = xmlnode_get_attrib(node_child, "type"); - - if (!game_type || !path_bin || !path_dir) { - purple_debug_error("gfire: gfire_add_game_cb", "Could not find game type.\n"); - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", "Couldn't edit game", - "The configuration of this game is not compatible with the game manager. Please remove it and reconfigure it here.", NULL, NULL); - gtk_widget_destroy(manage_games_window); - return; - } + // Heading + gchar *escaped_alias = gfire_escape_html(gfire_buddy_get_alias(args->gf_buddy)); + tmp = g_strdup_printf(_("%ss Profile:"), escaped_alias); + g_free(escaped_alias); + purple_notify_user_info_add_pair(args->user_info, tmp, NULL); + g_free(tmp); + + // Real Name + xmlnode *data = xmlnode_get_child(profile, "realname"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Real Name"), tmp); + g_free(tmp); + } - gchar *path; - gchar *connect = xmlnode_get_data(connect_node); - gchar *launch = xmlnode_get_data(launch_node); - - if(strcmp(game_type, "Native game") == NULL) { - gtk_label_set_text(GTK_LABEL(edit_path_label), "Game path:"); - path = g_strdup_printf("%s/%s", path_dir, path_bin); - } - else { - gtk_label_set_text(GTK_LABEL(edit_path_label), "Game command:"); - path = path_bin; - } + // Age + data = xmlnode_get_child(profile, "age"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Age"), tmp); + g_free(tmp); + } - gtk_entry_set_text(GTK_ENTRY(edit_path), path); - gtk_entry_set_text(GTK_ENTRY(edit_launch), launch); - gtk_entry_set_text(GTK_ENTRY(edit_connect), connect); + // Gender + data = xmlnode_get_child(profile, "gender"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Gender"), (tmp[0] == 'm') ? _("Male") : _("Female")); + g_free(tmp); + } - xmlnode_free(command_node); + // Occupation + data = xmlnode_get_child(profile, "occupation"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Occupation"), tmp); + g_free(tmp); } - } - } -} + // Country + data = xmlnode_get_child(profile, "country"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Country"), tmp); + g_free(tmp); + } -/* - * Callback function removing the selected game from gfire_launch.xml in the manage games window. - * -*/ -static void gfire_remove_game_cb(manage_games_callback_args *args, GtkWidget *button) -{ - PurpleConnection *gc = args->gc; - GtkBuilder *builder = args->builder; - if(!gc || !builder) { - purple_debug_error("gfire", "GC not set and/or couldn't build interface.\n"); - return; - } + // Location + data = xmlnode_get_child(profile, "location"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Location"), tmp); + g_free(tmp); + } - GtkWidget *manage_games_window = GTK_WIDGET(gtk_builder_get_object(builder, "manage_games_window")); - GtkWidget *edit_games_combo_box = GTK_WIDGET(gtk_builder_get_object(builder, "edit_games_combo_box")); + // Gaming style + data = xmlnode_get_child(profile, "gaming_style"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Gaming Style"), tmp); + g_free(tmp); + } - const char *selected_game = gtk_combo_box_get_active_text(GTK_COMBO_BOX(edit_games_combo_box)); - if(selected_game) - { - xmlnode *gfire_launch_new = xmlnode_new("launchinfo"); - const xmlnode *gfire_launch = purple_util_read_xml_from_file("gfire_launch.xml", "gfire_launch.xml"); - if(gfire_launch) - { - - xmlnode *node_child = xmlnode_get_child(gfire_launch, "game"); - while (NULL != node_child) + // Interests + data = xmlnode_get_child(profile, "interests"); + tmp = xmlnode_get_data(data); + if(tmp) { - const char *game_name = xmlnode_get_attrib(node_child, "name"); - if(strcasecmp(game_name, selected_game) != 0) - xmlnode_insert_child(gfire_launch_new, node_child); - node_child = xmlnode_get_next_twin(node_child); + purple_notify_user_info_add_pair(args->user_info, _("Interests"), tmp); + g_free(tmp); } - char *gfire_launch_new_str = xmlnode_to_formatted_str(gfire_launch_new, NULL); - purple_debug_info("gfire", "XML: %s\n", gfire_launch_new_str); - gboolean write_xml = purple_util_write_data_to_file("gfire_launch.xml", gfire_launch_new_str, -1); - if(!write_xml) { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", - "Couldn't remove game", "Please try again. An error occured while removing the game.", NULL, NULL); + // Friends + data = xmlnode_get_child(profile, "friends_count"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Friends"), tmp); + g_free(tmp); } - else { - gfire_reload_lconfig(gc); - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "Manage games: game removed", - "Game removed", "The game has been successfully removed.", NULL, NULL); + + // Join Date + data = xmlnode_get_child(profile, "joindate"); + tmp = xmlnode_get_data(data); + if(tmp) + { + purple_notify_user_info_add_pair(args->user_info, _("Join Date"), tmp); + g_free(tmp); } + + xmlnode_free(profile); } } - else { - purple_notify_message(NULL, PURPLE_NOTIFY_MSG_ERROR, "Manage games: error", - "Couldn't remove game", "Please try again. Make sure you select a game to remove.", NULL, NULL); + + purple_debug(PURPLE_DEBUG_MISC, "gfire", "User Info Profile XML Download: Download successful.\n"); + + if(args) + { + // Fetch Gamerig XML Data + gchar *infoURL = g_strdup_printf(XFIRE_XML_INFO_URL, gfire_buddy_get_name(args->gf_buddy), "gamerig"); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "User Info Gamerig XML Download: Starting download from %s.\n", infoURL); + purple_util_fetch_url(infoURL, TRUE, "Purple-xfire", TRUE, gfire_get_info_parse_gamerig_cb, (void *)args); + g_free(infoURL); } - gtk_widget_destroy(manage_games_window); } +typedef struct _gfire_buddy_info_args +{ + gfire_data *gfire; + char *buddy_name; + guint timeout_source; +} gfire_buddy_info_args; -/* - * Reloads the launch config file, the difference with gfire_action_reload_gconfig_cb() - * is that this function doesn't say what happened to the user. - * - * @param gc The purple connection - * -*/ -static void gfire_reload_lconfig(PurpleConnection *gc) +static gboolean gfire_show_buddy_info_cb(gfire_buddy_info_args *p_args) { - gfire_data *gfire = NULL; - if(gc == NULL || (gfire = (gfire_data *)gc->proto_data) == NULL) { - purple_debug_error("gfire: gfire_reload_lconfig", "GC not set or found.\n"); - return; - } + if(!p_args) + return FALSE; - if(gfire->xml_launch_info != NULL) { - xmlnode_free(gfire->xml_launch_info); - } + PurpleAccount *account; + PurpleBuddy *buddy; + gfire_buddy *gf_buddy; - gfire->xml_launch_info = NULL; - gfire_parse_launchinfo_file(gc, g_build_filename(purple_user_dir(), "gfire_launch.xml", NULL)); + account = purple_connection_get_account(p_args->gfire->gc); + buddy = purple_find_buddy(account, p_args->buddy_name); - if(gfire->xml_launch_info == NULL) { - purple_debug_error("gfire: gfire_reload_lconfig", "Couldn't reload launch config.\n"); - } - else { - purple_debug_info("gfire: gfire_reload_lconfig", "Launch config successfully reloaded.\n"); + gf_buddy = gfire_find_buddy(p_args->gfire, p_args->buddy_name, GFFB_NAME); + if(!gf_buddy) + { + g_free(p_args->buddy_name); + g_free(p_args); + return FALSE; } -} - -/* - * Creates a new xmlnode containing the game information, the returned node must be inserted in the main launchinfo node. - * - * @param game_id The game ID - * @param game_name The game name - * @param game_type The game type (Native or Non-native) - * @param game_bin The game binary - * @param game_dir The game directory (to the binary) - * @param game_connect The game connection options - * @param game_launch The game launch structure - * @param unix_process The game process for Unix - * @param windows_process The game process for Windows - * - * @return the new xmlnode. - * -*/ -xmlnode *gfire_manage_game_xml(char *game_id, char *game_name, char *game_type, char *game_bin, - char *game_dir, char *game_mod, char *game_connect, char *game_launch, char *unix_process, char *windows_process) -{ - xmlnode *game_node = xmlnode_new("game"); - xmlnode_set_attrib(game_node, "id", game_id); - xmlnode_set_attrib(game_node, "name", game_name); - xmlnode_set_attrib(game_node, "type", game_type); - xmlnode *xqf_node = xmlnode_new_child(game_node, "xqf"); - xmlnode_set_attrib(xqf_node, "name", ""); - xmlnode *processes_node = xmlnode_new_child(game_node, "processes"); - xmlnode_set_attrib(processes_node, "unix_process", unix_process); - xmlnode_set_attrib(processes_node, "windows_process", windows_process); - xmlnode *command_node = xmlnode_new_child(game_node, "command"); - xmlnode *bin_node = xmlnode_new_child(command_node, "bin"); - xmlnode_insert_data(bin_node, game_bin, -1); - xmlnode *dir_node = xmlnode_new_child(command_node, "dir"); - xmlnode_insert_data(dir_node, game_dir, -1); - xmlnode *gamemod_node = xmlnode_new_child(command_node, "gamemod"); - xmlnode_insert_data(gamemod_node, game_mod, -1); - xmlnode *connect_node = xmlnode_new_child(command_node, "connect"); - xmlnode_insert_data(connect_node, game_connect, -1); - xmlnode *launch_node = xmlnode_new_child(command_node, "launch"); - xmlnode_insert_data(launch_node, game_launch, -1); + if(!gfire_buddy_got_info(gf_buddy)) + return TRUE; - return game_node; -} + g_source_remove(p_args->timeout_source); + PurpleNotifyUserInfo *user_info; + PurplePresence *p = NULL; + gchar *infoURL = NULL; + get_info_callback_args *download_args = NULL; -/* - * Extracts the path and file from the full path to a file. - * - * @param path The full path to the file - * @param file The variable (pointer) to store the file - * - * @return TRUE if the path was successfully extracted, FALSE if an error occured. - * -*/ -gboolean separe_path(char *path, char **file) -{ - char *separator = "/"; - char *str; - #ifdef IS_WINDOWS - separator = "\\"; - #endif - - if(!path) return FALSE; - - str = strrchr(path, *separator); - if(!str) return FALSE; - - *str = '\0'; - *file = str + 1; - return TRUE; -} + user_info = purple_notify_user_info_new(); + p = purple_buddy_get_presence(buddy); + // Nickname + gchar *tmp = gfire_escape_html(gfire_buddy_get_alias(gf_buddy)); + purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp); + if(tmp) g_free(tmp); -/* - * Detects running games by checking running processes. - * - * @param gc The purple connection - * - * @return TRUE (this function always returns TRUE). - * -*/ -int gfire_detect_running_games_cb(PurpleConnection *gc) -{ - gfire_data *gfire = NULL; - if(!gc || !(gfire = (gfire_data *)gc->proto_data)) { - purple_debug_error("gfire: gfire_detect_running_games_cb", "GC not set.\n"); - return FALSE; + // Status + if (purple_presence_is_online(p) == TRUE) + { + gchar *status_msg = gfire_buddy_get_status_text(gf_buddy, TRUE); + if(status_msg) + { + tmp = gfire_escape_html(status_msg); + g_free(status_msg); + purple_notify_user_info_add_pair(user_info, gfire_buddy_get_status_name(gf_buddy), tmp); + if(tmp) g_free(tmp); + } + else + purple_notify_user_info_add_pair(user_info, _("Status"), gfire_buddy_get_status_name(gf_buddy)); } + else + purple_notify_user_info_add_pair(user_info, _("Status"), _("Offline")); - gboolean norm; - norm = purple_account_get_bool(purple_connection_get_account(gc), "ingamedetectionnorm", TRUE); - if (!norm) return; - - xmlnode *gfire_launch = gfire->xml_launch_info; - if(gfire_launch) - { - xmlnode *node_child; - for(node_child = xmlnode_get_child(gfire_launch, "game"); node_child != NULL; - node_child = xmlnode_get_next_twin(node_child)) - { - const char *game_id = xmlnode_get_attrib(node_child, "id"); - xmlnode *node_child_processes = xmlnode_get_child(node_child, "processes"); - const char *game_unix_process = xmlnode_get_attrib(node_child_processes, "unix_process"); - const char *game_windows_process = xmlnode_get_attrib(node_child_processes, "windows_process"); - char *game_unix_process_tmp = game_unix_process; - char *game_windows_process_tmp = game_windows_process; - - char *delim = ";"; - char *token; - - gboolean process_running = FALSE; - #ifdef IS_WINDOWS - token = strtok(game_windows_process_tmp, delim); - while(token != NULL) { - process_running = check_process(token); - token = strtok(NULL, delim); - } - #else - token = strtok(game_unix_process_tmp, delim); - while(token != NULL) { - process_running = check_process(token); - token = strtok(NULL, delim); - } - if(!process_running) { - token = strtok(game_windows_process_tmp, delim); - while(token != NULL) { - process_running = check_process(token); - token = strtok(NULL, delim); - } - } - #endif + // Game Info + if(gfire_buddy_is_playing(gf_buddy)) + { + const gfire_game_data *game_data = gfire_buddy_get_game_data(gf_buddy); - int len = 0; - int game_running_id = gfire->gameid; - int game_id_int = atoi(game_id); - char *game_name = gfire_game_name(gc, game_id_int); - gboolean game_running = gfire->game_running; - if(process_running) - { - if(!game_running) - { - gboolean norm = purple_account_get_bool(purple_connection_get_account(gc), "ingamenotificationnorm", FALSE); - purple_debug_info("gfire: gfire_detect_running_games_cb", "%s is running. Telling Xfire ingame status.\n", game_name); - if(norm) purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "Ingame status", game_name, "Your status has been changed.", NULL, NULL); - - len = gfire_join_game_create(gc, game_id_int, 0, NULL); - if(len) gfire_send(gc, gfire->buff_out, len); - gfire->game_running = TRUE; - gfire->gameid = game_id_int; - } - } - else - { - if(game_running && game_running_id == game_id_int) - { - purple_debug(PURPLE_DEBUG_MISC, "gfire: gfire_detect_running_games_cb", "Game not running anymore, sending out of game status.\n"); - gfire->gameid = 0; - len = gfire_join_game_create(gc, 0, 0, NULL); - if(len) gfire_send(gc, gfire->buff_out, len); - gfire->game_running = FALSE; - } - } + gchar *tmp = gfire_game_name(game_data->id, TRUE); + purple_notify_user_info_add_pair(user_info, _("Game"), tmp); + if(tmp) g_free(tmp); + + if (gfire_game_data_has_addr(game_data)) + { + gchar *tmp = gfire_game_data_addr_str(game_data); + purple_notify_user_info_add_pair(user_info, _("Server"), tmp); + g_free(tmp); } } - return TRUE; -} -/* - * Makes a string lowercase. - * - * @param string String to make lowercase - * -*/ -void strlwr(char string[]) -{ - int i = 0; + // VoIP Info + if(gfire_buddy_is_talking(gf_buddy)) + { + const gfire_game_data *voip_data = gfire_buddy_get_voip_data(gf_buddy); - while(string[i]) { - string[i] = tolower(string[i]); - i++; - } + gchar *voip_name = gfire_game_name(voip_data->id, TRUE); - return; -} + if(gfire_game_data_has_addr(voip_data)) + { + gchar *tmp = gfire_game_data_addr_str(voip_data); + purple_notify_user_info_add_pair(user_info, NN(voip_name), tmp); + g_free(tmp); + } + else + purple_notify_user_info_add_pair(user_info, NN(voip_name), _("unknown")); -/* - * Checks if a process is running. - * - * @param process The process name - * - * @return TRUE if the process is running, FALSE if not or if an error occured. - * -*/ -gboolean check_process(char *process) -{ - #ifdef IS_WINDOWS - return FALSE; - #else - char command[256]; + if(voip_name) g_free(voip_name); + } - strlwr(process); - sprintf(command, "ps -ef | grep -i %s | grep -v grep", process); + // FoF common friends + if(gfire_buddy_is_friend_of_friend(gf_buddy)) + { + gchar *common_friends = gfire_buddy_get_common_buddies_str(gf_buddy); + if(common_friends) + { + gchar *escaped_cf = gfire_escape_html(common_friends); + g_free(common_friends); + purple_notify_user_info_add_pair(user_info, _("Common Friends"), escaped_cf); + g_free(escaped_cf); + } + } - char buf[256]; - int c; - int count = 0; + // Game Client Data + const GList *gcd = gfire_buddy_get_game_client_data(gf_buddy); + if(gcd) + { + purple_notify_user_info_add_section_break(user_info); + purple_notify_user_info_add_pair(user_info, _("Additional game info:"), NULL); - memset(buf, 0, sizeof(buf)); - FILE *cmd = popen(command, "r"); - while(((c = getc(cmd)) != EOF) && (count < (sizeof(buf) - 1))) { - if(c == '\n') break; - buf[count++] = c; + const GList *cur = gcd; + while(cur) + { + purple_notify_user_info_add_pair(user_info, ((game_client_data*)cur->data)->key, ((game_client_data*)cur->data)->value); + cur = g_list_next(cur); + } } - pclose(cmd); - - if(strcmp(buf, "") == 0) return FALSE; - else return TRUE; - #endif -} -#endif -static void gfire_action_reload_lconfig_cb(PurplePluginAction *action) -{ - PurpleConnection *gc = (PurpleConnection *) action->context; - gfire_data *gfire = NULL; + // Clans + GList *clan_info = gfire_buddy_get_clans_info(gf_buddy); + if(clan_info) + { + purple_notify_user_info_add_section_break(user_info); + gchar *escaped_alias = gfire_escape_html(gfire_buddy_get_alias(gf_buddy)); + tmp = g_strdup_printf(_("%ss Clans:"), escaped_alias); + g_free(escaped_alias); + purple_notify_user_info_add_pair(user_info, tmp, NULL); + g_free(tmp); - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; + GList *cur = clan_info; + while(cur) + { + tmp = gfire_clan_get_name((gfire_clan*)cur->data); + gchar *clan_name = gfire_escape_html(tmp); + g_free(tmp); + const gchar *clan_shortname = gfire_clan_get_short_name((gfire_clan*)cur->data); + cur = g_list_next(cur); - if (NULL != gfire->xml_launch_info) xmlnode_free(gfire->xml_launch_info); - gfire->xml_launch_info = NULL; - gfire_parse_launchinfo_file(gc, g_build_filename(purple_user_dir(), "gfire_launch.xml", NULL)); + if(cur->data) + { + escaped_alias = gfire_escape_html((gchar*)cur->data); + g_free(cur->data); + tmp = g_strdup_printf("%s: %s", clan_shortname, clan_name, escaped_alias); + g_free(escaped_alias); + } + else + tmp = g_strdup_printf("%s", clan_shortname, clan_name); - if (NULL == gfire->xml_launch_info) { - purple_notify_message((void *)_gfire_plugin, PURPLE_NOTIFY_MSG_ERROR, "Gfire XML Reload", "Reloading gfire_launch.xml", "Operation failed. File not found or content was incorrect.", NULL, NULL); - } else { - purple_notify_message((void *)_gfire_plugin, PURPLE_NOTIFY_MSG_INFO, "Gfire XML Reload", "Reloading gfire_launch.xml","Reloading was successful.", NULL, NULL); + purple_notify_user_info_add_pair(user_info, NULL, tmp); + g_free(tmp); + g_free(clan_name); + cur = g_list_next(cur); + } + g_list_free(clan_info); } + // Fetch Profile XML data + download_args = g_malloc0(sizeof(get_info_callback_args)); + download_args->gfire = p_args->gfire; + download_args->user_info = user_info; + download_args->gf_buddy = gf_buddy; + + infoURL = g_strdup_printf(XFIRE_XML_INFO_URL, gfire_buddy_get_name(gf_buddy), "profile"); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "User Info Profile XML Download: Starting download from %s.\n", infoURL); + purple_util_fetch_url(infoURL, TRUE, "Purple-xfire", TRUE, gfire_get_info_parse_profile_cb, (void *)download_args); + g_free(infoURL); + + g_free(p_args->buddy_name); + g_free(p_args); + + return FALSE; } -static void gfire_action_reload_gconfig_cb(PurplePluginAction *action) +void gfire_show_buddy_info(gfire_data *p_gfire, const gchar *p_name) { - PurpleConnection *gc = (PurpleConnection *) action->context; - gfire_data *gfire = NULL; + if(!p_gfire || !p_name) + return; - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; + PurpleAccount *account; + PurpleBuddy *buddy; + gfire_buddy *gf_buddy; - if (NULL != gfire->xml_games_list) xmlnode_free(gfire->xml_games_list); - gfire->xml_games_list = NULL; - gfire_parse_games_file(gc, g_build_filename(purple_user_dir(), "gfire_games.xml", NULL)); + account = purple_connection_get_account(p_gfire->gc); + buddy = purple_find_buddy(account, p_name); - if (NULL == gfire->xml_games_list) { - purple_notify_message((void *)_gfire_plugin, PURPLE_NOTIFY_MSG_ERROR, "Gfire XML Reload", "Reloading gfire_games.xml", "Operation failed. File not found or content was incorrect.", NULL, NULL); - } else { -purple_notify_message((void *)_gfire_plugin, PURPLE_NOTIFY_MSG_INFO, "Gfire XML Reload", "Reloading gfire_games.xml","Reloading was successful.", NULL, NULL); - } -} + gf_buddy = gfire_find_buddy(p_gfire, p_name, GFFB_NAME); + if(!gf_buddy) return; -static void gfire_action_website_cb() { - purple_notify_uri((void *)_gfire_plugin, GFIRE_WEBSITE); -} + gfire_buddy_request_info(gf_buddy); + + gfire_buddy_info_args *cb_args = g_malloc0(sizeof(gfire_buddy_info_args)); + cb_args->gfire = p_gfire; + cb_args->buddy_name = g_strdup(p_name); -static void gfire_action_wiki_cb() { - purple_notify_uri((void *)_gfire_plugin, GFIRE_WIKI); + cb_args->timeout_source = g_timeout_add_seconds(1, (GSourceFunc)gfire_show_buddy_info_cb, cb_args); } -static void gfire_action_about_cb(PurplePluginAction *action) +void gfire_keep_alive(gfire_data *p_gfire) { - PurpleConnection *gc = (PurpleConnection *) action->context; - char *msg = NULL; + if(!p_gfire) + return; - if(strcmp(gfire_game_name(gc, 100), "100")) { - msg = g_strdup_printf("Gfire Version:\t\t%s\nGame List Version:\t%s", GFIRE_VERSION, gfire_game_name(gc, 100)); - } - else { - msg = g_strdup_printf("Gfire Version: %s", GFIRE_VERSION); + GTimeVal gtv; + g_get_current_time(>v); + + if((gtv.tv_sec - p_gfire->last_pong) > XFIRE_TIMEOUT_TIME) + { + purple_connection_error_reason(gfire_get_connection(p_gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Connection timed out")); + return; } - purple_request_action(gc, "About Gfire", "Xfire Plugin for Pidgin", msg, PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), NULL, NULL, gc, 3, "Close", NULL, - "Website", G_CALLBACK(gfire_action_website_cb), - "Wiki", G_CALLBACK(gfire_action_wiki_cb)); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "sending keep_alive packet (PING)\n"); + guint16 packet_len = gfire_proto_create_keep_alive(); + if(packet_len > 0) gfire_send(gfire_get_connection(p_gfire), packet_len); } - -static void gfire_action_get_gconfig_cb(PurplePluginAction *action) +void gfire_keep_alive_response(gfire_data *p_gfire) { - PurpleConnection *gc = (PurpleConnection *) action->context; - gfire_data *gfire = NULL; - const char *filename = g_build_filename(purple_user_dir(), "gfire_games.xml", NULL); - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; + if(!p_gfire) + return; - purple_util_fetch_url(GFIRE_GAMES_XML_URL, TRUE, "Purple-xfire", TRUE, gfire_xml_download_cb, (void *)gc); + GTimeVal gtv; + g_get_current_time(>v); - if (NULL != gfire->xml_games_list) xmlnode_free(gfire->xml_games_list); - gfire->xml_games_list = NULL; - gfire_parse_games_file(gc, filename); + p_gfire->last_pong = gtv.tv_sec; } -static void gfire_action_profile_page_cb(PurplePluginAction *action) +gfire_chat *gfire_find_chat(gfire_data *p_gfire, const void *p_data, gfire_find_chat_mode p_mode) { - PurpleConnection *gc = (PurpleConnection *) action->context; - PurpleAccount *a = purple_connection_get_account(gc); - if (!a || !(a->username)) return; + if(!p_gfire || !p_data) + return NULL; + + GList *chat = p_gfire->chats; - char uri[256] = ""; - g_sprintf(uri, "%s%s", XFIRE_PROFILE_URL, a->username); - purple_notify_uri((void *)_gfire_plugin, uri); + for(; chat; chat = g_list_next(chat)) + { + gfire_chat *c = (gfire_chat*)chat->data; + switch(p_mode) + { + case GFFC_CID: + if(gfire_chat_is_by_chat_id(c, p_data)) + return c; + break; + case GFFC_TOPIC: + if(gfire_chat_is_by_topic(c, p_data)) + return c; + break; + case GFFC_PURPLEID: + if(gfire_chat_is_by_purple_id(c, *(int*)p_data)) + return c; + break; + case GFFC_PURPLECHAT: + if(gfire_chat_is_by_purple_chat(c, p_data)) + return c; + break; + } + } + + return NULL; } -static GList *gfire_actions(PurplePlugin *plugin, gpointer context) +void gfire_add_chat(gfire_data *p_gfire, gfire_chat *p_chat) { - GList *m = NULL; - PurplePluginAction *act; + if(!p_gfire || !p_chat) + return; - act = purple_plugin_action_new("Change Nickname", - gfire_action_nick_change_cb); - m = g_list_append(m, act); - act = purple_plugin_action_new("My Profile Page", - gfire_action_profile_page_cb); - m = g_list_append(m, act); - m = g_list_append(m, NULL); - act = purple_plugin_action_new("Reload Launch Config", - gfire_action_reload_lconfig_cb); - m = g_list_append(m, act); - act = purple_plugin_action_new("Reload Game ID List", - gfire_action_reload_gconfig_cb); - m = g_list_append(m, act); - act = purple_plugin_action_new("Get Game ID List", - gfire_action_get_gconfig_cb); - m = g_list_append(m, act); - #ifdef IS_NOT_WINDOWS - act = purple_plugin_action_new("Manage Games", - gfire_action_manage_games_cb); - m = g_list_append(m, act); - #endif - m = g_list_append(m, NULL); - act = purple_plugin_action_new("About", - gfire_action_about_cb); - m = g_list_append(m, act); - return m; + p_chat->purple_id = p_gfire->chat; + p_gfire->chat++; + p_gfire->chats = g_list_append(p_gfire->chats, p_chat); } +void gfire_leave_chat(gfire_data *p_gfire, gfire_chat *p_chat) +{ + if(!p_gfire || !p_chat) + return; - /** - * Joins a game in progress with buddy. spawns process, puts us in game with xfire - * and adds a gsource watch on the child process so when it exits we can take - * ourselves out of game. - * - * @param gc pointer to our PurpleConnection for sending network traffic. - * @param sip server ip (quad dotted notation) of where the game is - * @param sport server port of where the game is located - * @param game the xfire game ID to join (looked up in launch options) - * - * asking to join a game that is not playable (not configured through launch options - * or any other reason for an unplayable game is not defined. You must check - * the game playability with gfire_game_playable() - * - * @see gfire_game_playable - */ + GList *cur = g_list_find(p_gfire->chats, p_chat); + if(!cur) + return; - void gfire_join_game(PurpleConnection *gc, const gchar *sip, int sport, int game) - { - /* test stuff */ - int len = 0; - gfire_linfo *linfo =NULL; - gchar *command = NULL; - char **argvp; - int argcp = 0; - gboolean worked = FALSE; - GPid pid; - GError *gerr; - gfire_data *gfire = NULL; - const gchar nullip[4] = {0x00, 0x00, 0x00, 0x00}; - gboolean sworked = FALSE; - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; + gfire_chat_leave(p_chat); + gfire_chat_free(p_chat); + p_gfire->chats = g_list_delete_link(p_gfire->chats, cur); +} - linfo = gfire_linfo_get(gc, game); - if (!linfo) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "Launch info struct not defined!\n"); - return; - } - if (!sip) sip = (char *)&nullip; - command = gfire_linfo_get_cmd(linfo, (guint8 *)sip, sport, NULL); - gerr = 0; - worked=sworked=g_shell_parse_argv(command, &argcp, &argvp, &gerr); - if (worked) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Attempting to join game %d, on server %d.%d.%d.%d , at port %d\n", - game, NNA(sip, sip[3]), NNA(sip, sip[2]), NNA(sip, sip[1]), NNA(sip, sip[0]), sport); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "launch xml command parsed to:\n"); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "%s\n", NN(command)); - gerr = 0; - worked = g_spawn_async(linfo->c_wdir, argvp, NULL, - (GSpawnFlags)G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, &pid, &gerr); - } - if (!worked) { - /* something went wrong! */ - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "Launch failed, message: %s\n", NN(gerr->message)); - g_free(command); - if (sworked) { - g_strfreev(argvp); - } - g_error_free (gerr); +void gfire_set_nick(gfire_data *p_gfire, const gchar *p_nick) +{ + if(!p_gfire || !p_nick) return; - } - /* program seems to be running! */ - gfire->gameid = game; - len = gfire_join_game_create(gc, game, sport, sip); - if (len) { - gfire_send(gc, gfire->buff_out, len); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(game join): telling xfire our game info\n"); - } - /* need to watch pid so we can get out of game when game closes */ - g_child_watch_add(pid, (GChildWatchFunc)gfire_game_watch_cb, (gpointer *)gc); - g_free(command); - g_strfreev(argvp); -// g_free(sip); + purple_debug(PURPLE_DEBUG_INFO, "gfire", "Changing server nick (alias) to \"%s\"\n", p_nick); + guint16 packet_len = gfire_proto_create_change_alias(p_nick); + if(packet_len > 0) gfire_send(gfire_get_connection(p_gfire), packet_len); +} +gboolean gfire_has_p2p(const gfire_data *p_gfire) +{ + return gfire_p2p_connection_running(p_gfire->p2p); } +gfire_p2p_connection *gfire_get_p2p(const gfire_data *p_gfire) +{ + if(p_gfire && gfire_p2p_connection_running(p_gfire->p2p)) + return p_gfire->p2p; + else + return NULL; +} - /** - * GSource watch pid callback for glib. This function waits for a join game - * PID to exit. This tells gfire to remove user out of game when the user - * quits the game. This function is not called directly but by glib. The - * function prototype is set by glib. This function does not return anything - * - * @param pid Integer PID of the process to watch (wait for to die) - * @param status status of exiting pid - * @param data Pointer to data passed in by setup function - * - */ -void gfire_game_watch_cb(GPid pid, int status, gpointer *data) +void gfire_set_game_status(gfire_data *p_gfire, const gfire_game_data *p_data) { - /* were now out of game, clean up pid send network message */ + if(!p_gfire || !p_data) + return; - int len = 0; - PurpleConnection *gc = (PurpleConnection *)data; - gfire_data *gfire = NULL; + gboolean notify = purple_account_get_bool(purple_connection_get_account(p_gfire->gc), + "ingamenotificationnorm", FALSE); + if (notify) + { + gchar *game_name = gfire_game_name(p_data->id, TRUE); + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("Ingame status"), + NN(game_name), _("Your status has been changed."), NULL, NULL); + g_free(game_name); + } - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(game_watch_cb): Child has exited, reaping pid.\n"); - g_spawn_close_pid(pid); - /* we could have been disconnected */ - if ( PURPLE_CONNECTION_IS_VALID(gc) && PURPLE_CONNECTION_IS_CONNECTED(gc) ) { - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; +#ifdef HAVE_GTK + if(p_data->id && p_data->ip.value) + gfire_server_browser_add_recent(p_gfire->server_browser, p_data->id, p_data->ip.value, p_data->port); +#endif // HAVE_GTK - len = gfire_join_game_create(gc, 0, 0, NULL); - if (len) gfire_send(gc, gfire->buff_out, len); - gfire->gameid = 0; - } + guint16 len = gfire_proto_create_join_game(p_data); + if(len > 0) gfire_send(p_gfire->gc, len); } +void gfire_set_voip_status(gfire_data *p_gfire, const gfire_game_data *p_data) +{ + if(!p_gfire || !p_data) + return; -/** - * g_timeout_add callback function to watch for $HOME/.purple/ingame.tmp - * file. If this file is found we send join_game data to xfire network - * if we are in game and then the file is no longer present then take - * client out of game. Only do this when in game status was met using - * ingame.tmp file. The ingame.tmp file is a copied LaunchInfo.txt file - * from XQF. The user must create a script to copy this file and then - * remove it once the game is quit. We match the contents of the XQF - * file against our launch.xml. Find the game and then send the network - * message. This function is not called directy. It is called by glib. - * - * @param gc pointer to purple connection struct for this connection - * - * @return returns TRUE always, except if gc connection state - * is set to disconnected. -**/ -int gfire_check_xqf_cb(PurpleConnection *gc) -{ - - static char *filename = NULL; - static gboolean found = FALSE; - gfire_xqf_linfo *xqfs = NULL; - int len = 0; - int game = 0; - gfire_data *gfire = NULL; - char *ipbin = NULL; - char *game_name = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return FALSE; - - if (purple_connection_get_state(gc) != PURPLE_DISCONNECTED) { - if ((0 != gfire->gameid) && !found) return TRUE; - if (!filename) { - filename = g_build_filename(purple_user_dir(), GFIRE_XQF_FILENAME, NULL); - } - if (g_file_test(filename, G_FILE_TEST_EXISTS)){ - if (found) return TRUE; - /* file was found, but not previously */ - found = TRUE; - xqfs = gfire_linfo_parse_xqf(filename); - if (!xqfs) return TRUE; - game = gfire_xqf_search(gc, xqfs); - if (!game) { - purple_debug(PURPLE_DEBUG_WARNING, "gfire", "(XQF cb): parsed ingame.tmp. No game match found.\n"); - gfire_xqf_linfo_free(xqfs); - return TRUE; - } - - game_name = gfire_game_name(gc, game); - - gboolean norm = purple_account_get_bool(purple_connection_get_account(gc), "ingamenotificationnorm", FALSE); - if (norm) purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, "Ingame status", - game_name, "Your status has been changed.", NULL, NULL); - - /* turn ip string into ip binary string in xfire format */ - ipbin = gfire_ipstr_to_bin(xqfs->ip); - len = gfire_join_game_create(gc, game, xqfs->port, ipbin); - if (len) gfire_send(gc, gfire->buff_out, len); - g_free(ipbin); - gfire->gameid = game; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(XQF cb): Detected game join (%d) at (%s:%d)\n", game, - NN(xqfs->ip), xqfs->port ); - gfire_xqf_linfo_free(xqfs); - } else { - if (!found) return TRUE; - if (gfire->gameid) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(XQF cb): Status file removed, sending out of game msg\n"); - gfire->gameid = 0; - len = gfire_join_game_create(gc, 0, 0, NULL); - if (len) gfire_send(gc, gfire->buff_out, len); - } - found = FALSE; - } - return TRUE; - } - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(XQF cb): Still running but GC says not connected!\n"); - return FALSE; -} - - - -char *gfire_escape_html(const char *html) -{ - char *escaped = NULL; - - if (html != NULL) { - const char *c = html; - GString *ret = g_string_new(""); - while (*c) { - if (!strncmp(c, "&", 1)) { - ret = g_string_append(ret, "&"); - c += 1; - } else if (!strncmp(c, "<", 1)) { - ret = g_string_append(ret, "<"); - c += 1; - } else if (!strncmp(c, ">", 1)) { - ret = g_string_append(ret, ">"); - c += 1; - } else if (!strncmp(c, "\"", 1)) { - ret = g_string_append(ret, """); - c += 1; - } else if (!strncmp(c, "'", 1)) { - ret = g_string_append(ret, "'"); - c += 1; - } else if (!strncmp(c, "\n", 1)) { - ret = g_string_append(ret, "
"); - c += 1; - } else { - ret = g_string_append_c(ret, c[0]); - c++; - } - } - - escaped = ret->str; - g_string_free(ret, FALSE); - } - return escaped; + guint16 len = gfire_proto_create_join_voip(p_data); + if(len > 0) gfire_send(p_gfire->gc, len); } +#ifdef HAVE_GTK +void gfire_show_server_browser(PurplePluginAction *p_action) +{ + PurpleConnection *gc = (PurpleConnection*)p_action->context; + gfire_data *gfire = (gfire_data*)gc->proto_data; + if(!gfire || !gfire->server_browser) + return; -/* - * Plugin Initialization section -*/ -static PurplePluginProtocolInfo prpl_info = -{ + gfire_server_browser_show(gfire->server_browser); +} +#endif // HAVE_GTK - OPT_PROTO_CHAT_TOPIC, /* Protocol options */ - NULL, /* user_splits */ - NULL, /* protocol_options */ - NO_BUDDY_ICONS, /* icon_spec */ - gfire_blist_icon, /* list_icon */ - gfire_blist_emblems, /* list_emblems */ - gfire_status_text, /* status_text */ - gfire_blist_tooltip_text, /* tooltip_text */ - gfire_status_types, /* away_states */ - gfire_node_menu, /* blist_node_menu */ - gfire_chat_info, /* chat_info */ - gfire_chat_info_defaults, /* chat_info_defaults */ - gfire_login, /* login */ - gfire_close, /* close */ - gfire_im_send, /* send_im */ - NULL, /* set_info */ - gfire_send_typing, /* send_typing */ - gfire_get_info, /* get_info */ - gfire_set_status, /* set_status */ - NULL, /* set_idle */ - NULL, /* change_passwd */ - gfire_add_buddy, /* add_buddy */ - NULL, /* add_buddies */ - gfire_remove_buddy, /* remove_buddy */ - NULL, /* remove_buddies */ - NULL, /* add_permit */ - NULL, /* add_deny */ - NULL, /* rem_permit */ - NULL, /* rem_deny */ - NULL, /* set_permit_deny */ - gfire_join_chat, /* join_chat */ - gfire_reject_chat, /* reject chat invite */ - gfire_get_chat_name, /* get_chat_name */ - gfire_chat_invite, /* chat_invite */ - gfire_chat_leave, /* chat_leave */ - NULL, /* chat_whisper */ - gfire_chat_send, /* chat_send */ - gfire_keep_alive, /* keepalive */ - NULL, /* register_user */ - NULL, /* get_cb_info */ - NULL, /* get_cb_away */ - NULL, /* alias_buddy */ - NULL, /* group_buddy */ - NULL, /* rename_group */ - NULL, /* buddy_free */ - NULL, /* convo_closed */ - purple_normalize_nocase, /* normalize */ - NULL, /* set_buddy_icon */ - NULL, /* remove_group */ - NULL, /* get_cb_real_name */ - gfire_chat_change_motd, /* set_chat_topic */ - NULL, /* find_blist_chat */ - NULL, /* roomlist_get_list */ - NULL, /* roomlist_cancel */ - NULL, /* roomlist_expand_category */ - NULL, /* can_receive_file */ - NULL, /* send_file */ - NULL, /* new_xfer */ - NULL, /* offline_message */ - NULL, /* whiteboard_prpl_ops */ - NULL, /* send_raw */ - NULL, /* roomlist_room_serialize */ - NULL, /* unregister_user */ - NULL, /* send_attention */ - NULL, /* attention_types */ - - /* padding */ - NULL, - NULL -}; - - -static PurplePluginInfo info = -{ - PURPLE_PLUGIN_MAGIC, - PURPLE_MAJOR_VERSION, - PURPLE_MINOR_VERSION, - PURPLE_PLUGIN_PROTOCOL, /**< type */ - NULL, /**< ui_requirement */ - 0, /**< flags */ - NULL, /**< dependencies */ - PURPLE_PRIORITY_DEFAULT, /**< priority */ - "prpl-xfire", /**< id */ - "Xfire", /**< name */ - GFIRE_VERSION, /**< version */ - "Xfire Protocol Plugin", /** summary */ - "Xfire Protocol Plugin", /** description */ - NULL, /**< author */ - GFIRE_WEBSITE, /**< homepage */ - NULL, /**< load */ - NULL, /**< unload */ - NULL, /**< destroy */ - NULL, /**< ui_info */ - &prpl_info, /**< extra_info */ - NULL, /**< prefs_info */ - gfire_actions, - - /* padding */ - NULL, - NULL, - NULL, - NULL -}; - -static void _init_plugin(PurplePlugin *plugin) -{ - PurpleAccountOption *option; - - option = purple_account_option_string_new("Server", "server",XFIRE_SERVER); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); - - option = purple_account_option_int_new("Port", "port", XFIRE_PORT); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); - - option = purple_account_option_int_new("Version", "version", XFIRE_PROTO_VERSION); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); - - option = purple_account_option_bool_new("Don't delete buddies from server", - "buddynorm", TRUE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); - - option = purple_account_option_bool_new("Buddies can see if I'm typing", - "typenorm", TRUE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); - - #ifdef IS_NOT_WINDOWS - option = purple_account_option_bool_new("Auto detect for ingame status", - "ingamedetectionnorm", TRUE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); - #endif - - option = purple_account_option_bool_new("Notifiy me when my status is ingame", - "ingamenotificationnorm", FALSE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); +void gfire_got_preferences(gfire_data *p_gfire) +{ + if(!p_gfire) + return; + gboolean fofs = gfire_preferences_get(p_gfire->prefs, 0x08); - _gfire_plugin = plugin; + if(purple_account_get_bool(purple_connection_get_account(p_gfire->gc), "show_fofs", TRUE) != fofs) + { + gfire_preferences_set(p_gfire->prefs, 0x08, purple_account_get_bool(purple_connection_get_account(p_gfire->gc), "show_fofs", TRUE)); + gfire_preferences_send(p_gfire->prefs, p_gfire->gc); + } } -PURPLE_INIT_PLUGIN(gfire, _init_plugin, info); - +gboolean gfire_wants_fofs(const gfire_data *p_gfire) +{ + return (p_gfire && p_gfire->gc && purple_account_get_bool(purple_connection_get_account(p_gfire->gc), + "show_fofs", TRUE)); +} +gboolean gfire_wants_server_detection(const gfire_data *p_gfire) +{ + return (p_gfire && p_gfire->gc && purple_account_get_bool(purple_connection_get_account(p_gfire->gc), + "server_detection_option", FALSE)); +} +gboolean gfire_wants_global_status_change(const gfire_data *p_gfire) +{ + return (p_gfire && p_gfire->gc && purple_account_get_bool(purple_connection_get_account(p_gfire->gc), + "use_global_status", TRUE)); +} diff -Nru gfire-0.8.3/src/gfire.h gfire-0.9.4/src/gfire.h --- gfire-0.8.3/src/gfire.h 2009-08-19 15:41:46.000000000 +0000 +++ gfire-0.9.4/src/gfire.h 2011-03-14 20:19:23.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -23,180 +22,181 @@ #ifndef _GFIRE_H #define _GFIRE_H -#ifdef HAVE_CONFIG_H -# include -#endif - -#define PURPLE_PLUGINS - -#include -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 -#define IS_WINDOWS -#else -#define IS_NOT_WINDOWS -#include -#include -#include -#include -#include -#endif /* _WIN32 */ - -#ifndef G_GNUC_NULL_TERMINATED -# if __GNUC__ >= 4 -# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) -# else -# define G_GNUC_NULL_TERMINATED -# endif /* __GNUC__ >= 4 */ -#endif /* G_GNUC_NULL_TERMINATED */ - -#include "util.h" -#include "server.h" -#include "notify.h" -#include "plugin.h" -#include "account.h" -#include "accountopt.h" -#include "blist.h" -#include "conversation.h" -#include "debug.h" -#include "prpl.h" -#include "proxy.h" -#include "util.h" -#include "version.h" -#include "request.h" - -#include "xmlnode.h" -#include "gf_debug.h" - -#define GFIRE_WEBSITE "http://gfireproject.org" -#define GFIRE_WIKI "http://my-trac.assembla.com/gfire/wiki" -#define GFIRE_XQF_FILENAME "ingame.tmp" -#define GFIRE_DEFAULT_GROUP_NAME "Xfire" -#define GFIRE_VERSION "0.8.3" -#define GFIRE_GAMES_XML_URL "http://gfireproject.org/files/gfire_games.xml" -#define XFIRE_HEADER_LEN 5 -#define XFIRE_USERID_LEN 4 -#define XFIRE_SID_LEN 16 -#define XFIRE_GAMEID_LEN 4 -#define XFIRE_GAMEPORT_LEN 4 -#define XFIRE_GAMEIP_LEN 4 -#define XFIRE_CHATID_LEN 21 -#define XFIRE_SERVER "cs.xfire.com" -#define XFIRE_PORT 25999 -#define XFIRE_PROTO_VERSION 113 -#define XFIRE_CONNECT_STEPS 3 -#define XFIRE_SID_OFFLINE_STR "00000000000000000000000000000000" -#define XFIRE_KEEPALIVE_TIME 300 // see gfire_keep_alive for more info -#define XFIRE_PROFILE_URL "http://www.xfire.com/profile/" -#define XFIRE_SEND_TYPING_TIMEOUT 10 - - -typedef struct _gfire_data gfire_data; -typedef struct _gfire_buddy gfire_buddy; -typedef struct _gfire_im gfire_im; -typedef struct _gfire_c_msg gfire_chat_msg; -typedef struct _manage_games_callback_args manage_games_callback_args; -typedef struct _path_extracted path_extracted; - - -struct _gfire_data { - int fd; - int chat; - gchar *email; - guint8 *buff_out; +// Required prototypes +typedef struct _gfire_data gfire_data; + +#include "gf_base.h" + +#include "gf_buddies.h" +#include "gf_chat.h" +#include "gf_games.h" +#include "gf_p2p.h" +#include "gf_groups.h" +#include "gf_preferences.h" + +#ifdef HAVE_GTK +# include "gf_server_browser.h" +#endif // HAVE_GTK + +// gfire_find_buddy modes +typedef enum _gfire_find_buddy_mode +{ + GFFB_NAME = 0, // by name, pass pointer to string + GFFB_ALIAS, // by alias, pass pointer to string + GFFB_USERID, // by userid, pass pointer to uid + GFFB_SID // by sid, pass pointer to sid array +} gfire_find_buddy_mode; + +typedef enum _gfire_find_chat_mode +{ + GFFC_CID = 0, // by chat ID + GFFC_TOPIC, // by topic + GFFC_PURPLEID, // by purple ID + GFFC_PURPLECHAT, // by PurpleChat +} gfire_find_chat_mode; + +typedef enum _gfire_find_group_mode +{ + GFFG_GID = 0, // by group ID + GFFG_PURPLE, // by PurpleGroup + GFFG_NAME, // by group name + GFFG_BUDDY // by buddy +} gfire_find_group_mode; + +//typedef struct _gfire_chat_msg +//{ +// guint8 *chat_id; /* xfire chat ID of group chat */ +// guint32 uid; /* userid of user posting the message */ +// gchar *im_str; /* im text */ +// gfire_buddy *b; /* for users joining the chat */ +//} gfire_chat_msg; + +struct _gfire_data +{ + // Networking + int fd; guint8 *buff_in; guint16 bytes_read; - GList *buddies; - GList *chats; /* glist of _gfire_chat structs */ - gfire_im *im; /* im struct, filled when we have an im to proccess */ - gboolean away; - xmlnode *xml_games_list; - xmlnode *xml_launch_info; - gulong last_packet; /* time (in seconds) of our last packet */ - guint8 *userid; /* our userid on the xfire network */ - guint8 *sid; /* our session id for this connection */ - gchar *alias; /* our current server alias */ - guint32 gameid; /* our current game id */ - guint xqf_source; /* g_timeout_add source number for xqf callback */ - guint det_source; /* g_timeout_add source number for game detection callback */ - gboolean game_running; /* bool to know if a game has already been detected */ -}; + glong last_pong; + PurpleConnection *gc; -struct _gfire_buddy { - gboolean away; /* TRUE == buddy is away */ - gchar *away_msg; /* pointer to away message, null if not away */ - guint32 im; /* im index ++'d on each im reception and and send */ - gchar *name; /* name (xfire login id) */ - gchar *alias; /* nick (xfire alias) */ - guint8 *userid; /* xfire user id binary */ - gchar *uid_str; /* xfire user id (string format hex) 8 chars + 1 0x00 */ - guint8 *sid; /* sid binary form, length = XFIRE_SID_LEN */ - gchar *sid_str; /* sid string representation */ - guint32 gameid; /* int game id */ - guint32 gameport; /* int game port */ - guint8 *gameip; /* char[4] game port, each byte is an octet */ - gchar *avatartype; - guint16 *avatarnumber; - int chatperm; /* group chat permissions (only used for group chat members)*/ + // Xfire session + guint32 userid; /* our userid on the xfire network */ + guint8 *sid; /* our session id for this connection */ + gchar *alias; /* our current server alias */ -}; + // P2P Connection + gfire_p2p_connection *p2p; -struct _gfire_im { - guint32 type; /* msgtype 0 = im, 1 = ack packet, 2 = p2p info, 3 = typing info */ - guint8 peer; /* peermsg from packet */ - guint32 index; /* im index for this conversation */ - gchar *sid_str; /* sid (string format) of buddy that this im belongs to */ - gchar *im_str; /* im text */ -}; - -struct _gfire_c_msg { - guint8 *chat_id; /* xfire chat ID of group chat */ - guint8 *uid; /* userid of user posting the message */ - gchar *im_str; /* im text */ - gfire_buddy *b; /* for users joining the chat */ -}; + // Buddies + GList *buddies; + GList *clans; + GList *groups; -#ifdef IS_NOT_WINDOWS -struct _manage_games_callback_args { - PurpleConnection *gc; - GtkBuilder *builder; -}; + guint32 chat; + gchar *email; -struct _path_extracted { - char *path; - char *file; -}; -#endif + GList *chats; /* glist of _gfire_chat structs */ +#ifdef HAVE_GTK + // Server browser + gfire_server_browser *server_browser; +#endif // HAVE_GTK + + // Client preferences + gfire_preferences *prefs; +}; + +typedef struct _invitation_callback_args +{ + gfire_data *gfire; + gchar *name; +} invitation_callback_args; + +typedef struct _get_info_callback_args +{ + gfire_data *gfire; + PurpleNotifyUserInfo *user_info; + gfire_buddy *gf_buddy; +} get_info_callback_args; + + +// Creation and freeing +gfire_data *gfire_create(PurpleConnection *p_gc); +void gfire_free(gfire_data *p_gfire); + +// Connection +PurpleConnection *gfire_get_connection(const gfire_data *p_gfire); +void gfire_login(gfire_data *p_gfire); +void gfire_close(gfire_data *p_gfire); +void gfire_authenticate(gfire_data *p_gfire, const gchar *p_salt); +void gfire_login_successful(gfire_data *p_gfire); +void gfire_keep_alive(gfire_data *p_gfire); +void gfire_keep_alive_response(gfire_data *p_gfire); + +// Session +void gfire_set_userid(gfire_data *p_gfire, guint32 p_userid); +void gfire_set_sid(gfire_data *p_gfire, guint8 *p_sid); + +// Buddy handling +gfire_buddy *gfire_find_buddy(gfire_data *p_gfire, const void *p_data, gfire_find_buddy_mode p_mode); +void gfire_add_buddy(gfire_data *p_gfire, gfire_buddy *p_buddy, gfire_group *p_group); +void gfire_remove_buddy(gfire_data *p_gfire, gfire_buddy *p_buddy, gboolean p_fromServer, gboolean p_force); +void gfire_got_invitation(gfire_data *p_gfire, const gchar *p_name, const gchar *p_alias, const gchar *p_msg); +void gfire_show_buddy_info(gfire_data *p_gfire, const gchar *p_name); + +// Clan handling +gfire_clan *gfire_find_clan(gfire_data *p_gfire, guint32 p_clanid); +void gfire_add_clan(gfire_data *p_gfire, gfire_clan *p_clan); +void gfire_remove_clan(gfire_data *p_gfire, gfire_clan *p_clan); +void gfire_leave_clan(gfire_data *p_gfire, guint32 p_clanid); +void gfire_remove_buddy_from_clan(gfire_data *p_gfire, gfire_buddy *p_buddy, guint32 p_clanid); + +// Group handling +gfire_group *gfire_find_group(gfire_data *p_gfire, const void *p_data, gfire_find_group_mode p_mode); +void gfire_add_group(gfire_data *p_gfire, gfire_group *p_group); +void gfire_remove_group(gfire_data *p_gfire, gfire_group *p_group, gboolean p_remove); + +// Chat handling +gfire_chat *gfire_find_chat(gfire_data *p_gfire, const void *p_data, gfire_find_chat_mode p_mode); +void gfire_add_chat(gfire_data *p_gfire, gfire_chat *p_chat); +void gfire_leave_chat(gfire_data *p_gfire, gfire_chat *p_chat); + +// Gaming status +#ifdef USE_GAME_DETECTION +void gfire_set_game_status(gfire_data *p_gfire, const gfire_game_data *p_data); +void gfire_set_voip_status(gfire_data *p_gfire, const gfire_game_data *p_data); +#endif // USE_GAME_DETECTION + +// Appearance +const gchar *gfire_get_name(const gfire_data *p_gfire); +const gchar *gfire_get_nick(const gfire_data *p_gfire); +void gfire_set_alias(gfire_data *p_gfire, const gchar* p_alias); // Local +void gfire_set_nick(gfire_data *p_gfire, const gchar *p_nick); // Remote + +// Status handling +void gfire_set_status(gfire_data *p_gfire, const PurpleStatus *p_status); +void gfire_set_current_status(gfire_data *p_gfire); + +// Identification +gboolean gfire_is_self(const gfire_data *p_gfire, guint32 p_userid); + +// P2P +gboolean gfire_has_p2p(const gfire_data *p_gfire); +gfire_p2p_connection *gfire_get_p2p(const gfire_data *p_gfire); + +// Servers +#ifdef HAVE_GTK +void gfire_show_server_browser(PurplePluginAction *p_action); +#endif // HAVE_GTK + +// Account settings +void gfire_got_preferences(gfire_data *p_gfire); +gboolean gfire_wants_fofs(const gfire_data *p_gfire); +gboolean gfire_wants_server_detection(const gfire_data *p_gfire); +gboolean gfire_wants_global_status_change(const gfire_data *p_gfire); -/* gfire_find_buddy_in_list MODES */ -#define GFFB_NAME 0 /* by name, pass pointer to string */ -#define GFFB_ALIAS 1 /* by alias, pass pointer to string */ -#define GFFB_USERID 2 /* by userid, pass pointer to string ver of uid */ -#define GFFB_UIDBIN 4 /* by userid, pass binary string of userid */ -#define GFFB_SIDS 8 /* by sid (as string) pass pointer of string */ -#define GFFB_SIDBIN 16 /* by sid (binary data) pass pointer */ - -/* gfire_update_buddy_status TYPES */ -#define GFIRE_STATUS_ONLINE 0 /* set buddies online / offline */ -#define GFIRE_STATUS_GAME 1 /* update game information */ -#define GFIRE_STATUS_AWAY 2 /* update away status */ - - -void gfire_close(PurpleConnection *gc); -GList *gfire_find_buddy_in_list( GList *blist, gpointer *data, int mode ); -void gfire_new_buddy(PurpleConnection *gc, gchar *alias, gchar *name); -void gfire_new_buddies(PurpleConnection *gc); -void gfire_handle_im(PurpleConnection *gc); -void gfire_update_buddy_status(PurpleConnection *gc, GList *buddies, int status); -void gfire_buddy_add_authorize_cb(void *data); -void gfire_buddy_add_deny_cb(void *data); -int gfire_check_xqf_cb(PurpleConnection *gc); +// Internal +void gfire_games_update_done(); -#endif /* _GFIRE_H */ +#endif // _GFIRE_H diff -Nru gfire-0.8.3/src/gfire_proto.c gfire-0.9.4/src/gfire_proto.c --- gfire-0.8.3/src/gfire_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gfire_proto.c 2011-03-14 20:19:15.000000000 +0000 @@ -0,0 +1,720 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gfire_proto.h" +#include "gf_game_detection.h" + +guint16 gfire_proto_create_auth(const gchar *p_name, const gchar *p_pw_hash) +{ + if(!p_name || !p_pw_hash) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + /* + * packet_length 00 type(01) 00 numberOfAtts + * attribute_length 'name' usernameLength_length usernameLength 00 username + * attribute_length 'password' passwdLength_length passwdLength 00 cryptedPassword + */ + + // "name" + offset = gfire_proto_write_attr_ss("name", 0x01, p_name, strlen(p_name), offset); + + // "password" + offset = gfire_proto_write_attr_ss("password", 0x01, p_pw_hash, strlen(p_pw_hash), offset); + + // "flags" + guint32 flags = 0; + offset = gfire_proto_write_attr_ss("flags", 0x02, &flags, sizeof(flags), offset); + + gfire_proto_write_header(offset, 0x01, 3, 0); + return offset; +} + +guint16 gfire_proto_create_collective_statistics(const gchar *p_lang, const gchar *p_skin, const gchar *p_theme, const gchar *p_partner) +{ + if(!p_lang || !p_skin || !p_theme || !p_partner) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // "lang" + offset = gfire_proto_write_attr_ss("lang", 0x01, p_lang, strlen(p_lang), offset); + + // "skin" + offset = gfire_proto_write_attr_ss("skin", 0x01, p_skin, strlen(p_skin), offset); + + // "theme" + offset = gfire_proto_write_attr_ss("theme", 0x01, p_theme, strlen(p_theme), offset); + + // "partner" + offset = gfire_proto_write_attr_ss("partner", 0x01, p_partner, strlen(p_partner), offset); + + gfire_proto_write_header(offset, 0x10, 4, 0); + return offset; +} + +guint16 gfire_proto_create_client_version(guint32 p_version) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // "version" + p_version = GUINT32_TO_LE(p_version); + offset = gfire_proto_write_attr_ss("version", 0x02, &p_version, sizeof(p_version), offset); + + gfire_proto_write_header(offset, 0x03, 1, 0); + return offset; +} + +guint16 gfire_proto_create_status_text(const gchar *p_status) +{ + if(!p_status) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // '2E' + offset = gfire_proto_write_attr_bs(0x2E, 0x01, p_status, strlen(p_status), offset); + + gfire_proto_write_header(offset, 0x20, 1, 0); + return offset; +} + +/*send keep alive packet to the server*/ +guint16 gfire_proto_create_keep_alive() +{ + guint32 offset = XFIRE_HEADER_LEN; + + // "value" + guint32 value = 0; + offset = gfire_proto_write_attr_ss("value", 0x02, &value, sizeof(value), offset); + + // "stats" + offset = gfire_proto_write_attr_list_ss("stats", NULL, 0x02, 4, offset); + + gfire_proto_write_header(offset, 0x0D, 2, 0); + + return offset; +} + +guint16 gfire_proto_create_invitation(const gchar *p_name, const gchar *p_msg) +{ + if(!p_name || !p_msg) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // "name" + offset = gfire_proto_write_attr_ss("name", 0x01, p_name, strlen(p_name), offset); + + // "msg" + offset = gfire_proto_write_attr_ss("msg", 0x01, p_msg, strlen(p_msg), offset); + + gfire_proto_write_header(offset, 0x06, 2, 0); + return offset; +} + +guint16 gfire_proto_create_invitation_reject(const gchar *p_name) +{ + if(!p_name) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // "name" + offset = gfire_proto_write_attr_ss("name", 0x01, p_name, strlen(p_name), offset); + + gfire_proto_write_header(offset, 0x08, 1, 0); + return offset; +} + +guint16 gfire_proto_create_invitation_accept(const gchar *p_name) +{ + if(!p_name) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // "name" + offset = gfire_proto_write_attr_ss("name", 0x01, p_name, strlen(p_name), offset); + + gfire_proto_write_header(offset, 0x07, 1, 0); + return offset; +} + +guint16 gfire_proto_create_delete_buddy(guint32 p_userid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // "userid" + p_userid = GUINT32_TO_LE(p_userid); + offset = gfire_proto_write_attr_ss("userid", 0x02, &p_userid, sizeof(p_userid), offset); + + gfire_proto_write_header(offset, 0x09, 1, 0); + return offset; +} + +/* +* Sends a nickname change to the server +*/ +guint16 gfire_proto_create_change_alias(const gchar *p_alias) +{ + if(!p_alias) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + // "nick" + offset = gfire_proto_write_attr_ss("nick", 0x01, p_alias, strlen(p_alias), offset); + + gfire_proto_write_header(offset, 0x0E, 1, 0); + return offset; +} + +/* +* Sends the packet when we join a game or leave it (gameid 00 00) +*/ +guint16 gfire_proto_create_join_game(const gfire_game_data *p_game) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // "gameid" + guint32 gameid = GUINT32_TO_LE(p_game->id); + offset = gfire_proto_write_attr_ss("gameid", 0x02, &gameid, sizeof(gameid), offset); + + // "gip" + guint32 gameip = GUINT32_TO_LE(p_game->ip.value); + offset = gfire_proto_write_attr_ss("gip", 0x02, &gameip, sizeof(gameip), offset); + + // "gport" + guint32 gameport = GUINT32_TO_LE(p_game->port); + offset = gfire_proto_write_attr_ss("gport", 0x02, &gameport, sizeof(gameport), offset); + + gfire_proto_write_header(offset, 0x04, 3, 0); + return offset; +} + +/* +* Sends the packet when we join a voip server or leave it (voipid 00 00) +*/ +guint16 gfire_proto_create_join_voip(const gfire_game_data *p_voip) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // "vid" + guint32 voipid = p_voip->ip.value ? GUINT32_TO_LE(p_voip->id) : 0; + offset = gfire_proto_write_attr_ss("vid", 0x02, &voipid, sizeof(voipid), offset); + + // "vip" + guint32 voipip = GUINT32_TO_LE(p_voip->ip.value); + offset = gfire_proto_write_attr_ss("vip", 0x02, &voipip, sizeof(voipip), offset); + + // "vport" + guint32 voipport = GUINT32_TO_LE(p_voip->port); + offset = gfire_proto_write_attr_ss("vport", 0x02, &voipport, sizeof(voipport), offset); + + gfire_proto_write_header(offset, 0x0F, 3, 0); + return offset; +} + +guint16 gfire_proto_create_game_sdk(GList *p_keys, GList *p_values) +{ + if(g_list_length(p_keys) != g_list_length(p_values)) + return 0; + + guint32 offset = XFIRE_HEADER_LEN; + + GString *str = g_string_new(""); + + GList *curkey = p_keys; + GList *curval = p_values; + + while(curkey) + { + g_string_append_printf(str, "%s\1%s\2", (const gchar*)curkey->data, (const gchar*)curval->data); + + curkey = g_list_next(curkey); + curval = g_list_next(curval); + } + + offset = gfire_proto_write_attr_bs(0x5B, 0x01, str->str, strlen(str->str), offset); + + g_string_free(str, TRUE); + + gfire_proto_write_header(offset, 0x23, 1, 0); + return offset; +} + +// reads buddy list from server and populates purple blist +void gfire_proto_buddy_list(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset; + gfire_buddy *gf_buddy = NULL; + GList *friends = NULL; + GList *nicks = NULL; + GList *userids = NULL; + GList *f, *n, *u; + + if (p_packet_len < 16) + { + purple_debug_error("gfire", "buddy list received, but too short. (%d bytes)\n", p_packet_len); + return; + } + + offset = XFIRE_HEADER_LEN; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &friends, "friends", offset); + // Parsing error or empty list -> skip further handling + if(offset == -1 || !friends) + { + purple_debug_error("gfire", "empty list or error!\n"); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &nicks, "nick", offset); + // Parsing error -> free other lists and skip further handling + if(offset == -1) + { + purple_debug_error("gfire", "empty list or error!\n"); + g_list_free(friends); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &userids, "userid", offset); + // Parsing error -> free other lists and skip further handling + if(offset == -1) + { + purple_debug_error("gfire", "empty list or error!\n"); + g_list_free(friends); + g_list_free(nicks); + return; + } + + f = friends; + n = nicks; + u = userids; + + for(; f; f = g_list_next(f)) + { + gf_buddy = gfire_find_buddy(p_gfire, f->data, GFFB_NAME); + if(!gf_buddy) + { + gf_buddy = gfire_buddy_create(*(guint32*)u->data, (gchar*)f->data, (gchar*)n->data, GFBT_FRIEND); + if(gf_buddy) + { + // Find group for buddy + gfire_group *group = gfire_find_group(p_gfire, u->data, GFFG_BUDDY); + gfire_add_buddy(p_gfire, gf_buddy, group); + } + } + else if(!gfire_buddy_is_friend(gf_buddy)) + { + // Find group for buddy + gfire_group *group = gfire_find_group(p_gfire, u->data, GFFG_BUDDY); + gfire_buddy_make_friend(gf_buddy, group); + gfire_buddy_set_alias(gf_buddy, (gchar*)n->data); + } + + g_free(f->data); + g_free(u->data); + g_free(n->data); + + u = g_list_next(u); + n = g_list_next(n); + } + + g_list_free(friends); + g_list_free(nicks); + g_list_free(userids); +} + +void gfire_proto_buddy_remove(gfire_data *p_gfire, guint16 p_packet_len) +{ + guint32 offset; + gfire_buddy *gf_buddy = NULL; + guint32 userid = 0; + + offset = XFIRE_HEADER_LEN; + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &userid, "userid", offset); + + gf_buddy = gfire_find_buddy(p_gfire, &userid, GFFB_USERID); + // Looks like buddy is already removed + if(!gf_buddy) + return; + + // Remove buddy + purple_debug_info("gfire", "Removing buddy %s\n", gfire_buddy_get_name(gf_buddy)); + gfire_remove_buddy(p_gfire, gf_buddy, FALSE, TRUE); +} + +void gfire_proto_clan_leave(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 clanid = 0; + guint32 userid = 0; + gfire_buddy *clan_member = NULL; + + guint32 offset = XFIRE_HEADER_LEN; + + if(p_packet_len < 17) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_proto_read_clan_leave: received, but too short. (%d bytes)\n", p_packet_len); + return; + } + + // '6C' clanid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &clanid, 0x6C, offset); + if(offset == -1) + return; + + // '01' userid + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &userid, 0x01, offset); + if(offset == -1) + return; + + if(gfire_is_self(p_gfire, userid)) + gfire_leave_clan(p_gfire, clanid); + else + { + clan_member = gfire_find_buddy(p_gfire, &userid, GFFB_USERID); + if(!clan_member) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_proto_clan_leave: invalid user ID from Xfire\n"); + return; + } + + gfire_remove_buddy_from_clan(p_gfire, clan_member, clanid); + } +} + +void gfire_proto_login_salt(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + gchar *salt = NULL; + offset = gfire_proto_read_attr_string_ss(p_gfire->buff_in, &salt, "salt", offset); + if(offset == -1 || !salt) + { + purple_connection_error(gfire_get_connection(p_gfire), _("Received invalid login salt!")); + return; + } + + purple_debug_info("gfire", "salt: %s\n", salt); + + gfire_authenticate(p_gfire, salt); + g_free(salt); +} + +/* reads session information from intial login grabs our info */ +void gfire_proto_session_info(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 userid = 0; + guint8 *sid = NULL; + gchar *alias = NULL; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &userid, "userid", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_sid_ss(p_gfire->buff_in, &sid, "sid", offset); + if(offset == -1 || !sid) + return; + + offset = gfire_proto_read_attr_string_ss(p_gfire->buff_in, &alias, "nick", offset); + if(offset == -1 || !alias) + { + g_free(sid); + return; + } + + gfire_set_userid(p_gfire, userid); + gfire_set_sid(p_gfire, sid); + gfire_set_alias(p_gfire, alias); + + g_free(sid); + g_free(alias); +} + +void gfire_proto_invitation(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + GList *names = NULL; + GList *aliases = NULL; + GList *msgs = NULL; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &names, "name", offset); + if(offset == -1 || !names) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &aliases, "nick", offset); + if(offset == -1 || !aliases) + { + g_list_free(names); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &msgs, "msg", offset); + if(offset == -1 || !msgs) + { + g_list_free(names); + g_list_free(aliases); + return; + } + + GList *n = names; GList *a = aliases; GList *m = msgs; + for(; n; n = g_list_next(n)) + { + gfire_got_invitation(p_gfire, (gchar*)n->data, (gchar*)a->data, (gchar*)m->data); + + g_free(n->data); + g_free(a->data); + g_free(m->data); + + a = g_list_next(a); + m = g_list_next(m); + } + + g_list_free(names); + g_list_free(aliases); + g_list_free(msgs); +} + +void gfire_proto_clan_list(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + GList *clanids = NULL; + GList *clanLongNames = NULL; + GList *clanShortNames = NULL; + GList *clanTypes = NULL; + gfire_clan *newClan = NULL; + + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanids, 0x6C, offset); + if(offset == -1 || !clanids) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanLongNames, 0x02, offset); + if(offset == -1 || !clanLongNames) + { + g_list_free(clanids); + return; + } + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanShortNames, 0x72, offset); + if(offset == -1 || !clanShortNames) + { + g_list_free(clanids); + g_list_free(clanLongNames); + return; + } + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &clanTypes, 0x34, offset); + if(offset == -1 || !clanTypes) + { + g_list_free(clanids); + g_list_free(clanLongNames); + g_list_free(clanShortNames); + return; + } + + GList *id = clanids; GList *ln = clanLongNames; GList *sn = clanShortNames; GList *t = clanTypes; + for(; id; id = g_list_next(id)) + { + newClan = gfire_find_clan(p_gfire, *(guint32*)id->data); + if(!newClan) + { + newClan = gfire_clan_create(*(guint32*)id->data, (const gchar*)ln->data, (const gchar*)sn->data, TRUE); + if(newClan) + gfire_add_clan(p_gfire, newClan); + } + else + gfire_clan_set_names(newClan, (const gchar*)ln->data, (const gchar*)sn->data); + + g_free(id->data); + g_free(ln->data); + g_free(sn->data); + g_free(t->data); + + ln = g_list_next(ln); + sn = g_list_next(sn); + t = g_list_next(t); + } + + g_list_free(clanids); + g_list_free(clanLongNames); + g_list_free(clanShortNames); + g_list_free(clanTypes); +} + +void gfire_proto_clan_blist(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + gfire_buddy *gf_buddy = NULL; + gfire_clan *clan = NULL; + guint32 clanid = 0; + GList *userids = NULL; + GList *names = NULL; + GList *aliases = NULL; + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &clanid, 0x6C, offset); + if(offset == -1) + return; + + clan = gfire_find_clan(p_gfire, clanid); + if(!clan) + { + purple_debug_error("gfire", "gfire_proto_clan_blist: Unknown Clan ID from Xfire!\n"); + return; + } + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &userids, 0x01, offset); + if(offset == -1 || !userids) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &names, 0x02, offset); + if(offset == -1 || !names) + { + g_list_free(userids); + return; + } + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &aliases, 0x0D, offset); + if(offset == -1 || !aliases) + { + g_list_free(userids); + g_list_free(names); + return; + } + + GList *u = userids, *n = names, *a = aliases; + for(; u; u = g_list_next(u)) + { + // Don't add ourself to the clan list + if(gfire_is_self(p_gfire, *(guint32*)u->data)) + { + g_free(u->data); + g_free(n->data); + g_free(a->data); + + n = g_list_next(n); + a = g_list_next(a); + continue; + } + + // Add buddy if it doesn't exist yet + gf_buddy = gfire_find_buddy(p_gfire, u->data, GFFB_USERID); + if(!gf_buddy) + { + gf_buddy = gfire_buddy_create(*(guint32*)u->data, (const gchar*)n->data, NULL, GFBT_CLAN); + if(gf_buddy) + { + gfire_buddy_add_to_clan(gf_buddy, clan, (const gchar*)a->data, TRUE); + gfire_add_buddy(p_gfire, gf_buddy, NULL); + } + } + else + gfire_buddy_add_to_clan(gf_buddy, clan, (const gchar*)a->data, FALSE); + + g_free(u->data); + g_free(n->data); + g_free(a->data); + + n = g_list_next(n); + a = g_list_next(a); + } + + g_list_free(userids); + g_list_free(names); + g_list_free(aliases); + + if(!clan->got_first_list) + { + gfire_clan_check_for_left_members(clan, p_gfire); + clan->got_first_list = TRUE; + } +} + +void gfire_proto_system_broadcast(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 unknown = 0; + gchar *msg = NULL; + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &unknown, 0x34, offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_string_bs(p_gfire->buff_in, &msg, 0x2E, offset); + if(offset == -1 || !msg) + return; + + gchar *escaped = gfire_escape_html(msg); + purple_notify_info(gfire_get_connection(p_gfire), _("Xfire System Broadcast"), _("Xfire System Broadcast Message:"), escaped); + g_free(escaped); + + g_free(msg); +} + +void gfire_proto_external_game(gfire_data *p_gfire, guint16 p_packet_len) +{ +#ifdef USE_GAME_DETECTION + if(!p_gfire) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 gameid = 0; + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &gameid, 0x21, offset); + if(offset == -1) + return; + + gfire_game_detector_set_external_game(gameid); +#endif // USE_GAME_DETECTION +} diff -Nru gfire-0.8.3/src/gfire_proto.h gfire-0.9.4/src/gfire_proto.h --- gfire-0.8.3/src/gfire_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gfire_proto.h 2011-03-14 20:19:05.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GFIRE_PROTO_H +#define _GFIRE_PROTO_H + +#include "gf_base.h" +#include "gf_network.h" +#include "gf_protocol.h" +#include "gf_games.h" +#include "gfire.h" + +// Packet creation +guint16 gfire_proto_create_auth(const gchar *p_name, const gchar *p_pw_hash); +guint16 gfire_proto_create_collective_statistics(const gchar *p_lang, const gchar *p_skin, const gchar *p_theme, const gchar *p_partner); +guint16 gfire_proto_create_client_version(guint32 p_version); +guint16 gfire_proto_create_status_text(const gchar *p_status); +guint16 gfire_proto_create_keep_alive(); +guint16 gfire_proto_create_invitation(const gchar *p_name, const gchar *p_msg); +guint16 gfire_proto_create_invitation_reject(const gchar *p_name); +guint16 gfire_proto_create_invitation_accept(const gchar *p_name); +guint16 gfire_proto_create_delete_buddy(guint32 p_userid); +guint16 gfire_proto_create_change_alias(const gchar *p_alias); +guint16 gfire_proto_create_join_game(const gfire_game_data *p_game); +guint16 gfire_proto_create_join_voip(const gfire_game_data *p_voip); +guint16 gfire_proto_create_game_sdk(GList *p_keys, GList *p_values); + +// Packet parsing +void gfire_proto_buddy_list(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_buddy_remove(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_login_salt(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_session_info(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_invitation(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_clan_leave(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_clan_list(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_clan_blist(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_system_broadcast(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_proto_external_game(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // _GFIRE_PROTO_H diff -Nru gfire-0.8.3/src/gfirerc.rc gfire-0.9.4/src/gfirerc.rc --- gfire-0.8.3/src/gfirerc.rc 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gfirerc.rc 2011-03-23 18:04:38.000000000 +0000 @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,9,4,0 + PRODUCTVERSION 0,9,4,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "The Gfire Team" + VALUE "FileDescription", "Gfire - Xfire libpurple Plugin" + VALUE "FileVersion", "0.9.4" + VALUE "InternalName", "Gfire" + VALUE "LegalCopyright", "Copyright (C) 2005-2011 The Gfire Team (See the COPYING file in the source distribution)." + VALUE "OriginalFilename", "libxfire.dll" + VALUE "ProductName", "Gfire" + VALUE "ProductVersion", "0.9.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff -Nru gfire-0.8.3/src/gf_menus.c gfire-0.9.4/src/gf_menus.c --- gfire-0.8.3/src/gf_menus.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_menus.c 2011-03-14 20:23:44.000000000 +0000 @@ -0,0 +1,242 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_menus.h" + +#ifdef HAVE_GTK +# include "gf_server_browser.h" +#endif // HAVE_GTK + +void gfire_clan_menu_site_cb(PurpleBlistNode *p_node, gpointer *p_data) +{ + if(!p_node || !p_node) + return; + + gint clanid = purple_blist_node_get_int(p_node, "clanid"); + gfire_clan *clan = gfire_find_clan((gfire_data*)p_data, clanid); + if(!clan) + return; + + gchar *uri; + uri = g_strdup_printf(XFIRE_COMMUNITY_URL, gfire_clan_get_short_name(clan)); + purple_notify_uri(gfire_get_connection((gfire_data*)p_data), uri); + g_free(uri); + } + +void gfire_buddy_menu_profile_cb(PurpleBlistNode *p_node, gpointer *p_data) +{ + PurpleBuddy *b = (PurpleBuddy*)p_node; + if (!b || !(b->name)) return; + + gchar *uri; + uri = g_strdup_printf("%s%s", XFIRE_PROFILE_URL, purple_buddy_get_name(b)); + purple_notify_uri(purple_account_get_connection(b->account), uri); + g_free(uri); + } + +void gfire_buddy_menu_add_as_friend_cb(PurpleBlistNode *p_node, gpointer *p_data) +{ + PurpleBuddy *b = (PurpleBuddy*)p_node; + + if (!b || !b->account) + return; + + purple_blist_request_add_buddy(b->account, purple_buddy_get_name(b), GFIRE_DEFAULT_GROUP_NAME, NULL); +} + + + /** + * Callback function for pidgin buddy list right click menu. This callback + * is what the interface calls when the Join Game ... menu option is selected + * + * @param p_node BuddyList node provided by interface + * @param p_data Gpointer data (not used) +*/ +void gfire_buddy_menu_joingame_cb(PurpleBlistNode *p_node, gpointer *p_data) +{ + PurpleBuddy *b = (PurpleBuddy*)p_node; + PurpleConnection *gc = NULL; + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + + if (!b || !b->account || !(gc = purple_account_get_connection(b->account)) || + !(gfire = (gfire_data*)gc->proto_data)) return; + + gf_buddy = gfire_find_buddy(gfire, purple_buddy_get_name(b), GFFB_NAME); + if(!gf_buddy) + return; + + const gfire_game_data *game_data = gfire_buddy_get_game_data(gf_buddy); + if (gfire_game_data_is_valid(game_data) && gfire_game_playable(game_data->id)) + gfire_join_game(game_data); +} + +#ifdef HAVE_GTK + +void gfire_buddy_menu_server_details_cb(PurpleBlistNode *p_node, gpointer *p_data) +{ + PurpleBuddy *b = (PurpleBuddy*)p_node; + PurpleConnection *gc = NULL; + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + + if (!b || !b->account || !(gc = purple_account_get_connection(b->account)) || + !(gfire = (gfire_data*)gc->proto_data)) return; + + gf_buddy = gfire_find_buddy(gfire, purple_buddy_get_name(b), GFFB_NAME); + if(!gf_buddy) + return; + + const gfire_game_data *game_data = gfire_buddy_get_game_data(gf_buddy); + if(gfire_game_data_is_valid(game_data)) + gfire_server_browser_show_single(game_data->id, game_data->ip.value, game_data->port); +} + +#endif // HAVE_GTK + +/** + * Callback function for pidgin buddy list right click menu. This callback + * is what the interface calls when the Join VoIP ... menu option is selected + * + * @param p_node BuddyList node provided by interface + * @param p_data Gpointer data (not used) +*/ +void gfire_buddy_menu_joinvoip_cb(PurpleBlistNode *p_node, gpointer *p_data) +{ + PurpleBuddy *b = (PurpleBuddy*)p_node; + PurpleConnection *gc = NULL; + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + + if (!b || !b->account || !(gc = purple_account_get_connection(b->account)) || + !(gfire = (gfire_data*)gc->proto_data)) return; + + gf_buddy = gfire_find_buddy(gfire, purple_buddy_get_name(b), GFFB_NAME); + if(!gf_buddy) + return; + + const gfire_game_data *voip_data = gfire_buddy_get_voip_data(gf_buddy); + if (gfire_game_data_is_valid(voip_data) && gfire_game_playable(voip_data->id)) + gfire_join_game(voip_data); +} + +void gfire_menu_action_nick_change_cb(PurplePluginAction *p_action) +{ + PurpleConnection *gc = (PurpleConnection *)p_action->context; + PurpleAccount *account = purple_connection_get_account(gc); + + purple_request_input(gc, NULL, _("Change Xfire nickname"), _("Leaving empty will clear your current nickname."), purple_connection_get_display_name(gc), + FALSE, FALSE, NULL, _("OK"), G_CALLBACK(gfire_purple_nick_change_cb), _("Cancel"), NULL, account, NULL, NULL, gc); +} + +void gfire_menu_action_reload_lconfig_cb(PurplePluginAction *p_action) +{ + if(!gfire_game_load_config_xml(TRUE)) + purple_notify_message(p_action->context, PURPLE_NOTIFY_MSG_ERROR, _("Gfire XML Reload"), _("Reloading gfire_game_config.xml"), _("Operation failed. File not found or content was incorrect."), NULL, NULL); + else + purple_notify_message(p_action->context, PURPLE_NOTIFY_MSG_INFO, _("Gfire XML Reload"), _("Reloading gfire_game_config.xml"), _("Reloading was successful."), NULL, NULL); +} + +static void gfire_menu_action_website_cb(PurpleConnection *p_gc) +{ + purple_notify_uri((void *)p_gc, GFIRE_WEBSITE); +} + +static void gfire_menu_action_wiki_cb(PurpleConnection *p_gc) +{ + purple_notify_uri((void *)p_gc, GFIRE_WIKI); +} + +void gfire_menu_action_about_cb(PurplePluginAction *p_action) +{ + PurpleConnection *gc = (PurpleConnection *)p_action->context; + gfire_data *gfire = NULL; + char *msg = NULL; + + if(!(gfire = (gfire_data*)gc->proto_data)) return; + + const gchar *natTypeString = NULL; + int natType = 0; + + gfire_p2p_connection *p2p = gfire_get_p2p(gfire); + if(p2p) + natType = gfire_p2p_connection_natType(p2p); + + switch(natType) { + case 1: + natTypeString = _("Full Cone NAT"); + break; + case 2: + case 3: + natTypeString = _("Symmetric NAT"); + break; + case 4: + natTypeString = _("Restricted Cone NAT"); + break; + default: + natTypeString = _("No P2P available"); + break; + } + + if(gfire_game_have_list()) + { + gchar *version_str = gfire_game_get_version_str(); + msg = g_strdup_printf(_("Gfire Version: %s\nGame List Version: %s\nNAT Type: %d (%s)"), GFIRE_VERSION_STRING, + version_str, natType, natTypeString); + g_free(version_str); + } + else + { + msg = g_strdup_printf(_("Gfire Version: %s\nNAT Type: %d (%s)"), GFIRE_VERSION_STRING, natType, + natTypeString); + } + + purple_request_action(gc, _("About Gfire"), _("Xfire Plugin for Pidgin"), msg, PURPLE_DEFAULT_ACTION_NONE, + purple_connection_get_account(gc), NULL, NULL, gc, 3, _("Close"), NULL, + _("Website"), G_CALLBACK(gfire_menu_action_website_cb), + _("Wiki"), G_CALLBACK(gfire_menu_action_wiki_cb)); + + if(msg) g_free(msg); +} + +void gfire_menu_action_profile_page_cb(PurplePluginAction *p_action) +{ + PurpleConnection *gc = (PurpleConnection *)p_action->context; + PurpleAccount *a = purple_connection_get_account(gc); + + gchar *uri = g_strdup_printf("%s%s", XFIRE_PROFILE_URL, purple_account_get_username(a)); + purple_notify_uri((void *)gc, uri); + g_free(uri); +} + +void gfire_menu_action_launch_game_cb(PurplePluginAction *p_action) +{ + guint32 game_id = GPOINTER_TO_UINT(p_action->user_data); + if(game_id) + { + gfire_game_data launch_data; + memset(&launch_data, 0, sizeof(gfire_game_data)); + + launch_data.id = game_id; + + gfire_join_game(&launch_data); + } +} diff -Nru gfire-0.8.3/src/gf_menus.h gfire-0.9.4/src/gf_menus.h --- gfire-0.8.3/src/gf_menus.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_menus.h 2011-03-14 20:23:38.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_MENUS_H +#define _GF_MENUS_H + +#include "gf_base.h" +#include "gfire.h" +#include "gf_games.h" +#include "gf_purple.h" + +// GFIRE ACCOUNT MENU /////////////////////////////////////////////// +void gfire_menu_action_nick_change_cb(PurplePluginAction *p_action); +void gfire_menu_action_reload_lconfig_cb(PurplePluginAction *p_action); +void gfire_menu_action_about_cb(PurplePluginAction *p_action); +void gfire_menu_action_profile_page_cb(PurplePluginAction *p_action); +void gfire_menu_action_launch_game_cb(PurplePluginAction *p_action); + +// GFIRE BUDDY MENU ///////////////////////////////////////////////// +void gfire_buddy_menu_profile_cb(PurpleBlistNode *p_node, gpointer *p_data); +void gfire_buddy_menu_add_as_friend_cb(PurpleBlistNode *p_node, gpointer *p_data); +void gfire_buddy_menu_joingame_cb(PurpleBlistNode *p_node, gpointer *p_data); +#ifdef HAVE_GTK +void gfire_buddy_menu_server_details_cb(PurpleBlistNode *p_node, gpointer *p_data); +#endif // HAVE_GTK +void gfire_buddy_menu_joinvoip_cb(PurpleBlistNode *p_node, gpointer *p_data); + +// GFIRE CLAN MENU ////////////////////////////////////////////////// +void gfire_clan_menu_site_cb(PurpleBlistNode *p_node, gpointer *p_data); + +#endif // _GF_MENUS diff -Nru gfire-0.8.3/src/gf_network.c gfire-0.9.4/src/gf_network.c --- gfire-0.8.3/src/gf_network.c 2009-08-19 15:40:24.000000000 +0000 +++ gfire-0.9.4/src/gf_network.c 2011-03-14 20:23:34.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -20,86 +19,91 @@ * along with Gfire. If not, see . */ -#include "gfire.h" -#include "gf_packet.h" #include "gf_network.h" -#include "gf_chat.h" - -/* we only include this on win32 builds */ -# ifdef _WIN32 -# include "internal.h" -# endif /* _WIN32 */ +#include "gfire_proto.h" +#include "gf_preferences_proto.h" +#include "gf_buddies_proto.h" +#include "gf_chat_proto.h" +#include "gf_friend_search_proto.h" +#include "gf_groups_proto.h" +#include "gf_games.h" + +#ifdef HAVE_GTK +# include "gf_server_browser_proto.h" +#endif // HAVE_GTK +static guint8 *gfire_buffout = NULL; +static guint32 gfire_buffout_refcount = 0; +void gfire_network_init() +{ + gfire_buffout_refcount++; + if(!gfire_buffout) gfire_buffout = g_malloc0(GFIRE_BUFFOUT_SIZE); +} -void gfire_parse_packet(PurpleConnection *gc, int packet_len, int packet_id); +void gfire_network_cleanup() +{ + if(gfire_buffout_refcount == 0) + return; + gfire_buffout_refcount--; -void gfire_send(PurpleConnection *gc, const guint8 *packet, int size) -{ - GTimeVal gtv; - gfire_data *gfire = NULL; - int tmp = 0; - int errsv = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; -// purple_debug(PURPLE_DEBUG_MISC, "gfire", "(send): fd %d, size %d\n",gfire->fd, size); - if (gfire->fd > 0 && size > 0) { - tmp = send(gfire->fd, packet, size, 0); - errsv = errno; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(send): wrote %d bytes\n",tmp); - if (tmp < 0) purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(send): error %d, %s\n",errsv, strerror(errsv)); + if(gfire_buffout_refcount == 0) + { + if(gfire_buffout) g_free(gfire_buffout); + gfire_buffout = NULL; } - if (NULL != gfire->buff_out) memset((void *)gfire->buff_out, 0x00, GFIRE_BUFFOUT_SIZE); - g_get_current_time(>v); - gfire->last_packet = gtv.tv_sec; } +void gfire_network_buffout_write(const void *p_data, guint16 p_len, guint16 p_offset) +{ + if(!p_data || p_len == 0 || (p_len + p_offset) > GFIRE_BUFFOUT_SIZE) + return; + + if(!gfire_buffout) + gfire_network_init(); + + memcpy(gfire_buffout + p_offset, p_data, p_len); +} -int gfire_statistics(guint8 *packet) +void gfire_network_buffout_copy(void *p_buffer, guint16 p_len) { - int length = 41 + strlen(getenv("LANG") ? getenv("LANG") : "en_GB") + strlen("Gfire") + strlen(GFIRE_VERSION); - int index = 0; + if(!p_buffer || !p_len) + return; - gfire_add_header(packet, length, 0x10, 4);/*add header*/ - index += 5; + if(!gfire_buffout) + gfire_network_init(); - index = gfire_add_att_name(packet,index, "lang"); - packet[index] = 0x01; - *((guint16*)&packet[index+1]) = GUINT16_TO_LE(strlen(getenv("LANG") ? getenv("LANG") : "en_GB")); - memcpy(packet + index + 3, getenv("LANG") ? getenv("LANG") : "en_GB", strlen(getenv("LANG") ? getenv("LANG") : "en_GB")); - index += 3 + strlen(getenv("LANG") ? getenv("LANG") : "en_GB"); - - index = gfire_add_att_name(packet,index, "skin"); - packet[index] = 0x01; - *((guint16*)&packet[index+1]) = GUINT16_TO_LE(strlen("Gfire")); - memcpy(packet + index + 3, "Gfire", strlen("Gfire")); - index += 3 + strlen("Gfire"); - - index = gfire_add_att_name(packet,index, "theme"); - packet[index] = 0x01; - *((guint16*)&packet[index+1]) = GUINT16_TO_LE(strlen(GFIRE_VERSION)); - memcpy(packet + index + 3, GFIRE_VERSION, strlen(GFIRE_VERSION)); - index += 3 + strlen(GFIRE_VERSION); - - index = gfire_add_att_name(packet,index, "partner"); - packet[index] = 0x01; - *((guint16*)&packet[index+1]) = 0; - index += 3; - - return index; + memcpy(p_buffer, gfire_buffout, (p_len < GFIRE_BUFFOUT_SIZE) ? p_len : GFIRE_BUFFOUT_SIZE); } -int gfire_client_version(guint8 *packet, guint32 version) +void gfire_send(PurpleConnection *p_gc, guint16 p_size) { - gfire_add_header(packet, 18, 0x03, 1);/*add header*/ - int index = 5; + if(!p_gc || p_size == 0) + return; + + gfire_data *gfire = (gfire_data*)p_gc->proto_data; + if(!gfire) + return; + + int tmp = 0; - index = gfire_add_att_name(packet,index, "version"); - packet[index] = 0x02; - *((guint32*)&packet[index+1]) = GUINT32_TO_LE(version); + if (gfire->fd >= 0) + { + tmp = send(gfire->fd, gfire_buffout, p_size, 0); + if(tmp < 0) + { + if(errno != EAGAIN) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_send: error %d: %s\n", errno, strerror(errno)); + purple_connection_error_reason(gfire_get_connection(gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, strerror(errno)); + } + } + else + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(send): wrote %d Bytes\n", tmp); + } - return index + 5; + memset((void *)gfire_buffout, 0x00, GFIRE_BUFFOUT_SIZE); } void gfire_input_cb(gpointer p_data, gint p_source, PurpleInputCondition p_condition) @@ -107,15 +111,9 @@ guint16 packet_len = 0; static int tmp = 0; guint16 pkt_id = 0; - PurpleConnection *gc = (PurpleConnection*)p_data; - gfire_data *gfire = (gfire_data*)gc->proto_data; + gfire_data *gfire = (gfire_data*)p_data; - if ( (NULL == gfire->buff_out) || (NULL == gfire->buff_in) ) { - if ( NULL == gfire->buff_out ) gfire->buff_out = g_malloc0(GFIRE_BUFFOUT_SIZE); - if ( NULL == gfire->buff_in ) gfire->buff_in = g_malloc0(GFIRE_BUFFIN_SIZE); - } - - if(p_condition != PURPLE_INPUT_READ) + if(!(p_condition & PURPLE_INPUT_READ)) return; if(gfire->bytes_read < 2) @@ -129,7 +127,7 @@ if(tmp == 0) { purple_debug(PURPLE_DEBUG_MISC, "gfire", "(input): read 0 bytes, connection closed by peer\n"); - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Connection closed by peer."); + purple_connection_error_reason(gfire_get_connection(gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Connection closed by peer.")); } // We couldn't read now; not necessarily an error else if(errno == EAGAIN) @@ -138,7 +136,7 @@ { purple_debug(PURPLE_DEBUG_ERROR, "gfire", "Reading from socket failed errno = %d err_str = %s.\n", errno, strerror(errno)); - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Socket read failure."); + purple_connection_error_reason(gfire_get_connection(gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Socket read failure.")); } gfire->bytes_read = 0; return; @@ -163,7 +161,7 @@ if(tmp == 0) { purple_debug(PURPLE_DEBUG_MISC, "gfire", "(input): read 0 bytes, connection closed by peer\n"); - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Connection closed by peer."); + purple_connection_error_reason(gfire_get_connection(gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Connection closed by peer.")); } // We couldn't read now; not necessarily an error else if(errno == EAGAIN) @@ -172,7 +170,7 @@ { purple_debug(PURPLE_DEBUG_ERROR, "gfire", "Reading from socket failed errno = %d err_str = %s.\n", errno, strerror(errno)); - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Socket read failure."); + purple_connection_error_reason(gfire_get_connection(gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Socket read failure.")); } gfire->bytes_read = 0; return; @@ -189,287 +187,298 @@ memcpy(&pkt_id, gfire->buff_in + 2, sizeof(pkt_id)); pkt_id = GUINT16_FROM_LE(pkt_id); - GTimeVal gtv; - g_get_current_time(>v); - gfire->last_packet = gtv.tv_sec; - gfire->bytes_read = 0; - gfire_parse_packet(gc, packet_len, pkt_id); + gfire_parse_packet(gfire, packet_len, pkt_id); } -void gfire_parse_packet(PurpleConnection *gc, int packet_len, int packet_id) + +void gfire_parse_packet(gfire_data *p_gfire, guint16 p_packet_len, guint16 p_packet_id) { - int ob_len = 0; - gfire_data *gfire = (gfire_data *) gc->proto_data; guint32 newver = 0; - char tmp[100] = ""; + gchar *tmp = NULL; PurpleAccount *account = NULL; - GList *tlist = NULL; - gfire_buddy *buddy = NULL; - guint8 *cid = NULL; - gchar *ctopic = NULL; - gchar *cmotd = NULL; - gfire_chat_msg *gcm = NULL; - PurpleBuddy *pbuddy = NULL; - - switch(packet_id) + switch(p_packet_id) { case 128: purple_debug(PURPLE_DEBUG_MISC, "gfire", "received salt packet\n"); - ob_len = gfire_send_auth(gc,packet_len, packet_id); - gfire_send(gc, gfire->buff_out, ob_len); - purple_connection_update_progress(gc, "Login sent", 2, XFIRE_CONNECT_STEPS); + gfire_proto_login_salt(p_gfire, p_packet_len); break; case 129: purple_debug(PURPLE_DEBUG_MISC, "gfire", "received: wrong passwd/username\n"); - purple_connection_error(gc, "Password or Username Incorrect."); + purple_connection_error_reason(gfire_get_connection(p_gfire), PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Password or Username Incorrect.")); break; - + case 130: purple_debug(PURPLE_DEBUG_MISC, "gfire", "Log in was successful\n"); - purple_connection_set_state(gc, PURPLE_CONNECTED); - gfire_packet_130(gc, packet_len); - ob_len = gfire_statistics(gfire->buff_out); - gfire_send(gc, gfire->buff_out, ob_len); + // Parse session information + gfire_proto_session_info(p_gfire, p_packet_len); - if (gfire->alias) purple_connection_set_display_name(gc, g_strdup(gfire->alias)); - gfire->xqf_source = g_timeout_add(15000, (GSourceFunc)gfire_check_xqf_cb, gc); - #ifdef IS_NOT_WINDOWS - gfire->det_source = g_timeout_add(5000, (GSourceFunc)gfire_detect_running_games_cb, gc); - #endif + // Handle all after-login actions + gfire_login_successful(p_gfire); break; case 131: purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddylist: names and nicks\n"); - gfire_packet_131(gc, packet_len); /* buddy list from server */ - gfire_new_buddies(gc); + gfire_proto_buddy_list(p_gfire, p_packet_len); /* buddy list from server */ break; case 132: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddylist: user is online\n"); - tlist = gfire_read_buddy_online(gc, packet_len); - if (NULL != tlist) gfire_update_buddy_status(gc, tlist, GFIRE_STATUS_ONLINE); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddylist: user is on/offline\n"); + gfire_buddy_proto_on_off(p_gfire, p_packet_len); break; - case 133: + case 133: purple_debug(PURPLE_DEBUG_MISC, "gfire", "got IM (or ack Packet)\n"); - ob_len = gfire_get_im(gc, packet_len); - if (NULL != gfire->im) { - /* proccess incomming im */ - gfire_handle_im(gc); - } - if(ob_len != 0){ - gfire_send(gc, gfire->buff_out, ob_len); - } + gfire_buddy_proto_im(p_gfire, p_packet_len); break; - - case 134: + + case 134: /* out of date version .. */ /* autoset NEW VERSION :) */ - memcpy(&newver, gfire->buff_in + 17, sizeof(newver)); + memcpy(&newver, p_gfire->buff_in + 17, sizeof(newver)); newver = GUINT32_FROM_LE(newver); - g_sprintf(tmp, "Protocol version mismatch, needs to be %d. Auto set to new value.", newver); purple_debug(PURPLE_DEBUG_MISC, "gfire", "login ok, but version too old, needs to be = %d\n", newver); - account = purple_connection_get_account(gc); + account = purple_connection_get_account(gfire_get_connection(p_gfire)); purple_account_set_int(account, "version", newver); - purple_connection_error(gc, tmp); - + tmp = g_strdup_printf(_("Protocol version mismatch, needs to be %d. Auto set to new value."), newver); + purple_connection_error_reason(gfire_get_connection(p_gfire), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); break; case 135: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddylist:game that a buddy is playing\n"); - tlist = gfire_game_status(gc, packet_len); - if (NULL != tlist) gfire_update_buddy_status(gc, tlist, GFIRE_STATUS_GAME); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddylist: game that a buddy is playing\n"); + gfire_buddy_proto_game_status(p_gfire, p_packet_len); break; case 136: purple_debug(PURPLE_DEBUG_MISC, "gfire", "got list of friends of friends\n"); + gfire_buddy_proto_fof_list(p_gfire, p_packet_len); break; case 137: purple_debug(PURPLE_DEBUG_MISC, "gfire", "invitation result\n"); - break; + break; case 138: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddy invitation\n"); - tlist = gfire_read_invitation(gc, packet_len); - if (NULL != tlist) gfire_process_invitation(gc, tlist); - break; + purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddy invitation\n"); + gfire_proto_invitation(p_gfire, p_packet_len); + break; case 139: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Remove buddy ack received\n"); - if (packet_len < 14) return; - tlist = gfire_find_buddy_in_list(gfire->buddies,(gpointer *)(gfire->buff_in + 13), GFFB_UIDBIN); - if (tlist == NULL) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Remove buddy requested, buddy NOT FOUND.\n"); - return; - } - buddy = (gfire_buddy *)tlist->data; - account = purple_connection_get_account(gc); - pbuddy = purple_find_buddy(account, buddy->name); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Removing buddy %s, and freeing memory\n", NN(buddy->name)); - purple_blist_remove_buddy(pbuddy); - gfire->buddies = g_list_delete_link(gfire->buddies, tlist); - if (buddy->away_msg) g_free(buddy->away_msg); - if (buddy->name) g_free(buddy->name); - if (buddy->alias) g_free(buddy->alias); - if (buddy->userid) g_free(buddy->userid); - if (buddy->uid_str) g_free(buddy->uid_str); - if (buddy->sid) g_free(buddy->sid); - if (buddy->sid_str) g_free(buddy->sid_str); - if (buddy->gameip) g_free(buddy->gameip); - g_free(buddy); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Remove buddy received\n"); + gfire_proto_buddy_remove(p_gfire, p_packet_len); + break; + + case 141: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "client preferences received\n"); + gfire_pref_proto_client_preferences(p_gfire, p_packet_len); + break; + + case 143: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Received friends search result\n"); + gfire_friend_search_proto_result(p_gfire, p_packet_len); break; case 144: purple_debug(PURPLE_DEBUG_MISC, "gfire", "received keep alive response (PONG)\n"); + gfire_keep_alive_response(p_gfire); + break; + + case 145: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: You have signed on from another location.\n"); + purple_connection_error_reason(gfire_get_connection(p_gfire), PURPLE_CONNECTION_ERROR_NAME_IN_USE, _("You have signed on from another location.")); + break; + + case 147: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "got buddylist: voip software that a buddy is using\n"); + gfire_buddy_proto_voip_status(p_gfire, p_packet_len); + break; + +// Only used in conjunction with server browser which requires GTK +#ifdef HAVE_GTK + case 148: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received favorite serverlist\n"); + gfire_server_browser_proto_fav_serverlist(p_gfire, p_packet_len); + break; + + case 149: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received friends' favorite serverlist\n"); + gfire_server_browser_proto_friends_fav_serverlist(p_gfire, p_packet_len); + break; + + case 150: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received serverlist\n"); + gfire_server_browser_proto_serverlist(p_gfire, p_packet_len); + break; +#endif // HAVE_GTK + + case 151: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received groups\n"); + gfire_group_proto_groups(p_gfire, p_packet_len); break; - case 145: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: You have signed on from another location.\n"); - gc->wants_to_die = TRUE; - purple_connection_error(gc, "You have signed on from another location."); + case 152: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received buddies in groups\n"); + gfire_group_proto_buddies_in_groups(p_gfire, p_packet_len); + break; + + case 153: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group-add confirmation\n"); + gfire_group_proto_group_added(p_gfire, p_packet_len); break; case 154: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received away status packet.\n"); - tlist = gfire_read_buddy_status(gc, packet_len); - if (NULL != tlist) gfire_update_buddy_status(gc, tlist, GFIRE_STATUS_AWAY); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received status packet.\n"); + gfire_buddy_proto_status_msg(p_gfire, p_packet_len); + break; + + case 155: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group chats\n"); + gfire_chat_proto_persistent_chats(p_gfire, p_packet_len); + break; + + case 156: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received game client data packet.\n"); + gfire_buddy_proto_game_client_data(p_gfire, p_packet_len); + break; + + case 158: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received clan list\n"); + gfire_proto_clan_list(p_gfire, p_packet_len); + break; + + case 159: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received clan buddy list\n"); + gfire_proto_clan_blist(p_gfire, p_packet_len); + break; + + case 160: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received clan member left\n"); + gfire_proto_clan_leave(p_gfire, p_packet_len); break; case 161: purple_debug(PURPLE_DEBUG_MISC, "gfire", "received buddy nick change packet\n"); - gfire_read_alias_change(gc, packet_len); + gfire_buddy_proto_alias_change(p_gfire, p_packet_len); + break; + + case 162: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received clan buddy nick change packet\n"); + gfire_buddy_proto_clan_alias_change(p_gfire, p_packet_len); + break; + + case 169: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received system broadcast\n"); + gfire_proto_system_broadcast(p_gfire, p_packet_len); break; case 174: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received avatar info packet\n"); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received avatar info\n"); + gfire_buddy_proto_changed_avatar(p_gfire, p_packet_len); + break; + + case 176: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received clan member info\n"); + gfire_buddy_proto_clans(p_gfire, p_packet_len); + break; + + case 183: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received external game info\n"); + gfire_proto_external_game(p_gfire, p_packet_len); + break; + + case 191: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received contest infos\n"); + break; + + case 350: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room topic change\n"); + gfire_chat_proto_topic_change(p_gfire, p_packet_len); break; case 351: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group chat info\n"); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room join info\n"); + gfire_chat_proto_join_info(p_gfire, p_packet_len); + break; + case 353: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group chat, user join message\n"); - gcm = gfire_read_chat_user_join(gc, packet_len); - if (NULL != gcm) gfire_chat_user_join(gc, gcm); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room, user join message\n"); + gfire_chat_proto_user_join(p_gfire, p_packet_len); break; case 354: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group chat, user leave message\n"); - gcm = gfire_read_chat_user_leave(gc, packet_len); - if (NULL != gcm) gfire_chat_user_leave(gc, gcm); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room, user leave message\n"); + gfire_chat_proto_user_leave(p_gfire, p_packet_len); break; case 355: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "got group chat message\n"); - gcm = gfire_read_chat_msg(gc, packet_len); - if (NULL != gcm) { - gfire_chat_got_msg(gc, gcm); - } else { - purple_debug(PURPLE_DEBUG_ERROR,"gfire", "(group chat): message parsed failed, gcm NULL\n"); - } + purple_debug(PURPLE_DEBUG_MISC, "gfire", "got chat room message\n"); + gfire_chat_proto_msg(p_gfire, p_packet_len); break; case 356: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group chat invite\n"); - gfire_read_chat_invite(gc, packet_len); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room invite\n"); + gfire_chat_proto_invite(p_gfire, p_packet_len); break; - + case 357: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "groupchat buddy permission changed\n"); - read_groupchat_buddy_permission_change(gc, packet_len); + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room buddy permission changed\n"); + gfire_chat_proto_buddy_permission_change(p_gfire, p_packet_len); break; - case 368: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received group chat channel info, member list\n"); - tlist = gfire_read_chat_info(gc, packet_len, &ctopic, &cmotd, &cid); - if (NULL != tlist) gfire_chat_joined(gc, tlist, cid, ctopic, cmotd); - break; - - case 374: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "groupchat motd changed\n"); - gfire_read_chat_motd_change(gc, packet_len); + case 358: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "persistent chat room infos received\n"); + gfire_chat_proto_persistent_chat_infos(p_gfire, p_packet_len); break; - - case 387: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat reject confirmation\n"); + + case 359: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room buddy kicked notification received\n"); + gfire_chat_proto_buddy_kicked(p_gfire, p_packet_len); break; - default: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "received: length=%i command=%i\n", packet_len, packet_id); - } -} + case 368: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room info (buddy list)\n"); + gfire_chat_proto_room_info(p_gfire, p_packet_len); + break; + case 370: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room default permission change received\n"); + gfire_chat_proto_default_permission_change(p_gfire, p_packet_len); + break; -void gfire_send_away(PurpleConnection *gc, const char *msg) -{ - int index = 5; - gfire_data *gfire = NULL; - guint16 slen = 0; - - - if (msg == NULL) msg = ""; - slen = (guint16) strlen(msg); - slen = GUINT16_TO_LE(slen); - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || - !gfire->buff_out || !(gfire->fd > 0)) return; - - gfire->buff_out[index++] = 0x2e; - gfire->buff_out[index++] = 0x01; - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - - memcpy(gfire->buff_out + index, msg, strlen(msg)); - index += strlen(msg); - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(away): sending away message \"%s\"\n", NN(msg)); - gfire_add_header(gfire->buff_out, index, 32, 1); - gfire_send(gc, gfire->buff_out, index); - -} + case 374: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room motd changed\n"); + gfire_chat_proto_motd_change(p_gfire, p_packet_len); + break; + case 385: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room password change received\n"); + gfire_chat_proto_password_change(p_gfire, p_packet_len); + break; + case 386: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room accessibility change received\n"); + gfire_chat_proto_accessibility_change(p_gfire, p_packet_len); + break; -void gfire_process_invitation(PurpleConnection *gc, GList *invites) -{ - GList *i = NULL; - gfire_buddy *buddy = NULL; - PurpleAccount *account = purple_connection_get_account(gc); - - if (!gc || !invites) { - if (invites) { - invites = g_list_first(invites); - i = invites; - while (i != NULL) { - buddy = (gfire_buddy *)i->data; - if (!buddy) { i = g_list_next(i); continue; } - g_free(buddy->name); - g_free(buddy->uid_str); - g_free(buddy->alias); - g_free(buddy); - i = g_list_next(i); - } - g_list_free(i); - } - return; - } + case 387: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received chat room reject confirmation\n"); + break; + + case 388: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room silenced change received\n"); + gfire_chat_proto_silenced_change(p_gfire, p_packet_len); + break; - invites = g_list_first(invites); - i = invites; + case 389: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "chat room show join/leave messages changed received\n"); + gfire_chat_proto_show_join_leave_change(p_gfire, p_packet_len); + break; - while (NULL != i){ - buddy = (gfire_buddy *)i->data; - if (!buddy) { i = g_list_next(i); continue; } - /* this is a hack, but we need to access gc in the callback */ - buddy->sid = (guint8 *)gc; - - purple_account_request_authorization(account, buddy->name, NULL, buddy->alias, buddy->uid_str, - TRUE, gfire_buddy_add_authorize_cb, - gfire_buddy_add_deny_cb, (void *)buddy); - i = g_list_next(i); + default: + purple_debug(PURPLE_DEBUG_MISC, "gfire", "received: length=%u command=%u\n", p_packet_len, p_packet_id); } } diff -Nru gfire-0.8.3/src/gf_network.h gfire-0.9.4/src/gf_network.h --- gfire-0.8.3/src/gf_network.h 2009-08-19 15:17:52.000000000 +0000 +++ gfire-0.9.4/src/gf_network.h 2011-03-14 20:23:30.000000000 +0000 @@ -1,12 +1,11 @@ /* * purple - Xfire Protocol Plugin * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * * This file is part of Gfire. * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * * Gfire is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -17,25 +16,27 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Gfire. If not, see .A + * along with Gfire. If not, see . */ #ifndef _GF_NETWORK_H #define _GF_NETWORK_H +#include "gf_base.h" #include "gfire.h" #define GFIRE_BUFFOUT_SIZE 65535 #define GFIRE_BUFFIN_SIZE 65535 -void gfire_send(PurpleConnection *gc, const guint8 *packet, int size); -int gfire_statistics(guint8 *packet); -int gfire_client_version(guint8 *packet, guint32 version); -void gfire_input_cb(gpointer data, gint source, PurpleInputCondition condition); -void gfire_send_away(PurpleConnection *gc, const char *msg); -void gfire_process_invitation(PurpleConnection *gc, GList *invites); - -/* Function is in gfire.c, but we put this here for the timeout. */ -gboolean gfire_detect_running_games_cb(PurpleConnection *gc); +// Network system +void gfire_network_init(); +void gfire_network_cleanup(); +void gfire_network_buffout_write(const void *p_data, guint16 p_len, guint16 p_offset); +void gfire_network_buffout_copy(void *p_buffer, guint16 p_len); + +// Traffic handling +void gfire_send(PurpleConnection *p_gc, guint16 p_size); +void gfire_input_cb(gpointer p_data, gint p_source, PurpleInputCondition p_condition); +void gfire_parse_packet(gfire_data *p_gfire, guint16 p_packet_len, guint16 p_packet_id); -#endif /* _GF_NETWORK_H */ +#endif // _GF_NETWORK_H diff -Nru gfire-0.8.3/src/gf_p2p.c gfire-0.9.4/src/gf_p2p.c --- gfire-0.8.3/src/gf_p2p.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p.c 2011-03-14 20:23:26.000000000 +0000 @@ -0,0 +1,801 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_p2p.h" +#include "gf_p2p_session.h" + +static void gfire_p2p_connection_send(gfire_p2p_connection *p_p2p, const struct sockaddr_in *p_addr, guint32 p_len); + +static guint32 gfire_p2p_connection_write_header(gfire_p2p_connection *p_p2p, guint8 p_encoding, const guint8 *p_moniker, + guint32 p_type, guint32 p_msgid, + guint32 p_seqid, guint32 p_data_len) +{ + if(!p_p2p || !p_moniker) + return 0; + + guint32 offset = 0; + + // Encoding + 3 unknown bytes + p_p2p->buff_out[0] = p_encoding; + p_p2p->buff_out[1] = p_p2p->buff_out[2] = p_p2p->buff_out[3] = 0; + offset += 4; + + // Moniker + memcpy(p_p2p->buff_out + offset, p_moniker, 20); + offset += 20; + + // Packet type + p_type = GUINT32_TO_LE(p_type); + memcpy(p_p2p->buff_out + offset, &p_type, 4); + offset += 4; + + // Message ID + p_msgid = GUINT32_TO_LE(p_msgid); + memcpy(p_p2p->buff_out + offset, &p_msgid, 4); + offset += 4; + + // Sequence ID + p_seqid = GUINT32_TO_LE(p_seqid); + memcpy(p_p2p->buff_out + offset, &p_seqid, 4); + offset += 4; + + // Data Length + p_data_len = GUINT32_TO_LE(p_data_len); + memcpy(p_p2p->buff_out + offset, &p_data_len, 4); + offset += 4; + + // 4 Unknown bytes + guint32 unknown = 0; + memcpy(p_p2p->buff_out + offset, &unknown, 4); + offset += 4; + + return offset; +} + +static guint32 gfire_p2p_connection_write_data(gfire_p2p_connection *p_p2p, guint8 p_encoding, + const guint8 *p_data, guint32 p_data_length, + const gchar *p_category, guint32 p_offset) +{ + if(!p_p2p || !p_category || strlen(p_category) > 16 || !p_data || p_data_length == 0) + return 0; + + guint8 *checksum_start = p_p2p->buff_out + p_offset; + + // 4 unknown bytes + memset(p_p2p->buff_out + p_offset, 0, 4); + p_offset += 4; + + // Data + memcpy(p_p2p->buff_out + p_offset, p_data, p_data_length); + p_offset += p_data_length; + + // Category + memcpy(p_p2p->buff_out + p_offset, p_category, strlen(p_category)); + p_offset += strlen(p_category); + memset(p_p2p->buff_out + p_offset, 0, 16 - strlen(p_category)); + p_offset += 16 - strlen(p_category); + + // CRC32 checksum + guint32 checksum = GUINT32_TO_LE(gfire_crc32(checksum_start, (p_p2p->buff_out + p_offset) - checksum_start)); + memcpy(p_p2p->buff_out + p_offset, &checksum, 4); + p_offset += 4; + + // Encode data + if(p_encoding != 0x0) + { + while(checksum_start < (p_p2p->buff_out + p_offset)) + { + *checksum_start ^= p_encoding; + checksum_start++; + } + } + + return p_offset; +} + +static gfire_p2p_packet_resend *gfire_p2p_packet_resend_create(gfire_p2p_session *p_session, guint8 p_encoding, + const guint8 *p_moniker, guint32 p_type, + guint32 p_msgid, guint32 p_seqid, guint32 p_data_len, + const guint8 *p_data, const gchar *p_category) +{ + if(!p_session || !p_moniker) + return NULL; + + // Abort on invalid data packages + if((p_type == GFIRE_P2P_TYPE_DATA16 || p_type == GFIRE_P2P_TYPE_DATA32) && (!p_data || !p_data_len || !p_category)) + return NULL; + + gfire_p2p_packet_resend *ret = g_malloc0(sizeof(gfire_p2p_packet_resend)); + + ret->encoding = p_encoding; + + ret->moniker = g_malloc0(20); + memcpy(ret->moniker, p_moniker, 20); + + ret->type = p_type; + ret->msgid = p_msgid; + ret->seqid = p_seqid; + + if(p_data_len > 0) + { + ret->data_len = p_data_len; + ret->data = g_malloc0(p_data_len); + memcpy(ret->data, p_data, p_data_len); + + ret->category = g_strdup(p_category); + } + + GTimeVal gtv; + g_get_current_time(>v); + + ret->last_try = gtv.tv_sec; + ret->session = p_session; + + return ret; +} + +static void gfire_p2p_packet_resend_free(gfire_p2p_packet_resend *p_packet) +{ + if(!p_packet) + return; + + if(p_packet->moniker) + g_free(p_packet->moniker); + + if(p_packet->data) + g_free(p_packet->data); + + if(p_packet->category) + g_free(p_packet->category); + + g_free(p_packet); +} + +static void gfire_p2p_packet_resend_send(gfire_p2p_packet_resend *p_packet, gfire_p2p_connection *p_p2p, + guint8 p_encoding) +{ + if(!p_packet || !p_p2p) + return; + + guint32 offset = 0; + switch(p_packet->type) + { + case GFIRE_P2P_TYPE_DATA16: + case GFIRE_P2P_TYPE_DATA32: + offset = gfire_p2p_connection_write_header(p_p2p, p_encoding, p_packet->moniker, p_packet->type, + p_packet->msgid, p_packet->seqid, p_packet->data_len); + if(offset == 0) + return; + + offset = gfire_p2p_connection_write_data(p_p2p, p_encoding, p_packet->data, p_packet->data_len, + p_packet->category, offset); + if(offset == 0) + return; + + gfire_p2p_connection_send(p_p2p, gfire_p2p_session_get_peer_addr(p_packet->session, GF_P2P_ADDR_TYPE_USE), + offset); + break; + default: + purple_debug_warning("gfire", "P2P: gfire_p2p_packet_resend_send: unknown packet type!"); + } + + p_packet->retries++; +} + +static void gfire_p2p_connection_send(gfire_p2p_connection *p_p2p, const struct sockaddr_in *p_addr, guint32 p_len) +{ + if(!p_p2p || !p_addr || !p_len) + return; + + guint32 sent = sendto(p_p2p->socket, p_p2p->buff_out, p_len, 0, (struct sockaddr*)p_addr, sizeof(struct sockaddr_in)); + if(sent != p_len) + purple_debug_warning("gfire", "P2P: Sent too less bytes!\n"); +#ifdef DEBUG + else + purple_debug_misc("gfire", "P2P: %u bytes sent\n", p_len); +#endif // DEBUG +} + +// Returns the Session ID (msgid of ping) +guint32 gfire_p2p_connection_send_ping(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_moniker || !p_addr) + return 0; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, 0, p_moniker, GFIRE_P2P_TYPE_PING, + (p_sessid > 0) ? p_sessid : p_p2p->msgid, 0, 0); + if(offset == 0) + return 0; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); + + if(p_sessid == 0) + { + p_p2p->msgid++; + return (p_p2p->msgid - 1); + } + else + return p_sessid; +} + +// Returns the Session ID (msgid of pong if p_sessid == 0) +guint32 gfire_p2p_connection_send_pong(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_moniker || !p_addr) + return 0; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, 0, p_moniker, GFIRE_P2P_TYPE_PONG, + (p_sessid > 0) ? p_sessid : p_p2p->msgid, 0, 0); + if(offset == 0) + return 0; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); + + if(p_sessid == 0) + { + p_p2p->msgid++; + return (p_p2p->msgid - 1); + } + else + return p_sessid; +} + +static void gfire_p2p_connection_send_ack(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_msgid, guint32 p_seqid, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_moniker || !p_addr) + return; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, 0, p_moniker, GFIRE_P2P_TYPE_ACK, p_msgid, p_seqid, 0); + if(offset == 0) + return; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); +} + +static void gfire_p2p_connection_send_bad_crc32(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_msgid, guint32 p_seqid, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_moniker || !p_addr) + return; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, 0, p_moniker, GFIRE_P2P_TYPE_BADCRC, p_msgid, p_seqid, 0); + if(offset == 0) + return; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); +} + +void gfire_p2p_connection_send_keep_alive(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_moniker || !p_addr) + return; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, 0, p_moniker, GFIRE_P2P_TYPE_KEEP_ALIVE_REQ, + p_sessid, 0, 0); + if(offset == 0) + return; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); +} + +void gfire_p2p_connection_send_keep_alive_reply(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_moniker || !p_addr) + return; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, 0, p_moniker, GFIRE_P2P_TYPE_KEEP_ALIVE_REP, + p_sessid, 0, 0); + if(offset == 0) + return; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); +} + +void gfire_p2p_connection_send_data16(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session, + guint8 p_encoding, const guint8 *p_moniker, + guint32 p_seqid, const guint8 *p_data, guint16 p_data_len, + const gchar *p_category, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_session || !p_moniker || !p_data || p_data_len == 0 || !p_category || !p_addr) + return; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, p_encoding, p_moniker, GFIRE_P2P_TYPE_DATA16, + p_p2p->msgid, p_seqid, p_data_len); + if(offset == 0) + return; + + offset = gfire_p2p_connection_write_data(p_p2p, p_encoding, p_data, p_data_len, p_category, offset); + if(offset == 0) + return; + + p_p2p->msgid++; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); + gfire_p2p_packet_resend *packet = gfire_p2p_packet_resend_create(p_session, p_encoding, p_moniker, + GFIRE_P2P_TYPE_DATA16, p_p2p->msgid - 1, + p_seqid, p_data_len, p_data, p_category); + if(packet) + p_p2p->packets = g_list_append(p_p2p->packets, packet); +} + +void gfire_p2p_connection_send_data32(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session, + guint8 p_encoding, const guint8 *p_moniker, + guint32 p_seqid, const guint8 *p_data, guint32 p_data_len, + const gchar *p_category, const struct sockaddr_in *p_addr) +{ + if(!p_p2p || !p_session || !p_moniker || !p_data || p_data_len == 0 || !p_category || !p_addr) + return; + + guint32 offset = gfire_p2p_connection_write_header(p_p2p, p_encoding, p_moniker, GFIRE_P2P_TYPE_DATA32, + p_p2p->msgid, p_seqid, p_data_len); + if(offset == 0) + return; + + offset = gfire_p2p_connection_write_data(p_p2p, p_encoding, p_data, p_data_len, p_category, offset); + if(offset == 0) + return; + + p_p2p->msgid++; + + gfire_p2p_connection_send(p_p2p, p_addr, offset); + gfire_p2p_packet_resend *packet = gfire_p2p_packet_resend_create(p_session, p_encoding, p_moniker, + GFIRE_P2P_TYPE_DATA32, p_p2p->msgid - 1, + p_seqid, p_data_len, p_data, p_category); + if(packet) + p_p2p->packets = g_list_append(p_p2p->packets, packet); +} + +static gboolean gfire_p2p_connection_resend(gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return FALSE; + + GTimeVal gtv; + g_get_current_time(>v); + + GList *cur = p_p2p->packets; + while(cur) + { + gfire_p2p_packet_resend *packet = (gfire_p2p_packet_resend*)cur->data; + if(gtv.tv_sec - GFIRE_P2P_PACKET_TIMEOUT >= packet->last_try) + { + if(packet->retries == GFIRE_P2P_MAX_RETRIES) + { + gfire_p2p_packet_resend_free(packet); + p_p2p->packets = g_list_delete_link(p_p2p->packets, cur); + cur = p_p2p->packets; + + continue; + } + gfire_p2p_packet_resend_send(packet, p_p2p, 0x33 + packet->retries * 0x33); + } + + cur = g_list_next(cur); + } + + return TRUE; +} + +static void gfire_p2p_connection_input_cb(gpointer p_data, gint p_fd, PurpleInputCondition p_condition) +{ + if(!p_data || !(p_condition & PURPLE_INPUT_READ)) + return; + + gfire_p2p_connection *p2p = p_data; + + struct sockaddr_in addr; + memset(&addr, 0, sizeof(addr)); + socklen_t addrlen = sizeof(addr); + int length = recvfrom(p2p->socket, p2p->buff_in, GFIRE_P2P_BUFFER_LEN, 0, (struct sockaddr*)&addr, &addrlen); +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: %u bytes received\n", length); +#endif // DEBUG + + if(length < 44) + { + purple_debug_warning("gfire", "P2P: received invalid packet\n"); + return; + } + + guint8 encoding = *p2p->buff_in; + guint32 offset = 4; + + GList *session = p2p->sessions; + while(session) + { + if(gfire_p2p_session_is_by_moniker_peer(session->data, p2p->buff_in + offset)) + break; + + session = g_list_next(session); + } + + if(!session) + { + purple_debug_warning("gfire", "P2P: packet for unknown session\n"); + return; + } + + guint32 ip = g_ntohl(addr.sin_addr.s_addr); + guint16 port = g_ntohs(addr.sin_port); + gfire_p2p_session_set_addr(session->data, GF_P2P_ADDR_TYPE_USE, ip, port); + + offset += 20; + + guint32 type; + memcpy(&type, p2p->buff_in + offset, 4); + type = GUINT32_FROM_LE(type); + offset += 4; + + guint32 msgid; + memcpy(&msgid, p2p->buff_in + offset, 4); + msgid = GUINT32_FROM_LE(msgid); + offset += 4; + + guint32 seqid; + memcpy(&seqid, p2p->buff_in + offset, 4); + seqid = GUINT32_FROM_LE(seqid); + offset += 4; + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Packet: Type = %u; MsgID = %u; SeqID = %u\n", type, msgid, seqid); +#endif // DEBUG + + switch(type) + { + case GFIRE_P2P_TYPE_PING: + gfire_p2p_session_ping(session->data); + break; + case GFIRE_P2P_TYPE_PONG: + gfire_p2p_session_pong(session->data); + break; + case GFIRE_P2P_TYPE_ACK: + { + // Remove packet from resend queue + GList *cur = p2p->packets; + while(cur) + { + gfire_p2p_packet_resend *packet = cur->data; + if(packet->session == session->data && packet->msgid == msgid && packet->seqid == seqid) + { + gfire_p2p_packet_resend_free(packet); + p2p->packets = g_list_delete_link(p2p->packets, cur); + break; + } + + cur = g_list_next(cur); + } + break; + } + case GFIRE_P2P_TYPE_BADCRC: + { + // Force immediate rebuilding & resending + GList *cur = p2p->packets; + while(cur) + { + gfire_p2p_packet_resend *packet = cur->data; + if(packet->session == session->data && packet->msgid == msgid && packet->seqid == seqid) + { + gfire_p2p_packet_resend_send(packet, p2p, 0); + if(packet->retries == GFIRE_P2P_MAX_RETRIES) + { + gfire_p2p_packet_resend_free(packet); + p2p->packets = g_list_delete_link(p2p->packets, cur); + } + break; + } + + cur = g_list_next(cur); + } + break; + } + case GFIRE_P2P_TYPE_KEEP_ALIVE_REQ: + gfire_p2p_session_keep_alive_request(session->data); + break; + case GFIRE_P2P_TYPE_KEEP_ALIVE_REP: + gfire_p2p_session_keep_alive_response(session->data); + break; + case GFIRE_P2P_TYPE_DATA16: + case GFIRE_P2P_TYPE_DATA32: + { + guint32 size; + memcpy(&size, p2p->buff_in + offset, 4); + size = GUINT32_FROM_LE(size); + offset += 4; + + if(length < (68 + size)) + { + purple_debug_warning("gfire", "P2P: Received too short packet\n"); + break; + } + + guint32 crc_offset = offset + 4; + guint8 *crc_data = p2p->buff_in + crc_offset; + + // Decode + if(encoding != 0x00) + { +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Decoding encoded packet with value %u\n", encoding); +#endif // DEBUG + guint32 i = 0; + for(; i < (4 + size + 16 + 4/* unknown + data + category + crc32 */); i++) + *(crc_data + i) ^= encoding; + } + + // Unknown + offset += 8; + + void *data = p2p->buff_in + offset; + + offset += size; + + gchar category[17]; + category[16] = 0; + memcpy(category, p2p->buff_in + offset, 16); + offset += 16; + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "P2P: Category: %s\n", category); +#endif // DEBUG_VERBOSE + + guint32 crc32; + memcpy(&crc32, p2p->buff_in + offset, 4); + crc32 = GUINT32_FROM_LE(crc32); + + if(crc32 != gfire_crc32(crc_data, offset - crc_offset)) + { + purple_debug_warning("gfire", "P2P: Received data packet with incorrect CRC-32\n"); + gfire_p2p_connection_send_bad_crc32(p2p, gfire_p2p_session_get_moniker_self(session->data), + msgid, seqid, + gfire_p2p_session_get_peer_addr(session->data, + GF_P2P_ADDR_TYPE_USE)); + return; + } + + gfire_p2p_session_handle_data(session->data, type, seqid, data, size, category); + + gfire_p2p_connection_send_ack(p2p, gfire_p2p_session_get_moniker_self(session->data), msgid, seqid, + gfire_p2p_session_get_peer_addr(session->data, GF_P2P_ADDR_TYPE_USE)); + break; + } + default: + purple_debug_warning("gfire", "P2P: unknown packet type (0x%x) received\n", type); + break; + } +} + +static void gfire_p2p_connection_nat_cb(int p_type, guint32 p_ip, guint16 p_port, gpointer p_data) +{ + if(!p_data) + return; + + gfire_p2p_connection *p2p = (gfire_p2p_connection*)p_data; + + gfire_p2p_natcheck_destroy(p2p->nat_check); + p2p->nat_check = NULL; + + p2p->natType = p_type; + p2p->ext_ip = p_ip; + p2p->ext_port = p_port; + + // Check successfull, start listening + if(p2p->natType > 0) + { + p2p->prpl_inpa = purple_input_add(p2p->socket, PURPLE_INPUT_READ, gfire_p2p_connection_input_cb, p2p); + + p2p->resend_source = g_timeout_add_seconds(GFIRE_P2P_PACKET_TIMEOUT, + (GSourceFunc)gfire_p2p_connection_resend, p2p); + } + // Check unsuccessfull -> no P2P possible -> close the socket, we don't need it anyway + else + { + close(p2p->socket); + p2p->socket = -1; + } +} + +static void gfire_p2p_connection_listen_cb(int p_fd, gpointer p_data) +{ + if(!p_data) + return; + + gfire_p2p_connection *p2p = (gfire_p2p_connection*)p_data; + + p2p->listen_data = NULL; + + p2p->socket = p_fd; + + purple_debug_info("gfire", "P2P: Connection created on port %u\n", purple_network_get_port_from_fd(p_fd)); + + // Start NAT Type check + p2p->nat_check = gfire_p2p_natcheck_create(); + gfire_p2p_natcheck_start(p2p->nat_check, p_fd, gfire_p2p_connection_nat_cb, p2p); +} + +gfire_p2p_connection *gfire_p2p_connection_create() +{ + gfire_p2p_connection *ret = g_malloc0(sizeof(gfire_p2p_connection)); + if(!ret) + return NULL; + + ret->buff_in = g_malloc0(GFIRE_P2P_BUFFER_LEN); + if(!ret->buff_in) + { + g_free(ret); + return NULL; + } + + ret->buff_out = g_malloc0(GFIRE_P2P_BUFFER_LEN); + if(!ret->buff_out) + { + g_free(ret->buff_in); + g_free(ret); + return NULL; + } + + ret->socket = -1; + ret->msgid = 1; + + // Use random port (or from a range specified in Pidgins settings) + if(!(ret->listen_data = purple_network_listen_range(0, 0, SOCK_DGRAM, gfire_p2p_connection_listen_cb, ret))) + { + g_free(ret->buff_in); + g_free(ret->buff_out); + g_free(ret); + return NULL; + } + + return ret; +} + +void gfire_p2p_connection_close(gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return; + + if(p_p2p->listen_data) + purple_network_listen_cancel(p_p2p->listen_data); + + gfire_p2p_natcheck_destroy(p_p2p->nat_check); + + if(p_p2p->prpl_inpa > 0) + purple_input_remove(p_p2p->prpl_inpa); + + if(p_p2p->resend_source > 0) + g_source_remove(p_p2p->resend_source); + + if(p_p2p->sessions) + g_list_free(p_p2p->sessions); + + while(p_p2p->packets) + { + gfire_p2p_packet_resend_free(p_p2p->packets->data); + p_p2p->packets = g_list_delete_link(p_p2p->packets, p_p2p->packets); + } + + if(p_p2p->socket >= 0) + close(p_p2p->socket); + + if(p_p2p->buff_in) g_free(p_p2p->buff_in); + if(p_p2p->buff_out) g_free(p_p2p->buff_out); + + g_free(p_p2p); + + purple_debug_info("gfire", "P2P: Connection closed\n"); +} + +int gfire_p2p_connection_natType(const gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return 0; + + return p_p2p->natType; +} + +gboolean gfire_p2p_connection_running(const gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return FALSE; + + return (p_p2p->socket >= 0 && p_p2p->natType > 0); +} + +guint32 gfire_p2p_connection_local_ip(const gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return 0; + + const char *ip_str = purple_network_get_local_system_ip(p_p2p->socket); + + guint32 ip = 0; + memcpy(&ip, purple_network_ip_atoi(ip_str), 4); + return g_ntohl(ip); +} + +guint16 gfire_p2p_connection_local_port(const gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return 0; + + return purple_network_get_port_from_fd(p_p2p->socket); +} + +guint16 gfire_p2p_connection_port(const gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return 0; + + return p_p2p->ext_port; +} + +guint32 gfire_p2p_connection_ip(const gfire_p2p_connection *p_p2p) +{ + if(!p_p2p) + return 0; + + return p_p2p->ext_ip; +} + +void gfire_p2p_connection_add_session(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session) +{ + if(!p_p2p || !p_session) + return; + + gfire_p2p_session_bind(p_session, p_p2p); + p_p2p->sessions = g_list_append(p_p2p->sessions, p_session); + + purple_debug_info("gfire", "P2P: New session added (%u active)\n", g_list_length(p_p2p->sessions)); +} + +void gfire_p2p_connection_remove_session(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session) +{ + if(!p_p2p || !p_p2p->sessions || !p_session) + return; + + GList *session = g_list_find(p_p2p->sessions, p_session); + if(!session) + return; + + // Remove all pending packets belonging to this session + GList *cur_packet = p_p2p->packets; + while(cur_packet) + { + gfire_p2p_packet_resend *packet = cur_packet->data; + if(packet->session == p_session) + { + gfire_p2p_packet_resend_free(packet); + p_p2p->packets = g_list_delete_link(p_p2p->packets, cur_packet); + cur_packet = p_p2p->packets; + continue; + } + + cur_packet = g_list_next(cur_packet); + } + + p_p2p->sessions = g_list_delete_link(p_p2p->sessions, session); + + purple_debug_info("gfire", "P2P: Session removed (%u left)\n", g_list_length(p_p2p->sessions)); +} diff -Nru gfire-0.8.3/src/gf_p2p_dl_handler.c gfire-0.9.4/src/gf_p2p_dl_handler.c --- gfire-0.8.3/src/gf_p2p_dl_handler.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_dl_handler.c 2011-03-15 15:58:37.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_p2p_dl_handler.h" +#include "gf_p2p_dl_proto.h" + +gboolean gfire_p2p_dl_handler_handle(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "handling DL packet\n"); +#endif // DEBUG_VERBOSE + + guint32 offset = 4; + guint16 type; + + memcpy(&type, p_data + offset, 2); + type = GUINT16_FROM_LE(type); + offset += 3; + + switch(type) + { + case 0x3E87: + return gfire_p2p_dl_proto_file_request(p_session, p_data + offset, p_len); + case 0x3E88: + return gfire_p2p_dl_proto_file_request_reply(p_session, p_data + offset, p_len); + case 0x3E89: + return gfire_p2p_dl_proto_file_chunk_info_request(p_session, p_data + offset, p_len); + case 0x3E8A: + return gfire_p2p_dl_proto_file_chunk_info(p_session, p_data + offset, p_len); + case 0x3E8B: + return gfire_p2p_dl_proto_file_data_packet_request(p_session, p_data + offset, p_len); + case 0x3E8C: + return gfire_p2p_dl_proto_file_data_packet(p_session, p_data + offset, p_len); + case 0x3E8D: + return gfire_p2p_dl_proto_file_completion_msg(p_session, p_data + offset, p_len); + case 0x3E8E: + return gfire_p2p_dl_proto_file_event(p_session, p_data + offset, p_len); + default: + purple_debug_warning("gfire", "P2P: unknown type for DL category (%u)\n", type); + return FALSE; + } +} diff -Nru gfire-0.8.3/src/gf_p2p_dl_handler.h gfire-0.9.4/src/gf_p2p_dl_handler.h --- gfire-0.8.3/src/gf_p2p_dl_handler.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_dl_handler.h 2011-03-14 20:23:03.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_P2P_DL_HANDLER_H +#define _GF_P2P_DL_HANDLER_H + +#include "gf_base.h" +#include "gf_p2p_session.h" + +// GFIRE P2P DL DATA HANDLER +gboolean gfire_p2p_dl_handler_handle(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); + +#endif // _GF_P2P_DL_HANDLER_H diff -Nru gfire-0.8.3/src/gf_p2p_dl_proto.c gfire-0.9.4/src/gf_p2p_dl_proto.c --- gfire-0.8.3/src/gf_p2p_dl_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_dl_proto.c 2011-03-17 19:00:56.000000000 +0000 @@ -0,0 +1,556 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_p2p_dl_proto.h" +#include "gf_filetransfer.h" +#include "gf_protocol.h" +#include "gf_network.h" + +// For now this function always tells the peer to send the complete file again +guint32 gfire_p2p_dl_proto_send_file_request(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_size, + const gchar *p_name, const gchar *p_desc, guint32 p_mtime) +{ + if(!p_session || !p_name || !p_desc) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + offset = gfire_proto_write_attr_ss("filename", 0x01, p_name, strlen(p_name), offset); + offset = gfire_proto_write_attr_ss("desc", 0x01, p_desc, strlen(p_desc), offset); + + guint64 size = GUINT64_TO_LE(p_size); + offset = gfire_proto_write_attr_ss("size", 0x07, &size, 8, offset); + + p_mtime = GUINT32_TO_LE(p_mtime); + offset = gfire_proto_write_attr_ss("mtime", 0x02, &p_mtime, 4, offset); + + gfire_proto_write_header32(offset, 0x3E87, 5, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending file transfer request\n"); + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_request_reply(gfire_p2p_session *p_session, guint32 p_fileid, gboolean p_reply) +{ + if(!p_session) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + + guint8 reply = p_reply ? 1 : 0; + offset = gfire_proto_write_attr_ss("reply", 0x08, &reply, 1, offset); + + gfire_proto_write_header32(offset, 0x3E88, 2, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending file transfer request reply\n"); + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_event(gfire_p2p_session *p_session, guint32 p_fileid, + guint32 p_event, guint32 p_type) +{ + if(!p_session) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + p_event = GUINT32_TO_LE(p_event); + offset = gfire_proto_write_attr_ss("event", 0x02, &p_event, 4, offset); + p_type = GUINT32_TO_LE(p_type); + offset = gfire_proto_write_attr_ss("type", 0x02, &p_type, 4, offset); + + gfire_proto_write_header32(offset, 0x3E8E, 3, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending file event\n"); + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_chunk_info_request(gfire_p2p_session *p_session, guint32 p_fileid, + guint64 p_offset, guint32 p_chunk_size, + guint32 p_chunk_count, guint32 p_msgid) +{ + if(!p_session) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + + p_offset = GUINT64_TO_LE(p_offset); + offset = gfire_proto_write_attr_ss("offset", 0x07, &p_offset, 8, offset); + + p_chunk_size = GUINT32_TO_LE(p_chunk_size); + offset = gfire_proto_write_attr_ss("size", 0x02, &p_chunk_size, 4, offset); + + p_chunk_count = GUINT32_TO_LE(p_chunk_count); + offset = gfire_proto_write_attr_ss("chunkcnt", 0x02, &p_chunk_count, 4, offset); + + p_msgid = GUINT32_TO_LE(p_msgid); + offset = gfire_proto_write_attr_ss("msgid", 0x02, &p_msgid, 4, offset); + + gfire_proto_write_header32(offset, 0x3E89, 5, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Sending chunk info request for bytes %lu - %lu\n", + p_offset, p_offset + p_chunk_size); +#endif // DEBUG + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_chunk_info(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_offset, + guint32 p_size, const gchar *p_checksum, guint32 p_msgid) +{ + if(!p_session || !p_checksum) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + + p_offset = GUINT64_TO_LE(p_offset); + offset = gfire_proto_write_attr_ss("offset", 0x07, &p_offset, 8, offset); + + p_size = GUINT32_TO_LE(p_size); + offset = gfire_proto_write_attr_ss("size", 0x02, &p_size, 4, offset); + + offset = gfire_proto_write_attr_ss("checksum", 0x01, p_checksum, strlen(p_checksum), offset); + + p_msgid = GUINT32_TO_LE(p_msgid); + offset = gfire_proto_write_attr_ss("msgid", 0x02, &p_msgid, 4, offset); + + gfire_proto_write_header32(offset, 0x3E8A, 5, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Sending chunk info\n"); +#endif // DEBUG + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_data_packet_request(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_offset, + guint32 p_size, guint32 p_msgid) +{ + if(!p_session) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + + p_offset = GUINT64_TO_LE(p_offset); + offset = gfire_proto_write_attr_ss("offset", 0x07, &p_offset, 8, offset); + + p_size = GUINT32_TO_LE(p_size); + offset = gfire_proto_write_attr_ss("size", 0x02, &p_size, 4, offset); + + p_msgid = GUINT32_TO_LE(p_msgid); + offset = gfire_proto_write_attr_ss("msgid", 0x02, &p_msgid, 4, offset); + + gfire_proto_write_header32(offset, 0x3E8B, 4, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Sending request for data packet at offset=%lu size=%u\n", GUINT64_FROM_LE(p_offset), GUINT32_FROM_LE(p_size)); +#endif // DEBUG + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_data_packet(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_offset, + guint32 p_size, const guint8 *p_data, guint32 p_msgid) +{ + if(!p_session || !p_data) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + + p_offset = GUINT64_TO_LE(p_offset); + offset = gfire_proto_write_attr_ss("offset", 0x07, &p_offset, 8, offset); + + p_size = GUINT32_TO_LE(p_size); + offset = gfire_proto_write_attr_ss("size", 0x02, &p_size, 4, offset); + + GList *data = NULL; + guint32 i; + for(i = 0; i < p_size; i++) + data = g_list_append(data, (gpointer)(p_data + i)); + + offset = gfire_proto_write_attr_list_ss("data", data, 0x08, 1, offset); + + g_list_free(data); + + p_msgid = GUINT32_TO_LE(p_msgid); + offset = gfire_proto_write_attr_ss("msgid", 0x02, &p_msgid, 4, offset); + + gfire_proto_write_header32(offset, 0x3E8C, 5, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Sending data packet\n"); +#endif // DEBUG + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +guint32 gfire_p2p_dl_proto_send_file_complete(gfire_p2p_session *p_session, guint32 p_fileid) +{ + if(!p_session) + return 0; + + guint32 offset = GFIRE_P2P_HEADER_LEN; + + p_fileid = GUINT32_TO_LE(p_fileid); + offset = gfire_proto_write_attr_ss("fileid", 0x02, &p_fileid, 4, offset); + + gfire_proto_write_header32(offset, 0x3E8D, 1, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending file completion message\n"); + gfire_p2p_session_send_data32_packet(p_session, tmp_buf, offset, "DL"); + g_free(tmp_buf); + + return offset; +} + +// Receiving +gboolean gfire_p2p_dl_proto_file_request(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid, mtime; + guint64 size; + gchar *name = NULL, *desc = NULL; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_string_ss(p_data, &name, "filename", offset); + offset = gfire_proto_read_attr_string_ss(p_data, &desc, "desc", offset); + offset = gfire_proto_read_attr_int64_ss(p_data, &size, "size", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &mtime, "mtime", offset); + + gchar *size_str = purple_str_size_to_units(size); + purple_debug_info("gfire", "File request for file \"%s\" of size %s\n", name, size_str); + g_free(size_str); + + PurpleXfer *xfer = purple_xfer_new(purple_connection_get_account(gfire_p2p_session_get_buddy(p_session)->gc), + PURPLE_XFER_RECEIVE, + gfire_buddy_get_name(gfire_p2p_session_get_buddy(p_session))); + if(!xfer) + { + purple_debug_warning("gfire", "gfire_p2p_dl_handler_file_info: xfer creation failed\n"); + // This is an internal error, so just deny the request + gfire_p2p_dl_proto_send_file_request_reply(p_session, fileid, FALSE); + return TRUE; + } + + g_strstrip(desc); + gchar *msg = g_strdup_printf(_("File Description: %s"), (strlen(desc) > 0) ? desc : _("No description entered")); + g_free(desc); + + purple_xfer_set_filename(xfer, name); + purple_xfer_set_message(xfer, msg); + purple_xfer_set_size(xfer, size); + + g_free(name); + g_free(msg); + + gfire_filetransfer *ft = gfire_filetransfer_create(p_session, xfer, fileid); + if(!ft) + { + // This is an internal error, so just deny the request + gfire_p2p_dl_proto_send_file_request_reply(p_session, fileid, FALSE); + return TRUE; + } + gfire_filetransfer_start(ft); + gfire_p2p_session_add_recv_file_transfer(p_session, ft); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_request_reply(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid; + gboolean reply; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_boolean_ss(p_data, &reply, "reply", offset); + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received file request reply for unknown file!\n"); + return FALSE; + } + + gfire_filetransfer_request_reply(ft, reply); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_event(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid, event, type; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &event, "event", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &type, "type", offset); + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received event for unknown file!\n"); + return FALSE; + } + + purple_debug_misc("gfire", "P2P: Received event for file\n"); + + gfire_filetransfer_event(ft, event, type); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_chunk_info_request(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid, size, chunk_count, msgid; + guint64 foffset; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_int64_ss(p_data, &foffset, "offset", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &size, "size", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &chunk_count, "chunkcnt", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &msgid, "msgid", offset); + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received file transfer info for unknown file!\n"); + return FALSE; + } + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Received file chunk info request: offset=%lu size=%u chunkcnt=%u\n", foffset, size, chunk_count); +#endif // DEBUG + + gfire_filetransfer_chunk_info_request(ft, foffset, size, chunk_count, msgid); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_chunk_info(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid, chunk_size, msgid; + guint64 foffset; + gchar *checksum; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_int64_ss(p_data, &foffset, "offset", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &chunk_size, "size", offset); + offset = gfire_proto_read_attr_string_ss(p_data, &checksum, "checksum", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &msgid, "msgid", offset); + + // Invalid chunk + if(chunk_size == 0 || !checksum || strlen(checksum) != 40) + return FALSE; + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received chunk info for unknown file!\n"); + return FALSE; + } + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Chunk info: Bytes %lu - %lu: %s\n", foffset, foffset + chunk_size, checksum); +#endif // DEBUG + + gfire_filetransfer_chunk_info(ft, foffset, chunk_size, checksum); + g_free(checksum); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_data_packet_request(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid, chunk_size, msgid; + guint64 foffset; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_int64_ss(p_data, &foffset, "offset", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &chunk_size, "size", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &msgid, "msgid", offset); + + // Invalid chunk request + if(chunk_size == 0) + return FALSE; + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received file chunk request for unknown file!\n"); + return FALSE; + } + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: Received request for chunk at offset=%lu with size of %u bytes\n", foffset, chunk_size); +#endif // DEBUG + + gfire_filetransfer_data_packet_request(ft, foffset, chunk_size, msgid); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_data_packet(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid, chunk_size, msgid; + guint64 foffset; + GList *data = NULL; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + offset = gfire_proto_read_attr_int64_ss(p_data, &foffset, "offset", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &chunk_size, "size", offset); + offset = gfire_proto_read_attr_list_ss(p_data, &data, "data", offset); + offset = gfire_proto_read_attr_int32_ss(p_data, &msgid, "msgid", offset); + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received file chunk for unknown file!\n"); + gfire_list_clear(data); + return FALSE; + } + +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: received file chunk of %u bytes for offset=%lu\n", chunk_size, foffset); +#endif // DEBUG + + if((foffset + chunk_size) > ft->size) + { + purple_debug_error("gfire", "P2P: Received invalid chunk!\n"); + gfire_list_clear(data); + return TRUE; + } + + gfire_filetransfer_data_packet(ft, foffset, chunk_size, data); + gfire_list_clear(data); + + return TRUE; +} + +gboolean gfire_p2p_dl_proto_file_completion_msg(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data || !p_len) + return FALSE; + + guint32 fileid; + + guint32 offset = 0; + offset = gfire_proto_read_attr_int32_ss(p_data, &fileid, "fileid", offset); + + gfire_filetransfer *ft = gfire_p2p_session_find_file_transfer(p_session, fileid); + if(!ft) + { + purple_debug_warning("gfire", "P2P: Received completion message for unknown file!\n"); + return FALSE; + } + + purple_debug_misc("gfire", "P2P: Received completion message\n"); + + gfire_filetransfer_complete(ft); + + return TRUE; +} diff -Nru gfire-0.8.3/src/gf_p2p_dl_proto.h gfire-0.9.4/src/gf_p2p_dl_proto.h --- gfire-0.8.3/src/gf_p2p_dl_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_dl_proto.h 2011-03-15 15:58:19.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_P2P_DL_PROTO_H +#define _GF_P2P_DL_PROTO_H + +#include "gf_p2p_session.h" +#include "gf_base.h" + +// Packet sending +guint32 gfire_p2p_dl_proto_send_file_request(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_size, + const gchar *p_name, const gchar *p_desc, guint32 p_mtime); +guint32 gfire_p2p_dl_proto_send_file_request_reply(gfire_p2p_session *p_session, guint32 p_fileid, gboolean p_reply); +guint32 gfire_p2p_dl_proto_send_file_event(gfire_p2p_session *p_session, guint32 p_fileid, + guint32 p_event, guint32 p_type); +guint32 gfire_p2p_dl_proto_send_file_chunk_info_request(gfire_p2p_session *p_session, guint32 p_fileid, + guint64 p_offset, guint32 p_chunk_size, + guint32 p_chunk_count, guint32 p_msgid); +guint32 gfire_p2p_dl_proto_send_file_chunk_info(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_offset, + guint32 p_size, const gchar *p_checksum, guint32 p_msgid); +guint32 gfire_p2p_dl_proto_send_file_data_packet_request(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_offset, + guint32 p_size, guint32 p_msgid); +guint32 gfire_p2p_dl_proto_send_file_data_packet(gfire_p2p_session *p_session, guint32 p_fileid, guint64 p_offset, + guint32 p_size, const guint8 *p_data, guint32 p_msgid); +guint32 gfire_p2p_dl_proto_send_file_complete(gfire_p2p_session *p_session, guint32 p_fileid); + +// Packet parsing +gboolean gfire_p2p_dl_proto_file_request(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_request_reply(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_event(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_chunk_info_request(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_chunk_info(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_data_packet_request(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_data_packet(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); +gboolean gfire_p2p_dl_proto_file_completion_msg(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len); + +#endif // _GF_P2P_DL_PROTO_H diff -Nru gfire-0.8.3/src/gf_p2p.h gfire-0.9.4/src/gf_p2p.h --- gfire-0.8.3/src/gf_p2p.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p.h 2011-03-14 20:23:20.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_P2P_H +#define _GF_P2P_H + +typedef struct _gfire_p2p_packet_resend gfire_p2p_packet_resend; +typedef struct _gfire_p2p_connection gfire_p2p_connection; + +#include "gf_base.h" +#include "network.h" +#include "gf_p2p_natcheck.h" +#include "gf_p2p_session.h" + +#define GFIRE_P2P_BUFFER_LEN 131072 // 128 KB +#define GFIRE_P2P_HEADER_LEN 7 +#define GFIRE_P2P_PACKET_TIMEOUT 5 // in sec +#define GFIRE_P2P_MAX_RETRIES 4 // packets will be sent max. +1 time + +// P2P Packet Types +#define GFIRE_P2P_TYPE_DATA32 0x0000 +#define GFIRE_P2P_TYPE_PING 0x0010 +#define GFIRE_P2P_TYPE_PONG 0x0020 +#define GFIRE_P2P_TYPE_ACK 0x0040 +#define GFIRE_P2P_TYPE_BADCRC 0x0080 +#define GFIRE_P2P_TYPE_DATA16 0x0300 +#define GFIRE_P2P_TYPE_KEEP_ALIVE_REQ 0x0800 +#define GFIRE_P2P_TYPE_KEEP_ALIVE_REP 0x1000 + +struct _gfire_p2p_packet_resend +{ + guint8 encoding; + guint8 *moniker; + guint32 type; + guint32 msgid; + guint32 seqid; + guint32 data_len; + guint8 *data; + gchar *category; + + guint8 retries; + glong last_try; + + gfire_p2p_session *session; +}; + +struct _gfire_p2p_connection +{ + // Input callback + gint prpl_inpa; + + // Resend timeout + guint resend_source; + + // Socket + PurpleNetworkListenData *listen_data; + int socket; + + // NAT Type Check + gfire_p2p_natcheck *nat_check; + int natType; + guint32 ext_ip; + guint16 ext_port; + + // Buffers + guint8 *buff_out; + guint8 *buff_in; + + // State + guint32 msgid; + + // Packets which are waiting to be resent (no ack yet) + GList *packets; + + // Sessions bound to this connection + GList *sessions; +}; + +// Creation/Freeing +gfire_p2p_connection *gfire_p2p_connection_create(); +void gfire_p2p_connection_close(gfire_p2p_connection *p_p2p); + +// Status +int gfire_p2p_connection_natType(const gfire_p2p_connection *p_p2p); +gboolean gfire_p2p_connection_running(const gfire_p2p_connection *p_p2p); +guint32 gfire_p2p_connection_local_ip(const gfire_p2p_connection *p_p2p); +guint16 gfire_p2p_connection_local_port(const gfire_p2p_connection *p_p2p); +guint16 gfire_p2p_connection_port(const gfire_p2p_connection *p_p2p); +guint32 gfire_p2p_connection_ip(const gfire_p2p_connection *p_p2p); + +// Sessions +void gfire_p2p_connection_add_session(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session); +void gfire_p2p_connection_remove_session(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session); + +// Sending +guint32 gfire_p2p_connection_send_ping(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr); +guint32 gfire_p2p_connection_send_pong(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr); +void gfire_p2p_connection_send_keep_alive(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr); +void gfire_p2p_connection_send_keep_alive_reply(gfire_p2p_connection *p_p2p, const guint8 *p_moniker, + guint32 p_sessid, const struct sockaddr_in *p_addr); +void gfire_p2p_connection_send_data16(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session, + guint8 p_encoding, const guint8 *p_moniker, + guint32 p_seqid, const guint8 *p_data, guint16 p_data_len, + const gchar *p_category, const struct sockaddr_in *p_addr); +void gfire_p2p_connection_send_data32(gfire_p2p_connection *p_p2p, gfire_p2p_session *p_session, + guint8 p_encoding, const guint8 *p_moniker, + guint32 p_seqid, const guint8 *p_data, guint32 p_data_len, + const gchar *p_category, const struct sockaddr_in *p_addr); + +#endif // _GF_P2P_H diff -Nru gfire-0.8.3/src/gf_p2p_im_handler.c gfire-0.9.4/src/gf_p2p_im_handler.c --- gfire-0.8.3/src/gf_p2p_im_handler.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_im_handler.c 2011-03-14 20:22:47.000000000 +0000 @@ -0,0 +1,203 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_p2p_im_handler.h" +#include "gf_buddies.h" +#include "gf_network.h" + +gboolean gfire_p2p_im_handler_handle(gfire_p2p_session *p_session, guint8 *p_data, guint32 p_len) +{ + if(!p_session || !p_data) + return FALSE; + + if(p_len < 60) + { + purple_debug_warning("gfire", "P2P: too small IM packet\n"); + return FALSE; + } + +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "handling IM packet\n"); +#endif // DEBUG_VERBOSE + + guint32 offset = 2; + guint16 type; + guint8 *sid = NULL; + guint8 num_attr = 0; + guint32 msgtype = 0; + guint32 imindex = 0; + gchar *im = NULL; + guint32 typing = 0; + + memcpy(&type, p_data + offset, 2); + type = GUINT16_FROM_LE(type); + offset += 3; + + // No IM packet + if(type != 0x02) + { + purple_debug_error("gfire", "P2P: invalid IM packet (wrong type %u)\n", type); + return FALSE; + } + + offset = gfire_proto_read_attr_sid_ss(p_data, &sid, "sid", offset); + if(!sid) + { + purple_debug_error("gfire", "P2P: invalid SID\n"); + return FALSE; + } + + offset = gfire_proto_read_attr_children_count_ss(p_data, &num_attr, "peermsg", offset); + if(offset == -1) + return FALSE; + + offset = gfire_proto_read_attr_int32_ss(p_data, &msgtype, "msgtype", offset); + if(offset == -1) + return FALSE; + + switch(msgtype) + { + // Instant message + case 0: + // IM index ("imindex") + offset = gfire_proto_read_attr_int32_ss(p_data, &imindex, "imindex", offset); + if(offset == -1) + return FALSE; + + // the IM itself ("im") + offset = gfire_proto_read_attr_string_ss(p_data, &im, "im", offset); + if(offset == -1 || !im) + return FALSE; + + gfire_buddy_got_im(gfire_p2p_session_get_buddy(p_session), imindex, im, TRUE); + break; + // ACK packet + case 1: + // got an ack packet from a previous IM sent + purple_debug_misc("gfire", "P2P: IM ack packet received.\n"); + + // IM index ("imindex") + offset = gfire_proto_read_attr_int32_ss(p_data, &imindex, "imindex", offset); + if(offset == -1) + return FALSE; + + gfire_buddy_got_im_ack(gfire_p2p_session_get_buddy(p_session), imindex); + break; + // Typing notification + case 3: + // IM index ("imindex") + offset = gfire_proto_read_attr_int32_ss(p_data, &imindex, "imindex", offset); + if(offset == -1) + return FALSE; + + // typing ("typing") + offset = gfire_proto_read_attr_int32_ss(p_data, &typing, "typing", offset); + if(offset == -1) + return FALSE; + + gfire_buddy_got_typing(gfire_p2p_session_get_buddy(p_session), typing == 1); + break; + // Unknown + default: + purple_debug_warning("gfire", "P2P: unknown IM msgtype %u.\n", msgtype); + return FALSE; + } + + return TRUE; +} + +void gfire_p2p_im_handler_send_im(gfire_p2p_session *p_session, const guint8 *p_sid, guint32 p_imindex, const gchar *p_msg) +{ + if(!p_session || !p_sid || !p_msg) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 msgtype = GUINT32_TO_LE(0); + p_imindex = GUINT32_TO_LE(p_imindex); + + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 3, offset); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + offset = gfire_proto_write_attr_ss("imindex", 0x02, &p_imindex, sizeof(p_imindex), offset); + offset = gfire_proto_write_attr_ss("im", 0x01, p_msg, strlen(p_msg), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending IM\n"); + gfire_p2p_session_send_data16_packet(p_session, tmp_buf, GUINT32_FROM_LE(offset), "IM"); + g_free(tmp_buf); +} + +void gfire_p2p_im_handler_send_ack(gfire_p2p_session *p_session, const guint8 *p_sid, guint32 p_imindex) +{ + if(!p_session || !p_sid) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 msgtype = GUINT32_TO_LE(1); + p_imindex = GUINT32_TO_LE(p_imindex); + + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 2, offset); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + offset = gfire_proto_write_attr_ss("imindex", 0x02, &p_imindex, sizeof(p_imindex), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending IM ack\n"); + gfire_p2p_session_send_data16_packet(p_session, tmp_buf, GUINT32_FROM_LE(offset), "IM"); + g_free(tmp_buf); +} + +void gfire_p2p_im_handler_send_typing(gfire_p2p_session *p_session, const guint8 *p_sid, guint32 p_imindex, gboolean p_typing) +{ + if(!p_session || !p_sid) + return; + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 msgtype = GUINT32_TO_LE(3); + p_imindex = GUINT32_TO_LE(p_imindex); + guint32 typing = GUINT32_TO_LE(p_typing ? 1 : 0); + + offset = gfire_proto_write_attr_ss("sid", 0x03, p_sid, XFIRE_SID_LEN, offset); + offset = gfire_proto_write_attr_ss("peermsg", 0x05, NULL, 3, offset); + offset = gfire_proto_write_attr_ss("msgtype", 0x02, &msgtype, sizeof(msgtype), offset); + offset = gfire_proto_write_attr_ss("imindex", 0x02, &p_imindex, sizeof(p_imindex), offset); + offset = gfire_proto_write_attr_ss("typing", 0x02, &typing, sizeof(typing), offset); + + gfire_proto_write_header(offset, 0x02, 2, 0); + + guint8 *tmp_buf = g_malloc0(offset); + gfire_network_buffout_copy(tmp_buf, offset); + + purple_debug_misc("gfire", "P2P: Sending typing notification\n"); + gfire_p2p_session_send_data16_packet(p_session, tmp_buf, GUINT32_FROM_LE(offset), "IM"); + g_free(tmp_buf); +} diff -Nru gfire-0.8.3/src/gf_p2p_im_handler.h gfire-0.9.4/src/gf_p2p_im_handler.h --- gfire-0.8.3/src/gf_p2p_im_handler.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_im_handler.h 2011-03-14 20:22:42.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_P2P_IM_HANDLER_H +#define _GF_P2P_IM_HANDLER_H + +#include "gf_base.h" +#include "gf_protocol.h" +#include "gf_p2p_session.h" + +// Parsing +gboolean gfire_p2p_im_handler_handle(gfire_p2p_session *p_session, guint8 *p_data, guint32 p_len); + +// Sending +void gfire_p2p_im_handler_send_im(gfire_p2p_session *p_session, const guint8 *p_sid, guint32 p_imindex, const gchar *p_msg); +void gfire_p2p_im_handler_send_ack(gfire_p2p_session *p_session, const guint8 *p_sid, guint32 p_imindex); +void gfire_p2p_im_handler_send_typing(gfire_p2p_session *p_session, const guint8 *p_sid, guint32 p_imindex, gboolean p_typing); + +#endif // _GF_P2P_IM_HANDLER_H diff -Nru gfire-0.8.3/src/gf_p2p_natcheck.c gfire-0.9.4/src/gf_p2p_natcheck.c --- gfire-0.8.3/src/gf_p2p_natcheck.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_natcheck.c 2011-03-14 20:22:38.000000000 +0000 @@ -0,0 +1,329 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_p2p_natcheck.h" + +gfire_p2p_natcheck *gfire_p2p_natcheck_create() +{ + gfire_p2p_natcheck *ret = g_malloc0(sizeof(gfire_p2p_natcheck)); + return ret; +} + +void gfire_p2p_natcheck_destroy(gfire_p2p_natcheck *p_nat) +{ + if(!p_nat) + return; + + if(p_nat->timeout) + g_source_remove(p_nat->timeout); + + if(p_nat->dnsdata) + purple_dnsquery_destroy(p_nat->dnsdata); + + if(p_nat->prpl_inpa) + purple_input_remove(p_nat->prpl_inpa); + + g_free(p_nat); +} + +static void gfire_p2p_natcheck_query(gfire_p2p_natcheck *p_nat, int p_server, int p_stage) +{ + static unsigned char packet[18] = { 'S', 'C', '0', '1', + 0x04, 0x5a, 0xcb, 0x00, + 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 }; + + p_stage = GINT32_TO_LE(p_stage); + memcpy(packet + 12, &p_stage, 4); + + guint16 port = g_htons(purple_network_get_port_from_fd(p_nat->socket)); + memcpy(packet + 16, &port, 2); + + purple_debug_misc("gfire", "P2P: NAT Check: Sending IP request to server %d...\n", p_server + 1); + sendto(p_nat->socket, packet, 18, 0, (struct sockaddr*)&p_nat->nat_servers[p_server], sizeof(struct sockaddr_in)); +} + +static gboolean gfire_p2p_natcheck_timeout(gpointer p_data) +{ + gfire_p2p_natcheck *nat = (gfire_p2p_natcheck*)p_data; + // Check whether the server really timed out... + if(++nat->retries == 5) + { + purple_debug_error("gfire", "P2P: NAT Check: Server %d timed out...check failed!\n", nat->server + 1); + purple_input_remove(nat->prpl_inpa); + nat->state = GF_NATCHECK_DONE; + if(nat->callback) nat->callback(0, 0, 0, nat->callback_data); + return FALSE; + } + // Query the server once again + gfire_p2p_natcheck_query(nat, nat->server, nat->stage); + + return TRUE; +} + +static void gfire_p2p_natcheck_udpread(gpointer p_data, gint p_fd, PurpleInputCondition p_condition) +{ + gfire_p2p_natcheck *nat = (gfire_p2p_natcheck*)p_data; + if(!nat) + return; + + static unsigned char buffer[10]; + + struct sockaddr_in addr; + guint addr_len = sizeof(addr); + int len = recvfrom(p_fd, buffer, 10, 0, (struct sockaddr*)&addr, &addr_len); + + if(len != 10) + { + purple_debug_error("gfire", "P2P: NAT Check: Received too less data\n"); + return; + } + + int server; + for(server = 0; server < 3; server++) + if(addr.sin_addr.s_addr == nat->nat_servers[server].sin_addr.s_addr) + break; + + if(server == 3) + { + guint32 ip = g_ntohl(addr.sin_addr.s_addr); + purple_debug_error("gfire", "P2P: NAT Check: Received response from unknown server (%u.%u.%u.%u:%u)\n", + (ip & 0xff000000) >> 24, + (ip & 0xff0000) >> 16, + (ip & 0xff00) >> 8, + ip & 0xff, + addr.sin_port); + return; + } + + if(memcmp(buffer, "CK01", 4) != 0) + { + purple_debug_error("gfire", "P2P: NAT Check: Received bad magic\n"); + return; + } + + if(g_ntohs(addr.sin_port) != XFIRE_NAT_PORT) + nat->multiple_ports = TRUE; + + guint32 ip = *(guint32*)(buffer + 4); + guint16 port = *(guint16*)(buffer + 8); + + if(nat->ips[server] != 0 && (nat->ips[server] != ip || nat->ports[server] != port)) + purple_debug_warning("gfire", "P2P: NAT Check: Server %d reports my IP:Port INCONSISTENTLY as %u.%u.%u.%u:%u\n", + server + 1, + (ip & 0xff000000) >> 24, + (ip & 0xff0000) >> 16, + (ip & 0xff00) >> 8, + ip & 0xff, + port); + else + purple_debug_misc("gfire", "P2P: NAT Check: Server %d reports my IP:Port as %u.%u.%u.%u:%u\n", + server + 1, + (ip & 0xff000000) >> 24, + (ip & 0xff0000) >> 16, + (ip & 0xff00) >> 8, + ip & 0xff, + port); + + nat->ips[server] = ip; + nat->ports[server] = port; + + // Some packet we do not need? (delay etc.) + if(server != nat->server) + return; + + if(server != 2) + { + nat->server++; + if((nat->server %= 2) == 0) + { + if(++nat->stage == 4) + { + // Checks are done, now print some info + if(nat->ips[0] == nat->ips[1] && nat->ports[0] == nat->ports[1]) + purple_debug_info("gfire", "P2P: NAT Check: UDP consistent translation:\tYES (GOOD for P2P)\n"); + else + purple_debug_warning("gfire", "P2P: NAT Check: UDP consistent translation:\tNO (BAD for P2P)\n"); + + if(nat->ips[2] == 0) + purple_debug_info("gfire", "P2P: NAT Check: UDP unsolicited messages filtered:\tYES (GOOD for security)\n"); + else + purple_debug_warning("gfire", "P2P: NAT Check: UDP unsolicited messages filtered:\tNO (BAD for security)\n"); + + + // Examine the data to build the Xfire NAT Type + if(nat->ips[0] == nat->ips[1] && nat->ports[0] == nat->ports[1]) + { + nat->type = 4; + if(nat->multiple_ports || nat->ips[2] == nat->ips[0] || nat->ips[2] == nat->ips[1]) + nat->type = 1; + } + else if(nat->ips[0] == nat->ips[1]) + nat->type = 2; + else + nat->type = 0; + + static const char *typeNames[] = { + "NAT Error", + "Full Cone or Restricted Cone NAT", + "Symmetric NAT", + "Symmetric NAT", + "Port-Restricted Cone NAT" + }; + + purple_debug_info("gfire", "P2P: NAT Check: check finished; Your Xfire NAT Type is %d - %s\n", nat->type, + typeNames[nat->type]); + + g_source_remove(nat->timeout); + nat->timeout = 0; + nat->state = GF_NATCHECK_DONE; + if(nat->callback) nat->callback(nat->type, nat->ips[0], nat->ports[0], nat->callback_data); + return; + } + } + + // Query the next server + nat->retries = 0; + g_source_remove(nat->timeout); + nat->timeout = g_timeout_add_seconds(2, gfire_p2p_natcheck_timeout, nat); + gfire_p2p_natcheck_query(nat, nat->server, nat->stage); + } +} + +static void gfire_p2p_natcheck_start_query(gfire_p2p_natcheck *p_nat) +{ + p_nat->state = GF_NATCHECK_RUNNING; + + p_nat->server = 0; + p_nat->stage = 1; + p_nat->prpl_inpa = purple_input_add(p_nat->socket, PURPLE_INPUT_READ, gfire_p2p_natcheck_udpread, p_nat); + + purple_debug_misc("gfire", "P2P: NAT Check: Starting IP requests...\n"); + p_nat->timeout = g_timeout_add_seconds(2, gfire_p2p_natcheck_timeout, p_nat); + gfire_p2p_natcheck_query(p_nat, p_nat->server, p_nat->stage); +} + +static void gfire_p2p_natcheck_dnsquery(GSList *p_hosts, gpointer p_data, const char *p_error) +{ + gfire_p2p_natcheck *nat = (gfire_p2p_natcheck*)p_data; + if(!nat) + return; + + if(!p_hosts) + { + purple_debug_error("gfire", "P2P: NAT Check: Hostname lookup failed for \"%s\"\n", purple_dnsquery_get_host(nat->dnsdata)); + nat->state = GF_NATCHECK_DONE; + nat->type = 0; + if(nat->callback) nat->callback(0, 0, 0, nat->callback_data); + return; + } + + int server = -1; + switch(nat->state) + { + case GF_NATCHECK_DNS1: + server = 0; break; + case GF_NATCHECK_DNS2: + server = 1; break; + case GF_NATCHECK_DNS3: + server = 2; break; + default: + break; + } + + GSList *hosts = p_hosts; + while(hosts) + { + size_t len = GPOINTER_TO_INT(hosts->data); + hosts = g_slist_next(hosts); + + struct sockaddr *addr = (struct sockaddr*)hosts->data; + if(addr->sa_family == AF_INET) + { + memset(&nat->nat_servers[server], 0, sizeof(struct sockaddr_in)); + memcpy(&nat->nat_servers[server], addr, len); + } + g_free(addr); + + hosts = g_slist_next(hosts); + } + g_slist_free(p_hosts); + + purple_debug_misc("gfire", "P2P: NAT Check: Server %d: %u.%u.%u.%u\n", server + 1, + (g_ntohl(nat->nat_servers[server].sin_addr.s_addr) & 0xff000000) >> 24, + (g_ntohl(nat->nat_servers[server].sin_addr.s_addr) & 0xff0000) >> 16, + (g_ntohl(nat->nat_servers[server].sin_addr.s_addr) & 0xff00) >> 8, + g_ntohl(nat->nat_servers[server].sin_addr.s_addr) & 0xff); + + nat->dnsdata = NULL; + + switch(nat->state) + { + case GF_NATCHECK_DNS1: + nat->state = GF_NATCHECK_DNS2; + nat->dnsdata = purple_dnsquery_a(XFIRE_NAT_SERVER2, XFIRE_NAT_PORT, gfire_p2p_natcheck_dnsquery, nat); + break; + case GF_NATCHECK_DNS2: + nat->state = GF_NATCHECK_DNS3; + nat->dnsdata = purple_dnsquery_a(XFIRE_NAT_SERVER3, XFIRE_NAT_PORT, gfire_p2p_natcheck_dnsquery, nat); + break; + case GF_NATCHECK_DNS3: + gfire_p2p_natcheck_start_query(nat); + break; + default: + break; + } +} + +gboolean gfire_p2p_natcheck_start(gfire_p2p_natcheck *p_nat, int p_socket, gfire_p2p_natcheck_callback p_callback, gpointer p_data) +{ + if(!p_nat || p_socket < 0 || (p_nat->state != GF_NATCHECK_NOSTATE && p_nat->state != GF_NATCHECK_DONE)) + return FALSE; + + // Callback + p_nat->callback = p_callback; + p_nat->callback_data = p_data; + + // Socket to use + p_nat->socket = p_socket; + + // Restore default state + p_nat->retries = 0; + p_nat->type = 0; + p_nat->multiple_ports = FALSE; + memset(p_nat->ips, 0, 3 * sizeof(guint32)); + memset(p_nat->ports, 0, 3 * sizeof(guint16)); + + // Start by resolving the DNS names of Xfires NAT test servers + purple_debug_info("gfire", "P2P: NAT Check: Starting NAT type check...\n"); + purple_debug_misc("gfire", "P2P: NAT Check: Resolving Xfire's NAT Check Servers hostnames...\n"); + + p_nat->state = GF_NATCHECK_DNS1; + p_nat->dnsdata = purple_dnsquery_a(XFIRE_NAT_SERVER1, XFIRE_NAT_PORT, gfire_p2p_natcheck_dnsquery, p_nat); + + return TRUE; +} + +gboolean gfire_p2p_natcheck_isdone(const gfire_p2p_natcheck *p_nat) +{ + return (p_nat->state == GF_NATCHECK_DONE); +} diff -Nru gfire-0.8.3/src/gf_p2p_natcheck.h gfire-0.9.4/src/gf_p2p_natcheck.h --- gfire-0.8.3/src/gf_p2p_natcheck.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_natcheck.h 2011-03-14 20:22:32.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_P2P_NATCHECK_H +#define _GF_P2P_NATCHECK_H + +typedef struct _gfire_p2p_natcheck gfire_p2p_natcheck; + +#include "gf_base.h" + +typedef void (*gfire_p2p_natcheck_callback)(int p_nat_type, guint32 p_ip, guint16 p_port, gpointer p_data); + +typedef enum _gfire_p2p_natcheck_state +{ + GF_NATCHECK_NOSTATE = 0, + GF_NATCHECK_DNS1, + GF_NATCHECK_DNS2, + GF_NATCHECK_DNS3, + GF_NATCHECK_RUNNING, + GF_NATCHECK_DONE +} gfire_p2p_natcheck_state; + +struct _gfire_p2p_natcheck +{ + int socket; + guint prpl_inpa; + + int stage, server; + guint timeout, retries; + gboolean multiple_ports; + guint32 ips[3]; + guint16 ports[3]; + + PurpleDnsQueryData *dnsdata; + struct sockaddr_in nat_servers[3]; + + gfire_p2p_natcheck_state state; + + int type; + gpointer callback_data; + gfire_p2p_natcheck_callback callback; +}; + +// Creation/Freeing +gfire_p2p_natcheck *gfire_p2p_natcheck_create(); +void gfire_p2p_natcheck_destroy(gfire_p2p_natcheck *p_nat); + +// Starting +gboolean gfire_p2p_natcheck_start(gfire_p2p_natcheck *p_nat, int p_socket, gfire_p2p_natcheck_callback p_callback, gpointer p_data); + +// Status +gboolean gfire_p2p_natcheck_isdone(const gfire_p2p_natcheck *p_nat); + +#endif // _GF_P2P_NATCHECK_H diff -Nru gfire-0.8.3/src/gf_p2p_session.c gfire-0.9.4/src/gf_p2p_session.c --- gfire-0.8.3/src/gf_p2p_session.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_session.c 2011-03-14 20:22:27.000000000 +0000 @@ -0,0 +1,481 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_p2p_session.h" +#include "gfire.h" +#include "gf_p2p.h" +#include "gf_p2p_im_handler.h" + +static void gfire_p2p_session_send_ping(gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_addrType) +{ + if(!p_session || !p_session->con) + return; + + p_session->need_pong = TRUE; + p_session->seqid = 0; + + GTimeVal gtv; + g_get_current_time(>v); + p_session->last_ping = gtv.tv_sec; + + p_session->sessid = gfire_p2p_connection_send_ping(p_session->con, p_session->moniker_self, p_session->sessid, + gfire_p2p_session_get_peer_addr(p_session, p_addrType)); +} + +static void gfire_p2p_session_send_pong(gfire_p2p_session *p_session) +{ + if(!p_session || !p_session->con) + return; + + // Reset the sequence + p_session->seqid = 0; + gfire_bitlist_clear(p_session->rec_seqids); + + // Send the pong + p_session->sessid = gfire_p2p_connection_send_pong(p_session->con, p_session->moniker_self, p_session->sessid, + gfire_p2p_session_get_peer_addr(p_session, GF_P2P_ADDR_TYPE_USE)); +} + +static void gfire_p2p_session_send_keep_alive(gfire_p2p_session *p_session) +{ + if(!p_session || !p_session->con) + return; + + p_session->need_keep_alive = TRUE; + GTimeVal gtv; + g_get_current_time(>v); + p_session->last_keep_alive = gtv.tv_sec; + + gfire_p2p_connection_send_keep_alive(p_session->con, p_session->moniker_self, p_session->sessid, + gfire_p2p_session_get_peer_addr(p_session, GF_P2P_ADDR_TYPE_USE)); +} + +void gfire_p2p_session_send_data16_packet(gfire_p2p_session *p_session, const guint8 *p_data, guint16 p_len, const gchar *p_category) +{ + if(!p_session || !p_session->con || !p_data || !p_len || !p_category) + return; + + gfire_p2p_connection_send_data16(p_session->con, p_session, 0, p_session->moniker_self, p_session->seqid++, + p_data, p_len, p_category, + gfire_p2p_session_get_peer_addr(p_session, GF_P2P_ADDR_TYPE_USE)); +} + +void gfire_p2p_session_send_data32_packet(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len, const gchar *p_category) +{ + if(!p_session || !p_session->con || !p_data || !p_len || !p_category) + return; + + gfire_p2p_connection_send_data32(p_session->con, p_session, 0, p_session->moniker_self, p_session->seqid++, + p_data, p_len, p_category, + gfire_p2p_session_get_peer_addr(p_session, GF_P2P_ADDR_TYPE_USE)); +} + +static gboolean gfire_p2p_session_check_cb(gfire_p2p_session *p_session) +{ + if(!p_session) + return FALSE; + + GTimeVal gtv; + g_get_current_time(>v); + + // Pong timeout check + if(p_session->need_pong && ((gtv.tv_sec - p_session->last_ping) > GFIRE_P2P_PACKET_TIMEOUT)) + { + if(p_session->ping_retries == GFIRE_P2P_MAX_RETRIES) + { + purple_debug_info("gfire", "P2P: Session timed out!\n"); + gfire_buddy_p2p_timedout(p_session->buddy); + + return FALSE; + } + + p_session->ping_retries++; + purple_debug_misc("gfire", "P2P: Resending ping packet (try %d of %u)\n", p_session->ping_retries + 1, GFIRE_P2P_MAX_RETRIES + 1); + if(!gfire_p2p_session_get_peer_ip(p_session, GF_P2P_ADDR_TYPE_USE)) + { + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_LOCAL); + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_EXTERN); + } + else + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_USE); + } + + // Keep-alive timeout check + if(p_session->need_keep_alive && ((gtv.tv_sec - p_session->last_keep_alive) > GFIRE_P2P_PACKET_TIMEOUT)) + { + if(p_session->keep_alive_retries == GFIRE_P2P_MAX_RETRIES) + { + purple_debug_info("gfire", "P2P: Session timed out!\n"); + gfire_buddy_p2p_timedout(p_session->buddy); + + return FALSE; + } + + p_session->keep_alive_retries++; + purple_debug_misc("gfire", "P2P: Resending keep-alive packet (try %d of %u)\n", p_session->keep_alive_retries + 1, GFIRE_P2P_MAX_RETRIES + 1); + gfire_p2p_session_send_keep_alive(p_session); + } + + // Keep-alive-handling + if(!p_session->need_keep_alive && (gtv.tv_sec >= (p_session->last_keep_alive + 60))) + { + purple_debug_misc("gfire", "P2P: Sending keep-alive\n"); + gfire_p2p_session_send_keep_alive(p_session); + } + + return TRUE; +} + +gfire_p2p_session *gfire_p2p_session_create(gfire_buddy *p_buddy, const gchar *p_salt) +{ + if(!p_buddy || !p_salt) + return NULL; + + gfire_p2p_session *ret = g_malloc0(sizeof(gfire_p2p_session)); + if(!ret) + return NULL; + + ret->peer_addr[0].sin_family = AF_INET; + ret->peer_addr[1].sin_family = AF_INET; + ret->peer_addr[2].sin_family = AF_INET; + + ret->moniker_self = g_malloc0(20); + ret->moniker_peer = g_malloc0(20); + + ret->need_pong = FALSE; + ret->need_keep_alive = FALSE; + + GTimeVal gtv; + g_get_current_time(>v); + ret->last_keep_alive = gtv.tv_sec; + + ret->rec_seqids = gfire_bitlist_new(); + + ret->buddy = p_buddy; + + // Generate the monikers + gchar *sid = gfire_hex_bin_to_str(p_buddy->sid, XFIRE_SID_LEN); + gchar *tohash = g_strdup_printf("%s%s", sid, p_salt); + hashSha1_to_bin(tohash, ret->moniker_peer); + g_free(sid); + g_free(tohash); + + sid = gfire_hex_bin_to_str(((gfire_data*)p_buddy->gc->proto_data)->sid, XFIRE_SID_LEN); + tohash = g_strdup_printf("%s%s", sid, p_salt); + hashSha1_to_bin(tohash, ret->moniker_self); + g_free(sid); + g_free(tohash); + + return ret; +} + +void gfire_p2p_session_free(gfire_p2p_session *p_session, gboolean p_local_reason) +{ + if(!p_session) + return; + + if(p_session->check_timer > 0) + g_source_remove(p_session->check_timer); + + while(p_session->transfers) + { + gfire_filetransfer_free(p_session->transfers->data, p_local_reason); + p_session->transfers = g_list_delete_link(p_session->transfers, p_session->transfers); + } + + gfire_bitlist_free(p_session->rec_seqids); + + g_free(p_session->moniker_self); + g_free(p_session->moniker_peer); + + g_free(p_session); +} + +void gfire_p2p_session_bind(gfire_p2p_session *p_session, gfire_p2p_connection *p_p2p) +{ + if(p_session && p_p2p) + p_session->con = p_p2p; +} + +void gfire_p2p_session_set_addr(gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type, guint32 p_ip, guint16 p_port) { + if(!p_session || !p_ip || !p_port) + return; + + if(!p_session->peer_addr[(int)p_type].sin_addr.s_addr) { + p_session->peer_addr[(int)p_type].sin_addr.s_addr = g_htonl(p_ip); + p_session->peer_addr[(int)p_type].sin_port = g_htons(p_port); + + // Send a handshake for NAT Type 2 and 3 buddies now as we have their address + if((p_session->peer_natType == 2 || p_session->peer_natType == 3) && p_type == GF_P2P_ADDR_TYPE_USE) + { + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_USE); + purple_debug_misc("gfire", "P2P: Handshake sent\n"); + } + } +} + +void gfire_p2p_session_start(gfire_p2p_session *p_session, guint32 p_natType) +{ + if(!p_session) + return; + + p_session->peer_natType = p_natType; + + // Send ping/handshake if we can actually send any data + if(!p_session->connected && p_natType != 2 && p_natType != 3) + { + if(!gfire_p2p_session_get_peer_ip(p_session, GF_P2P_ADDR_TYPE_USE)) + { + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_LOCAL); + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_EXTERN); + } + else + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_USE); + + purple_debug_misc("gfire", "P2P: Handshake sent\n"); + } + + p_session->check_timer = g_timeout_add_seconds(1, (GSourceFunc)gfire_p2p_session_check_cb, p_session); +} + +const guint8 *gfire_p2p_session_get_moniker_peer(const gfire_p2p_session *p_session) +{ + if(!p_session) + return NULL; + + return p_session->moniker_peer; +} + +const guint8 *gfire_p2p_session_get_moniker_self(const gfire_p2p_session *p_session) +{ + if(!p_session) + return NULL; + + return p_session->moniker_self; +} + +guint32 gfire_p2p_session_get_peer_ip(const gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type) +{ + if(!p_session) + return 0; + + return g_ntohl(p_session->peer_addr[(int)p_type].sin_addr.s_addr); +} + +guint16 gfire_p2p_session_get_peer_port(const gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type) +{ + if(!p_session) + return 0; + + return g_ntohs(p_session->peer_addr[(int)p_type].sin_port); +} + +const struct sockaddr_in *gfire_p2p_session_get_peer_addr(const gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type) +{ + if(!p_session) + return NULL; + + return &(p_session->peer_addr[(int)p_type]); +} + +gfire_buddy *gfire_p2p_session_get_buddy(const gfire_p2p_session *p_session) +{ + if(!p_session) + return NULL; + + return p_session->buddy; +} + +gboolean gfire_p2p_session_is_by_moniker_peer(const gfire_p2p_session *p_session, const guint8 *p_moniker) +{ + if(!p_session) + return FALSE; + + return (memcmp(p_session->moniker_peer, p_moniker, 20) == 0); +} + +gboolean gfire_p2p_session_is_by_moniker_self(const gfire_p2p_session *p_session, const guint8 *p_moniker) +{ + if(!p_session) + return FALSE; + + return (memcmp(p_session->moniker_self, p_moniker, 20) == 0); +} + +void gfire_p2p_session_ping(gfire_p2p_session *p_session) +{ + if(!p_session) + return; + + gfire_p2p_session_send_pong(p_session); + gfire_bitlist_clear(p_session->rec_seqids); + + if(!p_session->connected) + gfire_p2p_session_send_ping(p_session, GF_P2P_ADDR_TYPE_USE); +} + +void gfire_p2p_session_pong(gfire_p2p_session *p_session) +{ + if(!p_session) + return; + + if(!p_session->connected) + { + // Start requested file transfers as soon as we are connected + GList *cur = p_session->transfers; + while(cur) + { + gfire_filetransfer_start(cur->data); + cur = g_list_next(cur); + } + + p_session->connected = TRUE; + gfire_buddy_p2p_connected(p_session->buddy); + } + p_session->need_pong = FALSE; +} + +void gfire_p2p_session_keep_alive_request(gfire_p2p_session *p_session) +{ + if(p_session && p_session->con) + gfire_p2p_connection_send_keep_alive_reply(p_session->con, p_session->moniker_self, p_session->sessid, + gfire_p2p_session_get_peer_addr(p_session, GF_P2P_ADDR_TYPE_USE)); +} + +void gfire_p2p_session_keep_alive_response(gfire_p2p_session *p_session) +{ + if(p_session) + p_session->need_keep_alive = FALSE; +} + +gboolean gfire_p2p_session_handle_data(gfire_p2p_session *p_session, guint32 p_type, guint32 p_seqid, void *p_data, guint32 p_len, const gchar *p_category) +{ + if(!p_session || !p_data || !p_category) + return FALSE; + + // Check for duplicate messages + if(gfire_bitlist_get(p_session->rec_seqids, p_seqid)) + { + purple_debug_misc("gfire", "P2P: Received duplicate message, ignoring it\n"); + return TRUE; + } + + gboolean result = TRUE; + + // Data 32bit size + if(p_type == GFIRE_P2P_TYPE_DATA32) + { +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "P2P: Received 32bit data packet\n"); +#endif // DEBUG_VERBOSE + + if(g_utf8_collate(p_category, "DL") == 0) + { +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: received DL packet\n"); +#endif // DEBUG + result = gfire_p2p_dl_handler_handle(p_session, p_data, p_len); + } + else + purple_debug_warning("gfire", "P2P: received unknown data packet (category \"%s\")\n", p_category); + } + // Data 16bit size + else if(p_type == GFIRE_P2P_TYPE_DATA16) + { +#ifdef DEBUG_VERBOSE + purple_debug_misc("gfire", "P2P: Received 16bit data packet\n"); +#endif // DEBUG_VERBOSE + + if(g_utf8_collate(p_category, "IM") == 0) + { +#ifdef DEBUG + purple_debug_misc("gfire", "P2P: received IM packet\n"); +#endif // DEBUG + result = gfire_p2p_im_handler_handle(p_session, p_data, p_len); + } + else + purple_debug_warning("gfire", "P2P: received unknown data packet (category \"%s\")\n", p_category); + } + + // Add this packet to the received ones + if(result) + gfire_bitlist_set(p_session->rec_seqids, p_seqid, TRUE); + + return result; +} + +void gfire_p2p_session_add_file_transfer(gfire_p2p_session *p_session, PurpleXfer *p_xfer) +{ + if(!p_session || !p_xfer) + return; + + gfire_filetransfer *ft = gfire_filetransfer_create(p_session, p_xfer, 0); + if(!ft) + return; + + if(p_session->connected) + gfire_filetransfer_start(ft); + else + purple_xfer_conversation_write(p_xfer, _("Please wait until a connection with your buddy has been established!"), FALSE); + + p_session->transfers = g_list_append(p_session->transfers, ft); +} + +void gfire_p2p_session_add_recv_file_transfer(gfire_p2p_session *p_session, gfire_filetransfer *p_transfer) +{ + if(!p_session || !p_transfer) + return; + + p_session->transfers = g_list_append(p_session->transfers, p_transfer); +} + +void gfire_p2p_session_remove_file_transfer(gfire_p2p_session *p_session, gfire_filetransfer *p_transfer, gboolean p_local_reason) +{ + if(!p_session || !p_transfer) + return; + + GList *ft = g_list_find(p_session->transfers, p_transfer); + if(ft) + { + gfire_filetransfer_free(p_transfer, p_local_reason); + p_session->transfers = g_list_delete_link(p_session->transfers, ft); + } +} + +gfire_filetransfer *gfire_p2p_session_find_file_transfer(gfire_p2p_session *p_session, guint32 p_fileid) +{ + if(!p_session) + return NULL; + + GList *ft = g_list_first(p_session->transfers); + for(; ft; ft = g_list_next(ft)) + { + if(((gfire_filetransfer*)ft->data)->fileid == p_fileid) + return ft->data; + } + + return NULL; +} + +gboolean gfire_p2p_session_connected(const gfire_p2p_session *p_session) +{ + return (p_session && p_session->connected); +} diff -Nru gfire-0.8.3/src/gf_p2p_session.h gfire-0.9.4/src/gf_p2p_session.h --- gfire-0.8.3/src/gf_p2p_session.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_p2p_session.h 2011-03-14 20:22:21.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_P2P_SESSION_H +#define _GF_P2P_SESSION_H + +typedef struct _gfire_p2p_session gfire_p2p_session; + +#include "gf_base.h" +#include "gf_buddies.h" +#include "gf_p2p.h" +#include "gf_p2p_dl_handler.h" +#include "gf_filetransfer.h" + +typedef enum _gfire_p2p_session_addr_type { + GF_P2P_ADDR_TYPE_LOCAL = 0, + GF_P2P_ADDR_TYPE_EXTERN = 1, + GF_P2P_ADDR_TYPE_USE = 2 +} gfire_p2p_session_addr_type; + +struct _gfire_p2p_session +{ + guint8 *moniker_self; + guint8 *moniker_peer; + + struct sockaddr_in peer_addr[3]; + guint32 peer_natType; + + gfire_p2p_connection *con; + + guint32 sessid; + guint32 seqid; + + // File Transfers + GList *transfers; + + // Timeout handling + // Ping + gboolean need_pong; + guint8 ping_retries; + // Keep-Alive + gboolean need_keep_alive; + guint8 keep_alive_retries; + + // Received seqIDs + gfire_bitlist *rec_seqids; + + gboolean init; + + guint check_timer; + glong last_ping; + glong last_keep_alive; + + gboolean connected; + + gfire_buddy *buddy; +}; + +// Creation and initialization +gfire_p2p_session *gfire_p2p_session_create(gfire_buddy *p_buddy, const gchar *p_salt); +void gfire_p2p_session_free(gfire_p2p_session *p_session, gboolean p_local_reason); + +void gfire_p2p_session_bind(gfire_p2p_session *p_session, gfire_p2p_connection *p_p2p); +void gfire_p2p_session_set_addr(gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type, guint32 p_ip, guint16 p_port); +void gfire_p2p_session_start(gfire_p2p_session *p_session, guint32 p_natType); + +// Getting information +const guint8 *gfire_p2p_session_get_moniker_peer(const gfire_p2p_session *p_session); +const guint8 *gfire_p2p_session_get_moniker_self(const gfire_p2p_session *p_session); + +guint32 gfire_p2p_session_get_peer_ip(const gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type); +guint16 gfire_p2p_session_get_peer_port(const gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type); +const struct sockaddr_in *gfire_p2p_session_get_peer_addr(const gfire_p2p_session *p_session, gfire_p2p_session_addr_type p_type); + +gfire_buddy *gfire_p2p_session_get_buddy(const gfire_p2p_session *p_session); + +gboolean gfire_p2p_session_connected(const gfire_p2p_session *p_session); + +// Sending +gboolean gfire_p2p_session_can_send(const gfire_p2p_session *p_session); +void gfire_p2p_session_send_data16_packet(gfire_p2p_session *p_session, const guint8 *p_data, guint16 p_len, const gchar *p_category); +void gfire_p2p_session_send_data32_packet(gfire_p2p_session *p_session, const guint8 *p_data, guint32 p_len, const gchar *p_category); + +// Identifying +gboolean gfire_p2p_session_is_by_moniker_peer(const gfire_p2p_session *p_session, const guint8 *p_moniker); +gboolean gfire_p2p_session_is_by_moniker_self(const gfire_p2p_session *p_session, const guint8 *p_moniker); + +// Data handling +void gfire_p2p_session_ping(gfire_p2p_session *p_session); +void gfire_p2p_session_pong(gfire_p2p_session *p_session); +void gfire_p2p_session_keep_alive_request(gfire_p2p_session *p_session); +void gfire_p2p_session_keep_alive_response(gfire_p2p_session *p_session); +gboolean gfire_p2p_session_handle_data(gfire_p2p_session *p_session, guint32 p_type, guint32 p_seqid, void *p_data, guint32 p_len, const gchar *p_category); + +// File Transfers +void gfire_p2p_session_add_file_transfer(gfire_p2p_session *p_session, PurpleXfer *p_xfer); +void gfire_p2p_session_add_recv_file_transfer(gfire_p2p_session *p_session, gfire_filetransfer *p_transfer); +void gfire_p2p_session_remove_file_transfer(gfire_p2p_session *p_session, gfire_filetransfer *p_transfer, gboolean p_local_reason); +gfire_filetransfer *gfire_p2p_session_find_file_transfer(gfire_p2p_session *p_session, guint32 p_fileid); + +#endif // _GF_P2P_SESSION_H diff -Nru gfire-0.8.3/src/gf_packet.c gfire-0.9.4/src/gf_packet.c --- gfire-0.8.3/src/gf_packet.c 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_packet.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1766 +0,0 @@ -/* - * purple - Xfire Protocol Plugin - * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * - * This file is part of Gfire. - * - * Gfire is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 Gfire. If not, see . -*/ - -#include "gfire.h" - -#include "gf_network.h" -#include "gf_packet.h" -#include "gf_chat.h" - -#include "cipher.h" - - - -void gfire_add_header(guint8 *packet, int length, int type, int atts) -{ - guint8 buffer[5] = { 0,0,0,0,(guint8) atts }; - guint16 l = GUINT16_TO_LE((guint16) length); - guint16 t = GUINT16_TO_LE((guint16) type); - - memcpy(buffer,&l,2); - memcpy(buffer+2,&t,2); - memcpy(packet,buffer,XFIRE_HEADER_LEN); -} - - -int gfire_add_att_name(guint8 *packet,int packet_length, char *att) -{ - packet[packet_length] = (guint8)strlen(att);//set att length - memcpy(packet+packet_length+1,att,strlen(att)); //set attname - return packet_length+1+strlen(att); -} - -int gfire_read_attrib(GList **values, guint8 *buffer, int packet_len, const char *name, - gboolean dynamic, gboolean binary, int bytes_to_first, int bytes_between, int vallen) -{ - int index = 0; int i=0; int ali = 0; int alen = 0; - gchar tmp[100]; - guint16 numitems = 0; guint16 attr_len = 0; - guint8 *str; - - memset(tmp, 0x00, 100); - - - if (NULL == name) { - /* don't look for attribute name just proccess the items */ - memcpy(&numitems, buffer + index, 2); - numitems = GUINT16_FROM_LE(numitems); - index += 2; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Looking for %d items's in packet.\n", numitems); - } else { - alen = strlen(name); - memcpy(tmp, buffer + index, alen); - index += strlen(name); - if ( 0 == g_ascii_strcasecmp(name, tmp)) { - index += 2; - memcpy(&numitems, buffer + index, 2); - numitems = GUINT16_FROM_LE(numitems); - index += 2; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "Looking for %d %s's in packet.\n", numitems, NN(name)); - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: %s signature isn't in the correct position.\n", NN(name)); - return -1; - } - } - /* if we are copying a string make sure we have a space for the trailing \0 */ - if (binary) ali = 0; - else ali = 1; - - for (i = 0; i < numitems; i++) { - if (dynamic) { - memcpy(&attr_len, buffer + index, 2); - attr_len = GUINT16_FROM_LE(attr_len); index+=2; - } else attr_len = vallen; - - if (dynamic && (attr_len == 0)) str = NULL; - else { - str = g_malloc0(sizeof(char) * (attr_len+ali)); - memcpy(str, buffer + index, attr_len); - if (!binary) str[attr_len] = 0x00; - } - index += attr_len; - *values = g_list_append(*values,(gpointer *)str); - if ( index > packet_len ) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: pkt 131: more friends then packet length.\n"); - return -1; - } - } - return index; -} - - -static void hashSha1(char* input,char* digest) -//based on code from purple_util_get_image_filename in the pidgin 2.2.0 source -{ - PurpleCipherContext *context; - - context = purple_cipher_context_new_by_name("sha1", NULL); - if (context == NULL) { - purple_debug_error("util", "Could not find sha1 cipher\n"); - g_return_val_if_reached(NULL); - } - - - purple_cipher_context_append(context, input, strlen(input)); - if (!purple_cipher_context_digest_to_str(context, 41, digest, NULL)){ - purple_debug_error("util", "Failed to get SHA-1 digest.\n"); - g_return_val_if_reached(NULL); - } - purple_cipher_context_destroy(context); - digest[40]=0; -} - - -int gfire_send_auth(PurpleConnection *gc, int packet_len, int packet_id) -{ - - char *passwd = (char *)purple_account_get_password(gc->account); - char *name = (char *)purple_account_get_username(gc->account); - char salt[41]; /*the salt we got from the server*/ - gfire_data *gfire = (gfire_data *)gc->proto_data; - char secret[] = "UltimateArena"; /*Secret string that is used to hash the passwd*/ - char sha_string[41]; - char hash_it[100]; - char hash_final[81]; - int index = 0; - - /* - * packet_length 00 type(01) 00 numberOfAtts - * attribute_length 'name' usernameLength_length usernameLength 00 username - * attribute_length 'password' passwdLength_length passwdLength 00 cryptedPassword - */ - - /* extract the salt from the packet and add a null terminator */ - memcpy(salt,gfire->buff_in+13, 40); - salt[40]=0x00; - - int pkt_len = 97+strlen(name); /*Packet length is 97 + username length*/ - - memset(gfire->buff_out,0x00,GFIRE_BUFFOUT_SIZE); - gfire_add_header(gfire->buff_out, pkt_len, 1, 3); /*add header*/ - index += 5; - - index = gfire_add_att_name(gfire->buff_out,index, "name");/*add name*/ - gfire->buff_out[index++] = 0x01; /*username length length*/ - gfire->buff_out[index++] = (char)strlen(name); /*username length*/ - gfire->buff_out[index++] = 0x00; - - memcpy(gfire->buff_out+index, name, strlen(name)); /* add username */ - index += strlen(name); - - index = gfire_add_att_name(gfire->buff_out,index, "password"); - gfire->buff_out[index++] = 0x01; /*hashed passwd length length*/ - gfire->buff_out[index++] = 0x28; /*hashed passwd length, always 40 (SHA1)*/ - gfire->buff_out[index++] = 0x00; - - hash_it[0] = 0; - strcat(hash_it,name); /*create string: name+passwd+secret*/ - strcat(hash_it,passwd); - strcat(hash_it,secret); - - hashSha1(hash_it,hash_final); - memcpy(hash_final+40,salt,40); /* mix it with the salt and rehash*/ - - hash_final[80] = 0x00; /*terminate the string*/ - - hashSha1(hash_final,sha_string); - - memcpy(gfire->buff_out+index,sha_string,strlen(sha_string));/*insert the hash of the passwd*/ - index += strlen(sha_string); - - /* added 09-08-2005 difference in login packet */ - index = gfire_add_att_name(gfire->buff_out,index, "flags");/*add flags*/ - gfire->buff_out[index++]=0x02; - - // run memset once, fill 25 char's with 0's this is from a packet capture - // they tack on "flags" + 4 bytes that are 0x00 + "sid" + 16 bytes that are 0x00 - - index+=4; - index = gfire_add_att_name(gfire->buff_out,index, "sid");/*add sid*/ - gfire->buff_out[index++] = 0x03; - - // rest of packet is 16 bytes filled with 0x00 - index+= 16; - - return index; -} - - -/* reads session information from intial login grabs our info */ -void gfire_packet_130(PurpleConnection *gc, int packet_len) -{ - gfire_data *gfire = NULL; - int index = XFIRE_HEADER_LEN + 1; - char tmp[100] = ""; - guint16 slen = 0; - - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return; - memcpy(tmp, gfire->buff_in + index, strlen("userid")); - tmp[strlen("userid")] = 0x00; - index += strlen("userid") + 1; - if (0 == g_ascii_strcasecmp("userid", tmp)) { - if (!gfire->userid) g_free(gfire->userid); - gfire->userid = g_malloc0(XFIRE_USERID_LEN); - memcpy(gfire->userid, gfire->buff_in + index, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN + 1; - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: pkt 130: userid not in correct position.\n"); - return; - } - index += 4; - if (!gfire->sid) g_free(gfire->sid); - gfire->sid = g_malloc0(XFIRE_SID_LEN); - memcpy(gfire->sid, gfire->buff_in + index, XFIRE_SID_LEN); - index += XFIRE_SID_LEN +6; - - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - index += sizeof(slen); - slen = GUINT16_FROM_LE(slen); - if (NULL != gfire->alias) g_free(gfire->alias); - gfire->alias = g_malloc0(slen + 1); - memcpy(gfire->alias, gfire->buff_in + index, slen); - if (slen > 0) gfire->alias[slen] = 0x00; - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(session): Our userid = %02x%02x%02x%02x, Our Alias = %s\n", - NNA(gfire->userid, gfire->userid[0]), NNA(gfire->userid, gfire->userid[1]), - NNA(gfire->userid, gfire->userid[2]), NNA(gfire->userid, gfire->userid[3]), NN(gfire->alias) ); -// FIXME("gfire_packet_130"); -} - - - -/* reads buddy list from server and populates purple blist */ -void gfire_packet_131(PurpleConnection *gc, int packet_len) -{ - int index, attrib, i = 0; - gfire_buddy *gf_buddy = NULL; - GList *friends = NULL; - GList *nicks = NULL; - GList *userids = NULL; - GList *f, *n, *u; - gchar uids[(XFIRE_USERID_LEN * 2) + 1]; - gfire_data *gfire = (gfire_data *)gc->proto_data; - - if (packet_len < 16) { - purple_debug_error("gfire", "packet 131 received, but too short. (%d bytes)\n", packet_len); - return; - } - - index = 6; - attrib = gfire_read_attrib(&friends, gfire->buff_in + index, packet_len - index, "friends", TRUE, FALSE, 0, 0, 0); - if (attrib < 1 && friends != NULL) return; - - index += attrib + 1; - attrib = gfire_read_attrib(&nicks, gfire->buff_in + index, packet_len - index, "nick", TRUE, FALSE, 0, 0, 0); - if (attrib < 1 ) { - if (friends != NULL) g_list_free(friends); - if (nicks != NULL) g_list_free(nicks); - return; - } - - index+= attrib + 1; - attrib = gfire_read_attrib(&userids, gfire->buff_in + index, packet_len - index, "userid", FALSE, TRUE, 0, 0, XFIRE_USERID_LEN); - if (attrib < 1 ) { - if (friends != NULL) g_list_free(friends); - if (nicks != NULL) g_list_free(nicks); - if (userids != NULL) g_list_free(userids); - return; - } - - friends = g_list_first(friends); - nicks = g_list_first(nicks); - userids = g_list_first(userids); - - f = friends; - n = nicks; - u = userids; - - while (f != NULL) - { - gf_buddy = g_malloc0(sizeof(gfire_buddy)); - gfire->buddies = g_list_append(gfire->buddies, (gpointer *)gf_buddy); - - gf_buddy->name = (gchar *)f->data; - gf_buddy->alias = (gchar *)n->data; - gf_buddy->userid = (guint8 *)u->data; - - if (gf_buddy->alias == NULL) gf_buddy->alias = g_strdup(gf_buddy->name); - - /* cast userid into string */ - for(i = 0; i < XFIRE_USERID_LEN; i++) g_sprintf(uids + (i * 2), "%02x", gf_buddy->userid[i]); - - uids[(XFIRE_USERID_LEN * 2)] = 0x00; - gf_buddy->uid_str = g_strdup(uids); - - f->data = NULL; - u->data = NULL; - n->data = NULL; - - f = g_list_next(f); - u = g_list_next(u); - n = g_list_next(n); - } - - g_list_free(friends); - g_list_free(nicks); - g_list_free(userids); - - n = gfire->buddies; - while (n != NULL) - { - gf_buddy = (gfire_buddy *)n->data; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "buddy info: %s, %s, %02x%02x%02x%02x, %s\n", - NN(gf_buddy->name), NN(gf_buddy->uid_str), NNA(gf_buddy->userid, gf_buddy->userid[0]), - NNA(gf_buddy->userid, gf_buddy->userid[1]), NNA(gf_buddy->userid, gf_buddy->userid[2]), - NNA(gf_buddy->userid, gf_buddy->userid[3]), NN(gf_buddy->alias)); - n = g_list_next(n); - } -} - - -GList *gfire_read_buddy_online(PurpleConnection *gc, int packet_len) -{ - guchar tmp[100]; - int index = 0; - int itmp = 0; - int i = 0; - guint8 *str = NULL; - GList *tmp_list = NULL; - GList *userids = NULL; - GList *sids = NULL; - GList *ret = NULL; - GList *u,*s; - gfire_buddy *gf_buddy = NULL; - gfire_data *gfire = (gfire_data *)gc->proto_data; - - memset((void *)tmp, 0x00, 100); - - if (packet_len < 16) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: packet 132 received but way too short?!? %d bytes\n", - packet_len); - return NULL; - } - - index = 6; - itmp = gfire_read_attrib(&userids, gfire->buff_in + index, packet_len - index, "userid", FALSE, TRUE, 0, 0, - XFIRE_USERID_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (userids) g_list_free(userids); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&sids, gfire->buff_in + index, packet_len - index, "sid", FALSE, TRUE, 0, 0, - XFIRE_SID_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (userids) g_list_free(userids); - if (sids) g_list_free(sids); - return NULL; - } - - userids = g_list_first(userids); - sids = g_list_first(sids); - u = userids; s = sids; - - while ( NULL != u ) { - tmp_list = gfire_find_buddy_in_list(gfire->buddies, u->data, GFFB_UIDBIN); - if (NULL == tmp_list) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: pkt 132: NULL pointer from buddy find\n") ; - //mem cleanup code - if (userids) g_list_free(userids); - if (sids) g_list_free(sids); - if (tmp_list) g_list_free(tmp_list); - return NULL; - } - gf_buddy = (gfire_buddy *)tmp_list->data; - str = (guint8 *) s->data; - if (NULL != gf_buddy->sid) g_free(gf_buddy->sid); - gf_buddy->sid = str; - /* covert sid to string */ - for(i = 0;i < XFIRE_SID_LEN;i++) g_sprintf((gchar *)tmp + (i*2), "%02x", str[i]); - tmp[XFIRE_SID_LEN*2]=0x00; - if (NULL != gf_buddy->sid_str) g_free(gf_buddy->sid_str); - gf_buddy->sid_str = g_strdup((gchar *)tmp); - /* clear away state, xfire presence state isn't persistent (unlike purple) */ - gf_buddy->away = FALSE; - if (NULL != gf_buddy->away_msg) g_free(gf_buddy->away_msg); - gf_buddy->away_msg = NULL; - ret = g_list_append(ret, (gpointer *)gf_buddy); - g_free(u->data); s->data = NULL; u->data = NULL; - u = g_list_next(u); s = g_list_next(s); - - if (!gf_buddy->away) - purple_prpl_got_user_status(gc->account, gf_buddy->name, "available", NULL); - - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(on/offline): got info for %s -> %s, %s\n", NN(gf_buddy->name), - NN(gf_buddy->sid_str), NN(gf_buddy->uid_str)); - - } - - g_list_free(userids); - g_list_free(sids); - return ret; -} - - - -int gfire_get_im(PurpleConnection *gc, int packet_len) -{ - guint8 sid[16], peermsg; - gchar tmp[100] = ""; - int index,i = 0; - guint16 ml = 0; - guint32 msgtype,imindex = 0; - gfire_im *im = NULL; - gfire_data *gfire = (gfire_data*)gc->proto_data; - - if (packet_len < 16) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: packet 133 recv'd but way too short?!? %d bytes\n", - packet_len); - return 0; - } - - index = 6; - /* check the packet for sid signature */ - memcpy(tmp, gfire->buff_in + index, strlen("sid")); - tmp[strlen("sid")]=0x00; - if ( 0 == g_ascii_strcasecmp("sid",(char *)tmp)) { - index+= strlen("sid") + 1; - memcpy(&sid, gfire->buff_in + index, XFIRE_SID_LEN); - index+= XFIRE_SID_LEN + 1; - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: pkt 133: sid signature isn't in the correct position.\n"); - return 0; - } - - /* get peer message */ - memcpy(tmp, gfire->buff_in + index, strlen("peermsg")); - tmp[strlen("peermsg")]=0x00; - if ( 0 == g_ascii_strcasecmp("peermsg",(char *)tmp)) { - index+= strlen("peermsg") + 1; - memcpy(&peermsg, gfire->buff_in + index, sizeof(peermsg)); - index+= 2; - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: pkt 133: peermsg signature isn't in the correct position.\n"); - return 0; - } - - /* get messsage type */ - memcpy(tmp, gfire->buff_in + index, strlen("msgtype")); - tmp[strlen("msgtype")]=0x00; - if ( 0 == g_ascii_strcasecmp("msgtype",(char *)tmp)) { - index+= strlen("msgtype") + 1; - memcpy(&msgtype, gfire->buff_in + index, sizeof(msgtype)); - index+= sizeof(msgtype) + 1; - msgtype = GUINT32_FROM_LE(msgtype); - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: pkt 133: msgtype signature isn't in the correct position.\n"); - return 0; - } - - switch (msgtype) - { - case 0: - /* got an im */ - /* get imindex */ - memcpy(tmp, gfire->buff_in + index, strlen("imindex")); - tmp[strlen("imindex")]=0x00; - if ( 0 == g_ascii_strcasecmp("imindex",(char *)tmp)) { - index+= strlen("imindex") + 1; - memcpy(&imindex, gfire->buff_in + index, sizeof(imindex)); - index+= sizeof(imindex); - imindex = GUINT32_FROM_LE(imindex); - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", - "ERROR: pkt 133: imindex signature isn't in the correct position.\n"); - return 0; - } - index++; - if (index > packet_len) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "ERROR: IM packet says IM but packet to short.\n"); - return 0; - } - /* get im */ - memcpy(tmp, gfire->buff_in + index, strlen("im")); - tmp[strlen("im")]=0x00; - if ( 0 == g_ascii_strcasecmp("im",(char *)tmp)) { - index+= strlen("im") + 1; - /* get im length */ - memcpy(&ml, gfire->buff_in + index, sizeof(ml)); - index+= sizeof(ml); - ml = GUINT16_FROM_LE(ml); - purple_debug(PURPLE_DEBUG_MISC, "gfire", "IM: im length = %d\n", ml); - /* get im string */ - gchar *im_str = g_malloc0(sizeof(gchar) * ml+1); - memcpy(im_str, gfire->buff_in + index, ml); - im_str[ml] = 0x00; - purple_debug(PURPLE_DEBUG_MISC, "gfire", "IM:(recvd): %s\n", NN(im_str)); - - im = g_malloc0(sizeof(gfire_im)); - gfire->im = im; - im->type = msgtype; - im->peer = peermsg; - im->index = imindex; - im->im_str = im_str; - /* covert sid to string */ - for(i = 0;i < XFIRE_SID_LEN;i++) g_sprintf((gchar *)tmp + (i*2), "%02x", sid[i]); - tmp[XFIRE_SID_LEN*2]=0x00; - im->sid_str = g_strdup(tmp); - - /* make response packet */ - memcpy(gfire->buff_out, gfire->buff_in, packet_len); - gfire_add_header(gfire->buff_out, 62, 2, 2); - gfire->buff_out[35] = 0x02; - gfire->buff_out[45] = 0x01; - return 62; - } else { - purple_debug(PURPLE_DEBUG_MISC, "gfire", - "ERROR: pkt 133: im signature isn't in the correct position.\n"); - return 0; - } - return 0; - break; - - case 1: - /* got an ack packet from a previous IM sent */ - purple_debug(PURPLE_DEBUG_MISC, "gfire", "IM ack packet recieved.\n"); - return 0; - break; - - case 2: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(im): Got P2P info.\n"); - im = g_malloc0(sizeof(gfire_im)); - gfire->im = im; - im->type = msgtype; - im->peer = peermsg; - im->index = 0; - im->im_str = NULL; - /* covert sid to string */ - for(i = 0;i < XFIRE_SID_LEN;i++) g_sprintf((gchar *)tmp + (i*2), "%02x", sid[i]); - tmp[XFIRE_SID_LEN*2]=0x00; - im->sid_str = g_strdup(tmp); - return 0; - break; - - case 3: - /* got typing from other user */ - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(im): Got typing info.\n"); - im = g_malloc0(sizeof(gfire_im)); - gfire->im = im; - im->type = msgtype; - im->peer = peermsg; - im->index = 0; - im->im_str = NULL; - /* covert sid to string */ - for(i = 0;i < XFIRE_SID_LEN;i++) g_sprintf((gchar *)tmp + (i*2), "%02x", sid[i]); - tmp[XFIRE_SID_LEN*2]=0x00; - im->sid_str = g_strdup(tmp); - return 0; - break; - - default: - purple_debug(PURPLE_DEBUG_MISC, "gfire", "unknown IM msgtype = %d.\n", msgtype); - return 0; - } - return 0; -} - - -int gfire_create_im(PurpleConnection *gc, gfire_buddy *buddy, const char *msg) -{ - int length = 68+strlen(msg); - int index = 0; - gfire_data *gfire = NULL; - guint32 msgtype = 0; - guint32 imindex = 0; - guint16 slen = strlen(msg); - - buddy->im++; - imindex = GUINT32_TO_LE(buddy->im); - msgtype = GUINT32_TO_LE(msgtype); - slen = GUINT16_TO_LE(slen); - gfire = (gfire_data *)gc->proto_data; - gfire_add_header(gfire->buff_out, length, 2, 2);/*add header*/ - index += 5; - - index = gfire_add_att_name(gfire->buff_out,index, "sid"); - gfire->buff_out[index++] = 0x03; - memcpy(gfire->buff_out+index,buddy->sid, XFIRE_SID_LEN); - index += XFIRE_SID_LEN; - - index = gfire_add_att_name(gfire->buff_out,index, "peermsg"); - gfire->buff_out[index++] = 0x05; - gfire->buff_out[index++] = 0x03; - - index = gfire_add_att_name(gfire->buff_out,index, "msgtype"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, &msgtype, sizeof(msgtype)); - index+= sizeof(msgtype); - - index = gfire_add_att_name(gfire->buff_out,index, "imindex"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, &imindex, sizeof(imindex)); - index+= sizeof(imindex); - - index = gfire_add_att_name(gfire->buff_out,index, "im"); - gfire->buff_out[index++] = 0x01; - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index+= sizeof(slen); - - memcpy(gfire->buff_out+index, msg, strlen(msg)); - index += strlen(msg); - - return index; - -} - - -GList *gfire_game_status(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 1; - int itmp = 0; - GList *btmp = NULL; - gfire_buddy *gf_buddy = NULL; - GList *ret = NULL; - GList *sids = NULL; - GList *gameids = NULL; - GList *gameips = NULL; - GList *gameports = NULL; - GList *s, *g, *ip, *gp; - gfire_data *gfire = (gfire_data *)gc->proto_data; - - itmp = gfire_read_attrib(&sids, gfire->buff_in + index, packet_len - index, "sid", FALSE, TRUE, 0, 0, - XFIRE_SID_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (sids) g_list_free(sids); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&gameids, gfire->buff_in + index, packet_len - index, "gameid", FALSE, TRUE, 0, 0, - XFIRE_GAMEID_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (sids) g_list_free(sids); - if (gameids) g_list_free(gameips); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&gameips, gfire->buff_in + index, packet_len - index, "gip", FALSE, TRUE, 0, 0, - XFIRE_GAMEIP_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (sids) g_list_free(sids); - if (gameids) g_list_free(gameids); - if (gameips) g_list_free(gameips); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&gameports, gfire->buff_in + index, packet_len - index, "gport", FALSE, TRUE, 0, 0, - XFIRE_GAMEPORT_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (sids) g_list_free(sids); - if (gameids) g_list_free(gameids); - if (gameips) g_list_free(gameips); - if (gameports) g_list_free(gameports); - return NULL; - } - gameids = g_list_first(gameids); sids = g_list_first(sids); gameips = g_list_first(gameips); - gameports = g_list_first(gameports); - g = gameids; s = sids; ip = gameips; gp = gameports; - - while ( NULL != s ){ - btmp = gfire_find_buddy_in_list(gfire->buddies, s->data, GFFB_SIDBIN); - if (NULL == btmp) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "WARN: pkt 135: (gameinfo) could not find sid in buddy list.\n"); - } else { - gf_buddy = (gfire_buddy *)btmp->data; - memcpy(&(gf_buddy->gameid),g->data, XFIRE_GAMEID_LEN); - gf_buddy->gameid = GUINT32_FROM_LE(gf_buddy->gameid); - memcpy(&(gf_buddy->gameport),gp->data, XFIRE_GAMEPORT_LEN); - gf_buddy->gameport = GUINT32_FROM_LE(gf_buddy->gameport); - gf_buddy->gameport &= 0xFFFF; - gf_buddy->gameip = (guint8 *)ip->data; - ret = g_list_append(ret, (gpointer *)gf_buddy); - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(gameinfo): %s, is playing %d on %d.%d.%d.%d:%d\n", - NN(gf_buddy->name), gf_buddy->gameid, NNA(gf_buddy->gameip, gf_buddy->gameip[3]), - NNA(gf_buddy->gameip, gf_buddy->gameip[2]), NNA(gf_buddy->gameip, gf_buddy->gameip[1]), - NNA(gf_buddy->gameip, gf_buddy->gameip[0]), gf_buddy->gameport); - - } - g_free(s->data); g_free(g->data); g_free(gp->data); - s->data = g->data = gp->data = NULL; - s = g_list_next(s); g = g_list_next(g); ip = g_list_next(ip); gp = g_list_next(gp); - } - - g_list_free(gameids); - g_list_free(gameports); - g_list_free(sids); - g_list_free(gameips); - - - - return ret; -} - - -/*send keep alive packet to the server*/ -int gfire_ka_packet_create(PurpleConnection *gc) -{ - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return 0; - - int index = 0; - gfire_add_header(gfire->buff_out + index, 26, 13, 2); - index += 5; - - index = gfire_add_att_name(gfire->buff_out,index, "value"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - - index = gfire_add_att_name(gfire->buff_out,index, "stats"); - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - return index; -} - -GList *gfire_read_buddy_status(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 1; - int itmp = 0; - GList *btmp = NULL; - gfire_buddy *gf_buddy = NULL; - GList *ret = NULL; - GList *sids = NULL; - GList *msgs = NULL; - GList *s, *m; - gfire_data *gfire = (gfire_data *)gc->proto_data; - - itmp = gfire_read_attrib(&sids, gfire->buff_in + index, packet_len - index, "sid", FALSE, TRUE, 0, 0, - XFIRE_SID_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (sids) g_list_free(sids); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&msgs, gfire->buff_in + index, packet_len - index, "msg", TRUE, FALSE, 0, 0, 0); - if (itmp < 1 ) { - //mem cleanup code - if (sids) g_list_free(sids); - if (msgs) g_list_free(msgs); - return NULL; - } - - msgs = g_list_first(msgs); sids = g_list_first(sids); - m = msgs; s = sids; - - while ( NULL != s ){ - btmp = gfire_find_buddy_in_list(gfire->buddies, s->data, GFFB_SIDBIN); - if (NULL == btmp) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "WARN: pkt 154: (away status) could not find sid in buddy list.\n"); - } else { - gf_buddy = (gfire_buddy *)btmp->data; - if (NULL != m->data) { - /* got an away message */ - gf_buddy->away = TRUE; - gf_buddy->away_msg = m->data; - } else { - /* no message, user is back */ - gf_buddy->away = FALSE; - if (NULL != gf_buddy->away_msg) g_free(gf_buddy->away_msg); - gf_buddy->away_msg = NULL; - } - ret = g_list_append(ret, (gpointer *)gf_buddy); - - purple_debug(PURPLE_DEBUG_MISC, "gfire","(away): %s, is away/back with msg %s\n", - NN(gf_buddy->name), NN(gf_buddy->away_msg)); - } - g_free(s->data); - s->data = NULL; - s = g_list_next(s); m = g_list_next(m); - } - g_list_free(msgs); - g_list_free(sids); - return ret; -} - - -GList *gfire_read_invitation(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 1; - int itmp = 0; - gfire_data *gfire = NULL; - gfire_buddy *gf_buddy = NULL; - GList *names = NULL; - GList *nicks = NULL; - GList *msgs = NULL; - GList *ret = NULL; - GList *n, *a, *m; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) - return NULL; - - itmp = gfire_read_attrib(&names, gfire->buff_in + index, packet_len - index, "name", TRUE, FALSE, 0, 0, 0); - if (itmp < 1 ) { - //mem cleanup code - if (names) g_list_free(names); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&nicks, gfire->buff_in + index, packet_len - index, "nick", TRUE, FALSE, 0, 0, 0); - if (itmp < 1 ) { - //mem cleanup code - if (names) g_list_free(names); - if (nicks) g_list_free(nicks); - return NULL; - } - index += itmp + 1; - itmp = gfire_read_attrib(&msgs, gfire->buff_in + index, packet_len - index, "msg", TRUE, FALSE, 0, 0, 0); - if (itmp < 1 ) { - //mem cleanup code - if (names) g_list_free(names); - if (nicks) g_list_free(nicks); - if (msgs) g_list_free(msgs); - return NULL; - } - - names = g_list_first(names); nicks = g_list_first(nicks); msgs = g_list_first(msgs); - n = names; a = nicks; m = msgs; - - while (NULL != n){ - gf_buddy = g_malloc0(sizeof(gfire_buddy)); - ret = g_list_append(ret, gf_buddy); - gf_buddy->name = (char *)n->data; - gf_buddy->alias = (char *)a->data; - gf_buddy->uid_str = (char *)m->data; /* yeah its ugly but it'll work for this */ - n->data = a->data = m->data = NULL; - n = g_list_next(n); a = g_list_next(a); m = g_list_next(m); - } - g_list_free(names); - g_list_free(nicks); - g_list_free(msgs); - return ret; -} - - -int gfire_invitation_deny(PurpleConnection *gc, char *name) -{ - gfire_data *gfire = NULL; - int len = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !name) return 0; - - - /* same as the invitation except packet ID in the header */ - len = gfire_invitation_accept(gc, name); - gfire_add_header(gfire->buff_out, len, 8, 1); - return len; -} - - -int gfire_invitation_accept(PurpleConnection *gc, char *name) -{ - gfire_data *gfire = NULL; - int index = XFIRE_HEADER_LEN; - guint16 slen = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !name) return 0; - - slen = strlen(name); - slen = GUINT16_TO_LE(slen); - gfire->buff_out[index++] = strlen("name"); - memcpy(gfire->buff_out + index, "name", strlen("name")); - index += strlen("name"); - gfire->buff_out[index++] = 0x01; - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - memcpy(gfire->buff_out + index, name, strlen(name)); - index += strlen(name); - - gfire_add_header(gfire->buff_out, index, 7, 1); - return index; -} - - -int gfire_add_buddy_create(PurpleConnection *gc, char *name) -{ - gfire_data *gfire = NULL; - int index = XFIRE_HEADER_LEN; - guint16 slen = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !name) return 0; - - slen = strlen(name); - slen = GUINT16_TO_LE(slen); - gfire->buff_out[index++] = strlen("name"); - memcpy(gfire->buff_out + index, "name", strlen("name")); - index += strlen("name"); - gfire->buff_out[index++] = 0x01; - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - memcpy(gfire->buff_out + index, name, strlen(name)); - index += strlen(name); - - gfire->buff_out[index++] = strlen("msg"); - memcpy(gfire->buff_out + index, "msg", strlen("msg")); - index += strlen("msg"); - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - - gfire_add_header(gfire->buff_out, index, 6, 2); - - return index; - -} - - -int gfire_remove_buddy_create(PurpleConnection *gc, gfire_buddy *b) -{ - gfire_data *gfire = NULL; - int index = XFIRE_HEADER_LEN; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !b) return 0; - - gfire_add_header(gfire->buff_out, 17, 9, 1); - gfire->buff_out[index++] = strlen("userid"); - memcpy(gfire->buff_out + index, "userid", strlen("userid")); - index += strlen("userid"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, b->userid, 4); - index += 4; - - return index; -} - - -/* -*Sends a nickname change to the server -*/ -int gfire_create_change_alias(PurpleConnection *gc, char *name) -{ - gfire_data *gfire = NULL; - int index = XFIRE_HEADER_LEN; - guint16 slen = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return 0; - - if (! name ) name = ""; - slen = strlen(name); - slen = GUINT16_TO_LE(slen); - gfire->buff_out[index++] = strlen("nick"); - memcpy(gfire->buff_out + index, "nick", strlen("nick")); - index += strlen("nick"); - gfire->buff_out[index++] = 0x01; - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - memcpy(gfire->buff_out + index, name, strlen(name)); - index += strlen(name); - gfire_add_header(gfire->buff_out, index, 14, 1); - return index; -} - -/* -*Sends the packet when we join a game or leave it (gameid 00 00) -*/ -int gfire_join_game_create(PurpleConnection *gc, int game, int port, const char *ip) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - guint32 gport = port; - guint32 gameid = game; - const char nullip[4] = {0x00, 0x00, 0x00, 0x00}; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data)) return 0; - if (!ip) ip = (char *)&nullip; - - gport = GUINT32_TO_LE(gport); - gameid = GUINT32_TO_LE(gameid); - - index = gfire_add_att_name(gfire->buff_out,index, "gameid"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, &gameid, sizeof(gameid)); - index += sizeof(gameid); - - index = gfire_add_att_name(gfire->buff_out,index, "gip"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = ip[0]; - gfire->buff_out[index++] = ip[1]; - gfire->buff_out[index++] = ip[2]; - gfire->buff_out[index++] = ip[3]; - - index = gfire_add_att_name(gfire->buff_out,index, "gport"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, &gport, sizeof(gport)); - index += sizeof(gport); - - gfire_add_header(gfire->buff_out, index, 4, 3); - - return index; -} - -int gfire_request_avatar_info(PurpleConnection *gc, gfire_buddy *b) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !b) return 0; - - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, b->userid, 4); - index += 4; - - gfire_add_header(gfire->buff_out, index, 37, 1); - - return index; -} - - -int gfire_send_typing_packet(PurpleConnection *gc, gfire_buddy *buddy) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - guint32 msgtype = 3; - guint32 imindex = 0; - - buddy->im++; - imindex = GUINT32_TO_LE(buddy->im); - msgtype = GUINT32_TO_LE(msgtype); - gfire = (gfire_data *)gc->proto_data; - - index = gfire_add_att_name(gfire->buff_out,index, "sid"); - gfire->buff_out[index++] = 0x03; - memcpy(gfire->buff_out+index,buddy->sid, XFIRE_SID_LEN); - index += XFIRE_SID_LEN; - - index = gfire_add_att_name(gfire->buff_out,index, "peermsg"); - gfire->buff_out[index++] = 0x05; - gfire->buff_out[index++] = 0x03; - - index = gfire_add_att_name(gfire->buff_out,index, "msgtype"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, &msgtype, sizeof(msgtype)); - index+= sizeof(msgtype); - - index = gfire_add_att_name(gfire->buff_out,index, "imindex"); - gfire->buff_out[index++] = 0x02; - memcpy(gfire->buff_out + index, &imindex, sizeof(imindex)); - index+= sizeof(imindex); - - index = gfire_add_att_name(gfire->buff_out,index, "typing"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - - gfire_add_header(gfire->buff_out, index, 2, 2); - - return index; - -} - -void gfire_read_alias_change(PurpleConnection *gc, int packet_len) -{ - guint8 uid[XFIRE_USERID_LEN] = {0x0,0x0,0x0,0x0}; - gfire_data *gfire = NULL; - int index = 7; /* start of uid in packet */ - guint16 nicklen = 0; - gchar *nick = NULL; - GList *gfbl = NULL; - gfire_buddy *gbuddy = NULL; - PurpleBuddy *buddy = NULL; - PurpleAccount *account = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (index > packet_len)) return; - - /* grab the userid */ - memcpy(uid, gfire->buff_in + index, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN + 2; - - /* get the new nick len */ - memcpy(&nicklen, gfire->buff_in + index, sizeof(nicklen)); - nicklen = GUINT16_FROM_LE(nicklen); - index += sizeof(nicklen); - - if (nicklen > 0) { - /* grab the new nick */ - nick = g_malloc0(nicklen + 1); - memcpy(nick, gfire->buff_in + index, nicklen); - } - - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer) &uid, GFFB_UIDBIN); - if (NULL == gfbl) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(nick change): uid not found in buddy list\n"); - if (NULL != nick) g_free(nick); - return; - } - - gbuddy = (gfire_buddy *)gfbl->data; - if (NULL == gbuddy) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(nick change): uid found but gbuddy is {NULL}\n"); - if (NULL != nick) g_free(nick); - return; - } - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(nick change): user %s changed alias from %s to %s\n", - NN(gbuddy->name), NN(gbuddy->alias), NN(nick)); - - if (NULL != gbuddy->alias) g_free(gbuddy->alias); - if (NULL != nick) { - gbuddy->alias = nick; - } else { - gbuddy->alias = g_strdup(gbuddy->name); - } - - account = purple_connection_get_account(gc); - buddy = purple_find_buddy(account, gbuddy->name); - - if (NULL == buddy) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(nick change): purple_buddy_find returned null for %s\n", - NN(gbuddy->name)); - return; - } - - serv_got_alias(gc, gbuddy->name, gbuddy->alias); - -} - -int gfire_create_join_chat(PurpleConnection *gc, gchar *id, gchar *room, gchar *pass) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - guint16 slen = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !room || (strlen(room) == 0)) { - - purple_debug(PURPLE_DEBUG_ERROR, "gfire", - "(chat): invalid parameter to _create_join_chat gc=%p gfire=%p room=%s\n", - gc, gfire, NN(room)); - return 0; - } - - - slen = strlen(room); - index = gfire_add_att_name(gfire->buff_out, index, "climsg"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0xf4; - gfire->buff_out[index++] = 0x4c; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - index = gfire_add_att_name(gfire->buff_out, index, "msg"); - gfire->buff_out[index++] = 0x09; - gfire->buff_out[index++] = 0x06; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x06; - memcpy(gfire->buff_out + index, id, XFIRE_CHATID_LEN); - index+= XFIRE_CHATID_LEN; - gfire->buff_out[index++] = 0x0b; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0xaa; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x05; - gfire->buff_out[index++] = 0x01; - slen = GUINT16_TO_LE(slen); - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - memcpy(gfire->buff_out + index, room, strlen(room)); - index += strlen(room); - gfire->buff_out[index++] = 0x5f; - gfire->buff_out[index++] = 0x01; - if (!pass || strlen(pass) == 0) { - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - } else { - slen = GUINT16_TO_LE(slen); - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - memcpy(gfire->buff_out + index, pass, strlen(pass)); - index += strlen(pass); - } - gfire->buff_out[index++] = 0xa7; - gfire->buff_out[index++] = 0x08; - gfire->buff_out[index++] = 0x00; - - gfire_add_header(gfire->buff_out, index, 25, 2); - - return index; -} - - -GList *gfire_read_chat_info(PurpleConnection *gc, int packet_len, gchar **rtop, gchar ** rmotd, guint8 **rcid) -{ - int index = XFIRE_HEADER_LEN + 2; - int itmp = 0; - gfire_data *gfire = NULL; - guint16 slen = 0; - guint8 chat_id[XFIRE_CHATID_LEN]; - guint32 i32_perm = 0; - GList *members = NULL; - gfire_buddy *m = NULL; - gchar *topic = NULL; - gchar *motd = NULL; - GList *userids, *perms, *names, *nicks; - GList *u, *p, *n, *a; - - u = p = n = a = NULL; - userids = perms = names = nicks = NULL; - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (packet_len == 0)) return NULL; - - /* xfire chat id */ - memcpy(chat_id, gfire->buff_in + index, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN + 2; - - - /* chat topic / name */ - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - index += sizeof(slen); - slen = GUINT16_FROM_LE(slen); - if (slen > 0) { - topic = g_malloc0(slen + 1); - memcpy(topic, gfire->buff_in + index, slen); - } - index += slen + 2; - - - /* Motd */ - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - index += sizeof(slen); - slen = GUINT16_FROM_LE(slen); - if (slen > 0) { - motd = g_malloc0(slen + 1); - memcpy(motd, gfire->buff_in + index, slen); - } - index += slen + 27; - - /* get user id's of members in chat */ - itmp = gfire_read_attrib(&userids, gfire->buff_in + index, packet_len - index, NULL, FALSE, TRUE, 0, 0, - XFIRE_USERID_LEN); - if (itmp < 1 ) { - //mem cleanup code - if (userids) g_list_free(userids); - return NULL; - } - index += itmp + 3; - - - /* get user permissions of members in chat */ - itmp = gfire_read_attrib(&perms, gfire->buff_in + index, packet_len - index, NULL, FALSE, TRUE, 0, 0, - sizeof(guint32)); - if (itmp < 1 ) { - //mem cleanup code - if (userids) g_list_free(userids); - if (perms) g_list_free(perms); - return NULL; - } - index += itmp + 3; - - - /* get chat member usernames */ - itmp = gfire_read_attrib(&names, gfire->buff_in + index, packet_len - index, NULL, TRUE, FALSE, 0, 0, 0); - if (itmp < 1 ) { - //mem cleanup code - if (userids) g_list_free(userids); - if (perms) g_list_free(perms); - if (names) g_list_free(names); - return NULL; - } - index += itmp + 3; /* 0x43 0x04 0x01 */ - - /* get chat member aliases */ - itmp = gfire_read_attrib(&nicks, gfire->buff_in + index, packet_len - index, NULL, TRUE, FALSE, 0, 0, 0); - if (itmp < 1 ) { - //mem cleanup code - if (userids) g_list_free(userids); - if (perms) g_list_free(perms); - if (names) g_list_free(names); - if (nicks) g_list_free(nicks); - return NULL; - } - - /* packet has been parsed */ - names = g_list_first(names); nicks = g_list_first(nicks); userids = g_list_first(userids); - perms = g_list_first(perms); - - n = names; p = perms; a = nicks; u = userids; - - while (NULL != u){ - m = g_new0(gfire_buddy,1); - m->name = (gchar *)n->data; - m->alias = (gchar *)a->data; - m->userid = (guint8 *)u->data; - memcpy(&i32_perm, p->data, sizeof(i32_perm)); - m->chatperm = GUINT32_FROM_LE(i32_perm); - g_free(p->data); p->data = NULL; - members = g_list_append(members, m); - u->data = n->data = a->data = NULL; - u = g_list_next(u); n = g_list_next(n); - a = g_list_next(a); p = g_list_next(p); - } - - g_list_free(names); g_list_free(perms); g_list_free(nicks); g_list_free(userids); - - *rtop = topic; - *rmotd = motd; - *rcid = g_malloc0(XFIRE_CHATID_LEN); - memcpy(*rcid, chat_id, XFIRE_CHATID_LEN); - return members; -} - - -gfire_chat_msg *gfire_read_chat_msg(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 2; - gfire_chat_msg *ret = NULL; - guint8 chat_id[XFIRE_CHATID_LEN]; - guint16 slen = 0; - gchar *msg = NULL; - guint8 userid[XFIRE_USERID_LEN]; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (packet_len == 0)) return NULL; - - memcpy(chat_id, gfire->buff_in + index, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN + 2; - - if ((index +XFIRE_USERID_LEN )> packet_len) return NULL; - - memcpy(userid, gfire->buff_in + index, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN + 2; - - - if ((index + sizeof(slen)) > packet_len) return NULL; - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - slen = GUINT16_FROM_LE(slen); - index += sizeof(slen); - - if ((index + slen) > packet_len) return NULL; - - msg = g_malloc0(slen +1); - memcpy(msg, gfire->buff_in + index, slen); - - ret = g_new0(gfire_chat_msg, 1); - ret->im_str = msg; - ret->chat_id = g_malloc0(XFIRE_CHATID_LEN); - memcpy(ret->chat_id, chat_id, XFIRE_CHATID_LEN); - ret->uid = g_malloc0(XFIRE_USERID_LEN); - memcpy(ret->uid, userid, XFIRE_USERID_LEN); - - return ret; -} - - -int gfire_create_chat_message(PurpleConnection *gc, guint8 *cid, const char *message) -{ - int index = XFIRE_HEADER_LEN; - guint16 slen = 0; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) - || !message || !cid || (strlen(message) == 0)) return 0; - - index = gfire_add_att_name(gfire->buff_out, index, "climsg"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0xf6; - gfire->buff_out[index++] = 0x4c; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - - index = gfire_add_att_name(gfire->buff_out, index, "msg"); - gfire->buff_out[index++] = 0x09; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x06; - memcpy(gfire->buff_out + index, cid, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN; - - gfire->buff_out[index++] = 0x2e; - gfire->buff_out[index++] = 0x01; - - slen = strlen(message); - slen = GUINT16_TO_LE(slen); - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - - memcpy(gfire->buff_out + index, message, strlen(message)); - index += strlen(message); - - gfire_add_header(gfire->buff_out, index, 25 , 0x02); - - return index; -} - - -gfire_chat_msg *gfire_read_chat_user_leave(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 2; - gfire_data *gfire = NULL; - gfire_chat_msg *ret = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (packet_len == 0)) return NULL; - - ret = g_new0(gfire_chat_msg,1); - ret->chat_id = g_malloc0(XFIRE_CHATID_LEN); - ret->uid = g_malloc0(XFIRE_USERID_LEN); - - memcpy(ret->chat_id, gfire->buff_in + index, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN + 2; - - memcpy(ret->uid, gfire->buff_in + index, XFIRE_USERID_LEN); - - return ret; - -} - - -int gfire_create_chat_leave(PurpleConnection *gc, const guint8 *cid) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !cid) return 0; - - index = gfire_add_att_name(gfire->buff_out, index, "climsg"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0xf5; - gfire->buff_out[index++] = 0x4c; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - - index = gfire_add_att_name(gfire->buff_out, index, "msg"); - gfire->buff_out[index++] = 0x09; - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x06; - - memcpy(gfire->buff_out + index, cid, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN; - - gfire_add_header(gfire->buff_out, index, 25 , 2); - - return index; -} - - -gfire_chat_msg *gfire_read_chat_user_join(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 2; - gfire_chat_msg *ret = NULL; - guint8 chat_id[XFIRE_CHATID_LEN]; - guint16 slen = 0; - guint32 perms = 0; - gchar *name = NULL; - gchar *alias = NULL; - guint8 userid[XFIRE_USERID_LEN]; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (packet_len == 0)) return NULL; - - memcpy(chat_id, gfire->buff_in + index, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN + 2; - - if ((index + XFIRE_USERID_LEN) > packet_len) return NULL; - memcpy(userid, gfire->buff_in + index, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN + 2; - - /* grab login ID */ - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - slen = GUINT16_FROM_LE(slen); - index += sizeof(slen); - name = g_malloc0(slen + 1); - memcpy(name, gfire->buff_in + index, slen); - index += slen + 2; - - /* grab alias */ - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - slen = GUINT16_FROM_LE(slen); - index += sizeof(slen); - if (slen > 0) { - alias = g_malloc0(slen + 1); - memcpy(alias, gfire->buff_in + index, slen); - } - index += slen + 2; - - /* grab perms for this chat user */ - memcpy(&perms, gfire->buff_in + index, sizeof(perms)); - perms = GUINT32_FROM_LE(perms); - - ret = g_new0(gfire_chat_msg, 1); - ret->b = g_new0(gfire_buddy, 1); - ret->chat_id = g_malloc0(XFIRE_CHATID_LEN); - memcpy(ret->chat_id, chat_id, XFIRE_CHATID_LEN); - ret->b->userid = g_malloc0(XFIRE_USERID_LEN); - memcpy(ret->b->userid, userid, XFIRE_USERID_LEN); - ret->b->chatperm = perms; - ret->b->name = name; - ret->b->alias = alias; - ret->uid = NULL; - ret->im_str = NULL; - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "groupchat join, userid: %02x %02x %02x %02x, username: %s, alias: %s\n", - NNA(ret->b->userid, ret->b->userid[0]), - NNA(ret->b->userid, ret->b->userid[1]), NNA(ret->b->userid, ret->b->userid[2]), - NNA(ret->b->userid, ret->b->userid[3]), NN(ret->b->name), NN(ret->b->alias)); - - return ret; -} - - -int gfire_create_chat_invite(PurpleConnection *gc, const guint8 *cid, const guint8 *userid) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !cid || !userid) return 0; - - index = gfire_add_att_name(gfire->buff_out, index, "climsg"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0xfc; - gfire->buff_out[index++] = 0x4c; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - index = gfire_add_att_name(gfire->buff_out, index, "msg"); - gfire->buff_out[index++] = 0x09; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x06; - memcpy(gfire->buff_out + index, cid, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN; - gfire->buff_out[index++] = 0x18; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x00; - memcpy(gfire->buff_out + index, userid, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN; - - gfire_add_header(gfire->buff_out, index, 25 , 2); - - return index; -} - -int gfire_create_change_motd(PurpleConnection *gc, const guint8 *cid, gchar* motd) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - guint16 slen = 0; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !cid - || !motd || (strlen(motd) == 0)) return 0; - - index = gfire_add_att_name(gfire->buff_out, index, "climsg"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x0c; - gfire->buff_out[index++] = 0x4d; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - index = gfire_add_att_name(gfire->buff_out, index, "msg"); - gfire->buff_out[index++] = 0x09; - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x06; - memcpy(gfire->buff_out + index, cid, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN; - gfire->buff_out[index++] = 0x2e; - gfire->buff_out[index++] = 0x01; - slen = strlen(motd); - slen = GUINT16_TO_LE(slen); - memcpy(gfire->buff_out + index, &slen, sizeof(slen)); - index += sizeof(slen); - memcpy(gfire->buff_out + index, motd, strlen(motd)); - index += strlen(motd); - - gfire_add_header(gfire->buff_out, index, 25 , 2); - - return index; -} - -void gfire_read_chat_motd_change(PurpleConnection *gc, int packet_len) -{ - int index = XFIRE_HEADER_LEN + 2; - gfire_data *gfire = NULL; - gchar *motd = NULL; - guint16 slen = 0; - GList *cl = NULL; - guint8 chat_id[XFIRE_CHATID_LEN]; - gfire_chat *gfchat = NULL; - gchar *tmpmsg = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (packet_len == 0)) return; - - memcpy(chat_id, gfire->buff_in + index, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN + 2; - - memcpy(&slen, gfire->buff_in + index, sizeof(slen)); - index += sizeof(slen); - slen = GUINT16_FROM_LE(slen); - if (slen > 0) { - motd = g_malloc0(slen + 1); - memcpy(motd, gfire->buff_in + index, slen); - } - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "new motd: %s\n", motd); - - cl = gfire_find_chat(gfire->chats, (gpointer *)chat_id, GFFC_CID); - - if (!cl || !(gfchat = (gfire_chat *)cl->data)) return; - - purple_conv_chat_set_topic(PURPLE_CONV_CHAT(gfchat->c), "", motd); - tmpmsg = g_strdup_printf("Today's message changed to:\n%s", motd); - purple_conv_chat_write(PURPLE_CONV_CHAT(gfchat->c), "", tmpmsg, PURPLE_MESSAGE_SYSTEM, time(NULL)); - g_free(tmpmsg); - - return; - -} - -void read_groupchat_buddy_permission_change(PurpleConnection *gc, int packet_len) -{ - guint8 uid[XFIRE_USERID_LEN] = {0x0,0x0,0x0,0x0}; - guint8 chat_id[XFIRE_CHATID_LEN]; - guint32 perm = 0; - gfire_data *gfire = NULL; - int index = 7; /* start of uid in packet */ - GList *gfbl = NULL; - gfire_buddy *gbuddy = NULL; - gfire_chat *gfchat = NULL; - GList *t = NULL; - PurpleConvChatBuddyFlags f; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || (index > packet_len)) return; - - /* grab the chat id */ - memcpy(chat_id, gfire->buff_in + index, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN + 2; - - /* grab the userid */ - memcpy(uid, gfire->buff_in + index, XFIRE_USERID_LEN); - index += XFIRE_USERID_LEN + 2; - - /* grab the new permission level */ - memcpy(&perm, gfire->buff_in + index, sizeof(perm)); - perm = GUINT32_FROM_LE(perm); - - - gfbl = gfire_find_buddy_in_list(gfire->buddies, (gpointer) &uid, GFFB_UIDBIN); - if (NULL == gfbl) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(groupchat perm change): uid not found in buddy list\n"); - if (0 != perm) perm = 0; - return; - } - - gbuddy = (gfire_buddy *)gfbl->data; - if (NULL == gbuddy) { - purple_debug(PURPLE_DEBUG_ERROR, "gfire", "(groupchat perm change): uid found but gbuddy is {NULL}\n"); - if (0 != perm) perm = 0; - return; - } - - purple_debug(PURPLE_DEBUG_MISC, "gfire", "(groupchat perm change): user %s changed permission\n", - NN(gbuddy->name)); - - if (0 != gbuddy->chatperm) gbuddy->chatperm = 0; - if (0 != perm) gbuddy->chatperm = perm; - - t = gfire_find_chat(gfire->chats, chat_id, GFFC_CID); - if (t && (gfchat = (gfire_chat *)t->data)) { - switch(gbuddy->chatperm) { - case 01: - f = PURPLE_CBFLAGS_NONE; - break; - - case 02: - f = PURPLE_CBFLAGS_NONE; - break; - - case 03: - f = PURPLE_CBFLAGS_VOICE; - break; - - case 04: - f = PURPLE_CBFLAGS_HALFOP; - break; - - case 05: - f = PURPLE_CBFLAGS_OP; - break; - - default: - f = PURPLE_CBFLAGS_NONE; - } - } - - purple_conv_chat_user_set_flags(PURPLE_CONV_CHAT(gfchat->c), gbuddy->name, f); - - return; -} - -int gfire_create_reject_chat(PurpleConnection *gc, const guint8 *cid) -{ - int index = XFIRE_HEADER_LEN; - gfire_data *gfire = NULL; - - if (!gc || !(gfire = (gfire_data *)gc->proto_data) || !cid) { - purple_debug(PURPLE_DEBUG_MISC, "gfire", "fail\n"); - return 0; - } - - index = gfire_add_att_name(gfire->buff_out, index, "climsg"); - gfire->buff_out[index++] = 0x02; - gfire->buff_out[index++] = 0xff; - gfire->buff_out[index++] = 0x4c; - gfire->buff_out[index++] = 0x00; - gfire->buff_out[index++] = 0x00; - index = gfire_add_att_name(gfire->buff_out, index, "msg"); - gfire->buff_out[index++] = 0x09; - gfire->buff_out[index++] = 0x01; - gfire->buff_out[index++] = 0x04; - gfire->buff_out[index++] = 0x06; - memcpy(gfire->buff_out + index, cid, XFIRE_CHATID_LEN); - index += XFIRE_CHATID_LEN; - - gfire_add_header(gfire->buff_out, index, 25 , 2); - - return index; - -} diff -Nru gfire-0.8.3/src/gf_packet.h gfire-0.9.4/src/gf_packet.h --- gfire-0.8.3/src/gf_packet.h 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/gf_packet.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * purple - Xfire Protocol Plugin - * - * Copyright (C) 2000-2001, Beat Wolf - * Copyright (C) 2006, Keith Geffert - * Copyright (C) 2008, Laurent De Marez - * - * - * This file is part of Gfire. - * - * Gfire is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 Gfire. If not, see . -*/ -#ifndef _GF_PACKET_H -#define _GF_PACKET_H - -#include "gfire.h" - -void gfire_add_header(guint8 *packet, int length, int type, int atts); -int gfire_add_att_name(guint8 *packet,int packet_length, char *att); -void gfire_packet_130(PurpleConnection *gc, int packet_len); -void gfire_packet_131(PurpleConnection *gc, int packet_len); -int gfire_send_auth(PurpleConnection *gc, int packet_len, int packet_id); -GList *gfire_read_buddy_online(PurpleConnection *gc, int packet_len); -int gfire_get_im(PurpleConnection *gc, int packet_len); -int gfire_create_im(PurpleConnection *gc, gfire_buddy *buddy, const char *msg); -GList *gfire_game_status(PurpleConnection *gc, int packet_len); -int gfire_ka_packet_create(PurpleConnection *gc); -GList *gfire_read_buddy_status(PurpleConnection *gc, int packet_len); -GList *gfire_read_invitation(PurpleConnection *gc, int packet_len); -int gfire_invitation_deny(PurpleConnection *gc, char *name); -int gfire_invitation_accept(PurpleConnection *gc, char *name); -int gfire_add_buddy_create(PurpleConnection *gc, char *name); -int gfire_remove_buddy_create(PurpleConnection *gc, gfire_buddy *b); -int gfire_create_change_alias(PurpleConnection *gc, char *name); -int gfire_join_game_create(PurpleConnection *gc, int game, int port, const char *ip); -int gfire_request_avatar_info(PurpleConnection *gc, gfire_buddy *b); -//void gfire_read_avatar_info(PurpleConnection *gc, int packet_len); -int gfire_send_typing_packet(PurpleConnection *gc, gfire_buddy *buddy); -void gfire_read_alias_change(PurpleConnection *gc, int packet_len); -int gfire_create_join_chat(PurpleConnection *gc, gchar *id, gchar *room, gchar *pass); -GList *gfire_read_chat_info(PurpleConnection *gc, int packet_len, gchar **rtop, gchar **rmotd, guint8 **rcid); -gfire_chat_msg *gfire_read_chat_msg(PurpleConnection *gc, int packet_len); -int gfire_create_chat_message(PurpleConnection *gc, guint8 *cid, const char *message); -gfire_chat_msg *gfire_read_chat_user_leave(PurpleConnection *gc, int packet_len); -int gfire_create_chat_leave(PurpleConnection *gc, const guint8 *cid); -gfire_chat_msg *gfire_read_chat_user_join(PurpleConnection *gc, int packet_len); -int gfire_create_chat_invite(PurpleConnection *gc, const guint8 *cid, const guint8 *sid); -int gfire_create_change_motd(PurpleConnection *gc, const guint8 *cid, gchar* motd); -void gfire_read_chat_motd_change(PurpleConnection *gc, int packet_len); -void read_groupchat_buddy_permission_change(PurpleConnection *gc, int packet_len); -int gfire_create_reject_chat(PurpleConnection *gc, const guint8 *cid); - -#endif /* _GF_PACKET_H */ diff -Nru gfire-0.8.3/src/gf_preferences.c gfire-0.9.4/src/gf_preferences.c --- gfire-0.8.3/src/gf_preferences.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_preferences.c 2011-03-14 20:22:14.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_preferences.h" +#include "gf_preferences_proto.h" +#include "gf_network.h" + +static gboolean gfire_preferences_get_default(guint8 p_id) +{ + static const gf_pref defaultPrefs[] = + { + { 0x01, TRUE }, // Show game status to buddies + { 0x02, TRUE }, // Show game server data to buddies + { 0x03, TRUE }, // Show game status on the profile + { 0x04, TRUE }, // Play sound on new messages + { 0x05, TRUE }, // Play sound on new messages while in a game + { 0x06, FALSE }, // Show timestamp in chat windows + { 0x07, TRUE }, // Play sound on logon/off + { 0x08, TRUE }, // Show (game status to) FoFs + { 0x09, TRUE }, // Show offline buddies + { 0x0a, TRUE }, // Show nickname, if available + { 0x0b, TRUE }, // Show voice server to buddies + { 0x0c, TRUE }, // Show typing notification to buddies + { 0x10, TRUE }, // Show tooltip on logon + { 0x11, TRUE }, // Show tooltip on download + { 0x12, TRUE }, // Play sound on join/leave in chat rooms + { 0x13, TRUE }, // Play sound on voice call + { 0x14, TRUE }, // Play sound on screenshot + { 0xff, FALSE } // Always the last element + }; + + const gf_pref *cur = defaultPrefs; + while(cur->id != 0xff) + { + if(cur->id == p_id) + return cur->set; + cur++; + } + + return FALSE; +} + +gfire_preferences *gfire_preferences_create() +{ + return g_malloc0(sizeof(gfire_preferences)); +} + +void gfire_preferences_free(gfire_preferences *p_prefs) +{ + if(!p_prefs) + return; + + gfire_list_clear(p_prefs->prefs); + g_free(p_prefs); +} + +void gfire_preferences_set(gfire_preferences *p_prefs, guint8 p_id, gboolean p_set) +{ + if(!p_prefs) + return; + + // Change an existing setting + GList *cur = p_prefs->prefs; + while(cur) + { + gf_pref *pref = (gf_pref*)cur->data; + if(pref->id == p_id) + { + if(p_set == gfire_preferences_get_default(p_id)) + { + g_free(pref); + p_prefs->prefs = g_list_delete_link(p_prefs->prefs, cur); + } + else + pref->set = p_set; + return; + } + cur = g_list_next(cur); + } + + // Add a new one + gf_pref *pref = g_malloc(sizeof(gf_pref)); + pref->id = p_id; + pref->set = p_set; + p_prefs->prefs = g_list_append(p_prefs->prefs, pref); +} + +gboolean gfire_preferences_get(const gfire_preferences *p_prefs, guint8 p_id) +{ + if(!p_prefs) + return FALSE; + + const GList *cur = p_prefs->prefs; + while(cur) + { + const gf_pref *pref = (gf_pref*)cur->data; + if(pref->id == p_id) + return pref->set; + cur = g_list_next(cur); + } + + // Return default setting otherwise + return gfire_preferences_get_default(p_id); +} + +void gfire_preferences_send(const gfire_preferences *p_prefs, PurpleConnection *p_gc) +{ + if(!p_prefs || !p_gc) + return; + + purple_debug_info("gfire", "sending client preferences...\n"); + guint16 len = gfire_pref_proto_create_changed_preferences(p_prefs->prefs); + gfire_send(p_gc, len); +} diff -Nru gfire-0.8.3/src/gf_preferences.h gfire-0.9.4/src/gf_preferences.h --- gfire-0.8.3/src/gf_preferences.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_preferences.h 2011-03-14 20:22:09.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_PREFERENCES_H +#define _GF_PREFERENCES_H + +typedef struct _gfire_preferences gfire_preferences; + +#include "gf_base.h" + +typedef struct _gf_pref +{ + guint8 id; + gboolean set; +} gf_pref; + +struct _gfire_preferences +{ + GList *prefs; +}; + +// Creation/freeing +gfire_preferences *gfire_preferences_create(); +void gfire_preferences_free(gfire_preferences *p_prefs); + +// Handling +void gfire_preferences_set(gfire_preferences *p_prefs, guint8 p_id, gboolean p_set); +gboolean gfire_preferences_get(const gfire_preferences *p_prefs, guint8 p_id); + +// Sending to Xfire +void gfire_preferences_send(const gfire_preferences *p_prefs, PurpleConnection *p_gc); + +#endif // _GF_PREFERENCES_H diff -Nru gfire-0.8.3/src/gf_preferences_proto.c gfire-0.9.4/src/gf_preferences_proto.c --- gfire-0.8.3/src/gf_preferences_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_preferences_proto.c 2011-03-14 20:22:05.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_preferences_proto.h" +#include "gf_preferences.h" +#include "gf_protocol.h" + +guint16 gfire_pref_proto_create_changed_preferences(const GList *p_prefs) +{ + guint32 offset = XFIRE_HEADER_LEN; + + // "prefs" + offset = gfire_proto_write_attr_ss("prefs", 0x09, NULL, g_list_length((GList*)p_prefs), offset); + + // Write preferences + while(p_prefs) + { + const gf_pref *pref = (gf_pref*)p_prefs->data; + const gchar *value = pref->set ? "1" : "0"; + offset = gfire_proto_write_attr_bs(pref->id, 0x01, value, 1, offset); + p_prefs = g_list_next(p_prefs); + } + + gfire_proto_write_header(offset, 0x0A, 1, 0); + return offset; +} + +void gfire_pref_proto_client_preferences(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire || p_packet_len < 8) + return; + + if((*(p_gfire->buff_in + 5) != 0x4C) || (*(p_gfire->buff_in + 6) != 0x09)) + return; + + guint8 attributes = *(p_gfire->buff_in + 7); + guint16 offset = XFIRE_HEADER_LEN + 3; + guint8 pos = 0; + for(; pos < attributes; pos++) + { + if(p_packet_len < (offset + 4)) + return; + + guint8 id = *(p_gfire->buff_in + offset); + offset++; + guint8 type = *(p_gfire->buff_in + offset); + offset++; + + if(type != 0x01) + return; + + guint16 len = *(guint16*)(p_gfire->buff_in + offset); + offset += 2; + + if(p_packet_len < (offset + len)) + return; + + // Store the changed preference + gfire_preferences_set(p_gfire->prefs, id, *(p_gfire->buff_in + offset) == '1'); + offset += len; + } + + gfire_got_preferences(p_gfire); +} diff -Nru gfire-0.8.3/src/gf_preferences_proto.h gfire-0.9.4/src/gf_preferences_proto.h --- gfire-0.8.3/src/gf_preferences_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_preferences_proto.h 2011-03-14 20:22:00.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_PREFERENCES_PROTO_H +#define _GF_PREFERENCES_PROTO_H + +#include "gf_base.h" +#include "gfire.h" + +// Packet creation +guint16 gfire_pref_proto_create_changed_preferences(const GList *p_prefs); + +// Packet parsing +void gfire_pref_proto_client_preferences(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // _GF_PREFERENCES_PROTO_H diff -Nru gfire-0.8.3/src/gf_protocol.c gfire-0.9.4/src/gf_protocol.c --- gfire-0.8.3/src/gf_protocol.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_protocol.c 2011-03-14 20:21:55.000000000 +0000 @@ -0,0 +1,643 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_network.h" +#include "gf_protocol.h" + +guint32 gfire_proto_check_attribute_ss(const guint8 *p_buff, const gchar *p_name, guint8 p_type, guint32 p_offset) +{ + if(!p_buff || !p_name) + return -1; + + guint8 attr_name_len = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(attr_name_len); + + gchar attr_name[attr_name_len + 1]; + memcpy(attr_name, p_buff + p_offset, attr_name_len); + attr_name[attr_name_len] = 0; + + p_offset += attr_name_len; + + if(g_ascii_strcasecmp(p_name, attr_name) != 0) + return -1; + + guint8 attr_type = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(attr_type); + + if(attr_type != p_type) + return -1; + + return p_offset; +} + +guint32 gfire_proto_check_attribute_bs(const guint8 *p_buff, guint8 p_id, guint8 p_type, guint32 p_offset) +{ + if(!p_buff) + return -1; + + guint8 attr_id = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(attr_id); + + if(attr_id != p_id) + return -1; + + guint8 attr_type = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(attr_type); + + if(attr_type != p_type) + return -1; + + return p_offset; +} + +static guint32 gfire_proto_read_string_value(const guint8 *p_buff, gchar **p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + guint16 value_len = GUINT16_FROM_LE(*(guint16*)(p_buff + p_offset)); + p_offset += sizeof(value_len); + + *p_dest = g_malloc0(value_len + 1); + if(!*p_dest) + return -1; + + if(value_len > 0) + memcpy(*p_dest, p_buff + p_offset, value_len); + + (*p_dest)[value_len] = 0; + + p_offset += value_len; + + return p_offset; +} + +guint32 gfire_proto_read_attr_string_ss(const guint8 *p_buff, gchar **p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x01, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_string_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_string_bs(const guint8 *p_buff, gchar **p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x01, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_string_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +static guint32 gfire_proto_read_int32_value(const guint8 *p_buff, guint32 *p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + memcpy(p_dest, p_buff + p_offset, sizeof(*p_dest)); + *p_dest = GUINT32_FROM_LE(*(guint32*)(p_buff + p_offset)); + p_offset += sizeof(*p_dest); + + return p_offset; +} + +guint32 gfire_proto_read_attr_int32_ss(const guint8 *p_buff, guint32 *p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x02, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_int32_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_int32_bs(const guint8 *p_buff, guint32 *p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x02, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_int32_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +static guint32 gfire_proto_read_sid_value(const guint8 *p_buff, guint8 **p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + *p_dest = g_malloc0(XFIRE_SID_LEN); + if(!*p_dest) + return -1; + + memcpy(*p_dest, p_buff + p_offset, XFIRE_SID_LEN); + p_offset += XFIRE_SID_LEN; + + return p_offset; +} + +guint32 gfire_proto_read_attr_sid_ss(const guint8 *p_buff, guint8 **p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x03, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_sid_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_sid_bs(const guint8 *p_buff, guint8 **p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x03, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_sid_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +static guint32 gfire_proto_read_chatid_value(const guint8 *p_buff, guint8 **p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + *p_dest = g_malloc0(XFIRE_CHATID_LEN); + if(!*p_dest) + return -1; + + memcpy(*p_dest, p_buff + p_offset, XFIRE_CHATID_LEN); + p_offset += XFIRE_CHATID_LEN; + + return p_offset; +} + +guint32 gfire_proto_read_attr_chatid_ss(const guint8 *p_buff, guint8 **p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x06, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_chatid_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_chatid_bs(const guint8 *p_buff, guint8 **p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x06, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_chatid_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +static guint32 gfire_proto_read_int64_value(const guint8 *p_buff, guint64 *p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + *p_dest = GUINT64_FROM_LE(*(guint64*)(p_buff + p_offset)); + p_offset += sizeof(*p_dest); + + return p_offset; +} + +guint32 gfire_proto_read_attr_int64_ss(const guint8 *p_buff, guint64 *p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x07, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_int64_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_int64_bs(const guint8 *p_buff, guint64 *p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x07, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_int64_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +static guint32 gfire_proto_read_boolean_value(const guint8 *p_buff, gboolean *p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + *p_dest = (gboolean)(*(guint8*)(p_buff + p_offset)); + + p_offset += sizeof(guint8); + + return p_offset; +} + +guint32 gfire_proto_read_attr_boolean_ss(const guint8 *p_buff, gboolean *p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x08, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_boolean_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_boolean_bs(const guint8 *p_buff, gboolean *p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x08, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_boolean_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +static guint32 gfire_proto_read_list_value(const guint8 *p_buff, GList **p_dest, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + GList *cur = NULL; + + guint8 element_type = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(element_type); + + guint16 element_count = *((guint16*)(p_buff + p_offset)); + p_offset += sizeof(element_count); + + guint16 i = 0; + for(; i < element_count; i++) + { + list_type_pointers data; + memset(&data, 0, sizeof(list_type_pointers)); + switch(element_type) + { + case 0x01: + p_offset = gfire_proto_read_string_value(p_buff, &data.pchar, p_offset); + if(p_offset == -1) + goto error; + break; + case 0x02: + data.puint32 = (guint32*)g_malloc0(sizeof(guint32)); + p_offset = gfire_proto_read_int32_value(p_buff, data.puint32, p_offset); + if(p_offset == -1) + { + g_free(data.puint8); + goto error; + } + break; + case 0x03: + p_offset = gfire_proto_read_sid_value(p_buff, &data.puint8, p_offset); + if(p_offset == -1) + goto error; + break; + case 0x04: + p_offset = gfire_proto_read_list_value(p_buff, &data.plist, p_offset); + if(p_offset == -1) + goto error; + break; + case 0x06: + p_offset = gfire_proto_read_chatid_value(p_buff, &data.puint8, p_offset); + if(p_offset == -1) + goto error; + break; + case 0x07: + data.puint64 = (guint64*)g_malloc0(sizeof(guint64)); + p_offset = gfire_proto_read_int64_value(p_buff, data.puint64, p_offset); + if(p_offset == -1) + { + g_free(data.puint8); + goto error; + } + break; + case 0x08: + data.pboolean = (gboolean*)g_malloc0(sizeof(gboolean)); + p_offset = gfire_proto_read_boolean_value(p_buff, data.pboolean, p_offset); + if(p_offset == -1) + { + g_free(data.puint8); + goto error; + } + break; + } + *p_dest = g_list_append(*p_dest, data.puint8); + } + + return p_offset; + +error: + cur = *p_dest; + for(; cur; cur = g_list_next(cur)) + if(cur->data) g_free(cur->data); + g_list_free(*p_dest); + *p_dest = NULL; + return -1; +} + +guint32 gfire_proto_read_attr_list_ss(const guint8 *p_buff, GList **p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x04, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_list_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_list_bs(const guint8 *p_buff, GList **p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x04, p_offset); + if(p_offset == -1) + return p_offset; + + p_offset = gfire_proto_read_list_value(p_buff, p_dest, p_offset); + + return p_offset; +} + +guint32 gfire_proto_read_attr_children_count_ss(const guint8 *p_buff, guint8 *p_dest, const gchar *p_name, guint32 p_offset) +{ + if(!p_dest || !p_name || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_ss(p_buff, p_name, 0x05, p_offset); + if(p_offset == -1) + return p_offset; + + *p_dest = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(*p_dest); + + return p_offset; +} + +guint32 gfire_proto_read_attr_children_count_bs(const guint8 *p_buff, guint8 *p_dest, guint8 p_id, guint32 p_offset) +{ + if(!p_dest || !p_buff) + return -1; + + p_offset = gfire_proto_check_attribute_bs(p_buff, p_id, 0x09, p_offset); + if(p_offset == -1) + return p_offset; + + *p_dest = *((guint8*)(p_buff + p_offset)); + p_offset += sizeof(*p_dest); + + return p_offset; +} + +guint32 gfire_proto_write_attr_ss(const gchar *p_name, guint8 p_type, const void *p_data, guint16 p_size, guint32 p_offset) +{ + if(!p_name) + return -1; + + // attributeLength + guint8 attr_len = strlen(p_name); + gfire_network_buffout_write(&attr_len, sizeof(attr_len), p_offset); + p_offset += sizeof(attr_len); + + // attributeName + gfire_network_buffout_write(p_name, attr_len, p_offset); + p_offset += attr_len; + + // attributeType + gfire_network_buffout_write(&p_type, sizeof(p_type), p_offset); + p_offset += sizeof(p_type); + + // Additional length + if(p_type == 0x01) + { + p_size = GUINT16_TO_LE(p_size); + gfire_network_buffout_write(&p_size, sizeof(p_size), p_offset); + p_offset += sizeof(p_size); + } + else if(p_type == 0x05 || p_type == 0x09) + { + guint8 size = p_size; + gfire_network_buffout_write(&size, sizeof(size), p_offset); + p_offset += sizeof(size); + } + + // Content + if(p_size > 0 && p_data) + { + gfire_network_buffout_write(p_data, p_size, p_offset); + p_offset += p_size; + } + + return p_offset; +} + +guint32 gfire_proto_write_attr_bs(guint8 p_id, guint8 p_type, const void *p_data, guint16 p_size, guint32 p_offset) +{ + // attributeID + gfire_network_buffout_write(&p_id, sizeof(p_id), p_offset); + p_offset += sizeof(p_id); + + // attributeType + gfire_network_buffout_write(&p_type, sizeof(p_type), p_offset); + p_offset += sizeof(p_type); + + // Additional length + if(p_type == 0x01) + { + p_size = GUINT16_TO_LE(p_size); + gfire_network_buffout_write(&p_size, sizeof(p_size), p_offset); + p_offset += sizeof(p_size); + } + else if(p_type == 0x05 || p_type == 0x09) + { + guint8 size = p_size; + gfire_network_buffout_write(&size, sizeof(size), p_offset); + p_offset += sizeof(size); + } + + // Content + if(p_size > 0 && p_data) + { + gfire_network_buffout_write(p_data, p_size, p_offset); + p_offset += p_size; + } + + return p_offset; +} + +static guint32 gfire_proto_write_attr_list(GList *p_list, guint8 p_type, guint16 p_len, guint32 p_offset) +{ + gfire_network_buffout_write(&p_type, sizeof(p_type), p_offset); + p_offset += sizeof(p_type); + + guint16 amount = GUINT16_TO_LE(g_list_length(p_list)); + gfire_network_buffout_write(&amount, sizeof(amount), p_offset); + p_offset += sizeof(amount); + + GList *cur = p_list; + for(; cur; cur = g_list_next(cur)) + { + if(p_type == 0x01) + { + guint16 str_len = GUINT16_TO_LE(strlen((gchar*)cur->data)); + gfire_network_buffout_write(&str_len, sizeof(str_len), p_offset); + p_offset += sizeof(str_len); + + gfire_network_buffout_write(cur->data, GUINT16_FROM_LE(str_len), p_offset); + p_offset += GUINT16_FROM_LE(str_len); + + continue; + } + + gfire_network_buffout_write(cur->data, p_len, p_offset); + p_offset += p_len; + } + + return p_offset; +} + +guint32 gfire_proto_write_attr_list_ss(const gchar *p_name, GList *p_list, guint8 p_type, guint16 p_typelen, guint32 p_offset) +{ + if(!p_name) + return -1; + + // attributeLength + guint8 attr_len = strlen(p_name); + gfire_network_buffout_write(&attr_len, sizeof(attr_len), p_offset); + p_offset += sizeof(attr_len); + + // attributeName + gfire_network_buffout_write(p_name, attr_len, p_offset); + p_offset += attr_len; + + // attributeType + guint8 type = 0x04; + gfire_network_buffout_write(&type, sizeof(type), p_offset); + p_offset += sizeof(type); + + p_offset = gfire_proto_write_attr_list(p_list, p_type, p_typelen, p_offset); + + return p_offset; +} + +guint32 gfire_proto_write_attr_list_bs(guint8 p_id, GList *p_list, guint8 p_type, guint16 p_typelen, guint32 p_offset) +{ + // attributeID + gfire_network_buffout_write(&p_id, sizeof(p_id), p_offset); + p_offset += sizeof(p_id); + + // attributeType + guint8 type = 0x04; + gfire_network_buffout_write(&type, sizeof(type), p_offset); + p_offset += sizeof(type); + + p_offset = gfire_proto_write_attr_list(p_list, p_type, p_typelen, p_offset); + + return p_offset; +} + +guint32 gfire_proto_write_header(guint16 p_length, guint16 p_type, guint8 p_atts, guint32 p_offset) +{ + p_length = GUINT16_TO_LE(p_length); + gfire_network_buffout_write(&p_length, sizeof(p_length), p_offset); + p_offset += sizeof(p_length); + + p_type = GUINT16_TO_LE(p_type); + gfire_network_buffout_write(&p_type, sizeof(p_type), p_offset); + p_offset += sizeof(p_type); + + gfire_network_buffout_write(&p_atts, sizeof(p_atts), p_offset); + p_offset += sizeof(p_atts); + + return p_offset; +} + +guint32 gfire_proto_write_header32(guint32 p_length, guint16 p_type, guint8 p_atts, guint32 p_offset) +{ + p_length = GUINT32_TO_LE(p_length); + gfire_network_buffout_write(&p_length, sizeof(p_length), p_offset); + p_offset += sizeof(p_length); + + p_type = GUINT16_TO_LE(p_type); + gfire_network_buffout_write(&p_type, sizeof(p_type), p_offset); + p_offset += sizeof(p_type); + + gfire_network_buffout_write(&p_atts, sizeof(p_atts), p_offset); + p_offset += sizeof(p_atts); + + return p_offset; +} diff -Nru gfire-0.8.3/src/gf_protocol.h gfire-0.9.4/src/gf_protocol.h --- gfire-0.8.3/src/gf_protocol.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_protocol.h 2011-03-14 20:21:50.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_PROTOCOL_H +#define _GF_PROTOCOL_H + +#include "gf_base.h" + +typedef union _list_type_pointers +{ + gchar *pchar; + guint8 *puint8; + guint32 *puint32; + guint64 *puint64; + gboolean *pboolean; + GList *plist; +} list_type_pointers; + +// String style attributes +guint32 gfire_proto_check_attribute_ss(const guint8 *p_buff, const gchar *p_name, guint8 p_type, guint32 p_offset); +guint32 gfire_proto_read_attr_string_ss(const guint8 *p_buff, gchar **p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_int32_ss(const guint8 *p_buff, guint32 *p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_sid_ss(const guint8 *p_buff, guint8 **p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_chatid_ss(const guint8 *p_buff, guint8 **p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_int64_ss(const guint8 *p_buff, guint64 *p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_boolean_ss(const guint8 *p_buff, gboolean *p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_list_ss(const guint8 *p_buff, GList **p_dest, const gchar *p_name, guint32 p_offset); + +// Byte style attributes +guint32 gfire_proto_check_attribute_bs(const guint8 *p_buff, guint8 p_id, guint8 p_type, guint32 p_offset); +guint32 gfire_proto_read_attr_string_bs(const guint8 *p_buff, gchar **p_dest, guint8 p_id, guint32 p_offset); +guint32 gfire_proto_read_attr_int32_bs(const guint8 *p_buff, guint32 *p_dest, guint8 p_id, guint32 p_offset); +guint32 gfire_proto_read_attr_sid_bs(const guint8 *p_buff, guint8 **p_dest, guint8 p_id, guint32 p_offset); +guint32 gfire_proto_read_attr_chatid_bs(const guint8 *p_buff, guint8 **p_dest, guint8 p_id, guint32 p_offset); +guint32 gfire_proto_read_attr_int64_bs(const guint8 *p_buff, guint64 *p_dest, guint8 p_id, guint32 p_offset); +guint32 gfire_proto_read_attr_boolean_bs(const guint8 *p_buff, gboolean *p_dest, guint8 p_id, guint32 p_offset); +guint32 gfire_proto_read_attr_list_bs(const guint8 *p_buff, GList **p_dest, guint8 p_id, guint32 p_offset); + +// Child-attributes attributes +guint32 gfire_proto_read_attr_children_count_ss(const guint8 *p_buff, guint8 *p_dest, const gchar *p_name, guint32 p_offset); +guint32 gfire_proto_read_attr_children_count_bs(const guint8 *p_buff, guint8 *p_dest, guint8 p_id, guint32 p_offset); + +// Writing attributes +guint32 gfire_proto_write_attr_ss(const gchar *p_name, guint8 p_type, const void *p_data, guint16 p_size, guint32 p_offset); +guint32 gfire_proto_write_attr_bs(guint8 p_id, guint8 p_type, const void *p_data, guint16 p_size, guint32 p_offset); +guint32 gfire_proto_write_attr_list_ss(const gchar *p_name, GList *p_list, guint8 p_type, guint16 p_typelen, guint32 p_offset); +guint32 gfire_proto_write_attr_list_bs(guint8 p_id, GList *p_list, guint8 p_type, guint16 p_typelen, guint32 p_offset); +guint32 gfire_proto_write_header(guint16 p_length, guint16 p_type, guint8 p_atts, guint32 p_offset); +guint32 gfire_proto_write_header32(guint32 p_length, guint16 p_type, guint8 p_atts, guint32 p_offset); + +#endif // _GF_PROTOCOL_H diff -Nru gfire-0.8.3/src/gf_purple.c gfire-0.9.4/src/gf_purple.c --- gfire-0.8.3/src/gf_purple.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_purple.c 2011-03-14 20:21:44.000000000 +0000 @@ -0,0 +1,1300 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gfire_proto.h" +#include "gf_network.h" +#include "gfire.h" +#include "gf_menus.h" +#include "gf_games.h" +#include "gf_friend_search.h" +#include "gf_purple.h" +#include "gf_chat_proto.h" + +#ifdef USE_GAME_DETECTION +# include "gf_game_detection.h" +#endif // USE_GAME_DETECTION + +#ifdef HAVE_GTK +# include "gf_server_query.h" +#endif // HAVE_GTK + +static PurplePlugin *_gfire_plugin = NULL; + +static void gfire_purple_blist_node_added_signal(PurpleBlistNode *p_node) +{ + if(!p_node) + return; + + if(PURPLE_BLIST_NODE_IS_CHAT(p_node)) + { + PurpleChat *chat = PURPLE_CHAT(p_node); + PurpleAccount *account = purple_chat_get_account(chat); + PurpleConnection *connection = purple_account_get_connection(account); + + // Only for our plugin + if(!g_ascii_strcasecmp(GFIRE_PRPL_ID, purple_account_get_protocol_id(account))) + { + if(connection && PURPLE_CONNECTION_IS_CONNECTED(connection)) + { + gfire_chat *gchat = gfire_find_chat(connection->proto_data, + g_hash_table_lookup(purple_chat_get_components(chat), "room"), + GFFC_TOPIC); + + if(!gchat) + return; + + gfire_chat_set_purple_chat(gchat, chat); + gfire_chat_set_saved(gchat, TRUE); + + purple_debug_misc("gfire", "chat room added\n"); + } + } + } +} + +static void gfire_purple_blist_node_removed_signal(PurpleBlistNode *p_node) +{ + if(!p_node) + return; + + if(PURPLE_BLIST_NODE_IS_CHAT(p_node)) + { + PurpleChat *chat = PURPLE_CHAT(p_node); + PurpleAccount *account = purple_chat_get_account(chat); + PurpleConnection *connection = purple_account_get_connection(account); + + // Only for our plugin + if(!g_ascii_strcasecmp(GFIRE_PRPL_ID, purple_account_get_protocol_id(account))) + { + if(connection && PURPLE_CONNECTION_IS_CONNECTED(connection)) + { + GHashTable *comp = purple_chat_get_components(chat); + gfire_chat *gchat = gfire_find_chat(connection->proto_data, + g_hash_table_lookup(comp, "room"), + GFFC_TOPIC); + + // Remove the room directly + if(!gchat && g_hash_table_lookup(comp, "chat_id")) + { + guint8 *chat_id = purple_base64_decode(g_hash_table_lookup(comp, "chat_id"), NULL); + guint16 len = gfire_chat_proto_create_save_chat_room(chat_id, FALSE); + if(len > 0) gfire_send(connection, len); + g_free(chat_id); + + purple_debug_misc("gfire", "chat room removed by ID\n"); + + return; + } + // Insufficient data for a remove available + else + return; + + gfire_chat_set_saved(gchat, FALSE); + purple_debug_misc("gfire", "chat room removed by topic\n"); + } + } + } +} + +static void gfire_purple_blist_node_ext_menu_signal(PurpleBlistNode *p_node, GList **p_menu) +{ + if(!p_node) + return; + + if(PURPLE_BLIST_NODE_IS_GROUP(p_node)) + { + gint clanid = purple_blist_node_get_int(p_node, "clanid"); + // Skip non-community groups + if(clanid == 0) + return; + + // Find the account/gfire data for this group + GSList *accounts = purple_group_get_accounts(PURPLE_GROUP(p_node)); + PurpleAccount *account = NULL; + GSList *cur = accounts; + while(cur) + { + if(purple_account_is_connected((PurpleAccount*)cur->data) && + !g_ascii_strcasecmp(GFIRE_PRPL_ID, purple_account_get_protocol_id((PurpleAccount*)cur->data))) + { + account = (PurpleAccount*)cur->data; + break; + } + cur = g_slist_next(cur); + } + g_slist_free(accounts); + + if(!account) + return; + + gfire_data *gfire = purple_account_get_connection(account)->proto_data; + if(!gfire) + return; + + gfire_clan *clan = gfire_find_clan(gfire, clanid); + // Invalid ID? + if(!clan) + return; + + PurpleMenuAction *me = NULL; + // Community site + me = purple_menu_action_new(_("Xfire Community Site"), + PURPLE_CALLBACK(gfire_clan_menu_site_cb), gfire, NULL); + if(!me) + return; + + *p_menu = g_list_append(*p_menu, me); + } +} + +static const gchar *gfire_purple_blist_icon(PurpleAccount *p_a, PurpleBuddy *p_b) +{ + return "gfire"; +} + +static const gchar *gfire_purple_blist_emblems(PurpleBuddy *p_b) +{ + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + PurplePresence *p = NULL; + PurpleConnection *gc = NULL; + static gchar emblem[100]; + + if (!p_b || (NULL == p_b->account) || !(gc = purple_account_get_connection(p_b->account)) || + !(gfire = (gfire_data *) gc->proto_data)) + return NULL; + + gf_buddy = gfire_find_buddy(gfire, purple_buddy_get_name(p_b), GFFB_NAME); + + p = purple_buddy_get_presence(p_b); + + if(purple_presence_is_online(p) == TRUE) + { + if(gfire_buddy_is_playing(gf_buddy) && !gfire_buddy_is_talking(gf_buddy)) + { + const gfire_game_data *game = gfire_buddy_get_game_data(gf_buddy); + gchar *game_name = gfire_game_short_name(game->id); + if(game_name) + { + g_snprintf(emblem, 100, "game_%s", game_name); + g_free(game_name); + gchar *file = g_strdup_printf("%s.png", emblem); + // See Pidgins gtkblist.c for the following line + gchar *path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", file, NULL); + g_free(file); + + if(g_file_test(path, G_FILE_TEST_EXISTS)) + { + g_free(path); + return emblem; + } + + g_free(path); + } + + return "game"; + } + else if(!gfire_buddy_is_playing(gf_buddy) && gfire_buddy_is_talking(gf_buddy)) + return "voip"; + else if (gfire_buddy_is_playing(gf_buddy) && gfire_buddy_is_talking(gf_buddy)) + return "game-voip"; + } + + return NULL; +} + +static gchar *gfire_purple_status_text(PurpleBuddy *p_buddy) +{ + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + PurplePresence *p = NULL; + PurpleConnection *gc = NULL; + + if(!p_buddy || !p_buddy->account || !(gc = purple_account_get_connection(p_buddy->account)) || + !(gfire = (gfire_data *)gc->proto_data) || (!gfire->buddies)) + return NULL; + + gf_buddy = gfire_find_buddy(gfire, p_buddy->name, GFFB_NAME); + if (!gf_buddy) + return NULL; + + p = purple_buddy_get_presence(p_buddy); + + if(purple_presence_is_online(p)) + { + gchar *status = gfire_buddy_get_status_text(gf_buddy, FALSE); + if(!status) + return NULL; + + gchar *escaped = gfire_escape_html(status); + g_free(status); + + return escaped; + } + return NULL; +} + +static void gfire_purple_blist_tooltip_text(PurpleBuddy *p_buddy, PurpleNotifyUserInfo *p_user_info, gboolean p_full) +{ + PurpleConnection *gc = NULL; + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + PurplePresence *p = NULL; + + if (!p_buddy || !p_buddy->account || !(gc = purple_account_get_connection(p_buddy->account)) || + !(gfire = (gfire_data*)gc->proto_data) || !gfire->buddies) + return; + + gf_buddy = gfire_find_buddy(gfire, p_buddy->name, GFFB_NAME); + if (!gf_buddy) + return; + + p = purple_buddy_get_presence(p_buddy); + + if(purple_presence_is_online(p)) + { + gfire_buddy_request_info(gf_buddy); + + // Game Info + if(gfire_buddy_is_playing(gf_buddy)) + { + const gfire_game_data *game_data = gfire_buddy_get_game_data(gf_buddy); + + gchar *game_name = gfire_game_name(game_data->id, TRUE); + purple_notify_user_info_add_pair(p_user_info, _("Game"), NN(game_name)); + if(game_name) g_free(game_name); + + if(gfire_game_data_has_addr(game_data)) + { + gchar *addr = gfire_game_data_addr_str(game_data); + purple_notify_user_info_add_pair(p_user_info, _("Server"), addr); + g_free(addr); + } + } + + if(gfire_buddy_get_game_client_data(gf_buddy)) + { + const GList *current = gfire_buddy_get_game_client_data(gf_buddy); + for(; current; current = g_list_next(current)) + { + if(((game_client_data*)current->data)->value && (*((game_client_data*)current->data)->value != 0)) + purple_notify_user_info_add_pair(p_user_info, NN(((game_client_data*)current->data)->key), + ((game_client_data*)current->data)->value); + } + } + + // VoIP Info + if(gfire_buddy_is_talking(gf_buddy)) + { + const gfire_game_data *voip_data = gfire_buddy_get_voip_data(gf_buddy); + + gchar *voip_name = gfire_game_name(voip_data->id, TRUE); + + if(gfire_game_data_has_addr(voip_data)) + { + gchar *addr = gfire_game_data_addr_str(voip_data); + purple_notify_user_info_add_pair(p_user_info, NN(voip_name), addr); + g_free(addr); + } + else + purple_notify_user_info_add_pair(p_user_info, NN(voip_name), _("unknown")); + + if(voip_name) g_free(voip_name); + } + + // Status + gchar *status_msg = gfire_buddy_get_status_text(gf_buddy, TRUE); + if(status_msg) + { + gchar *tmp = gfire_escape_html(status_msg); + g_free(status_msg); + purple_notify_user_info_add_pair(p_user_info, gfire_buddy_get_status_name(gf_buddy), tmp); + if(tmp) g_free(tmp); + } + else + purple_notify_user_info_add_pair(p_user_info, _("Status"), gfire_buddy_get_status_name(gf_buddy)); + + // FoF common friends + if(gfire_buddy_is_friend_of_friend(gf_buddy)) + { + gchar *common_friends = gfire_buddy_get_common_buddies_str(gf_buddy); + if(common_friends) + { + gchar *escaped_cf = gfire_escape_html(common_friends); + g_free(common_friends); + purple_notify_user_info_add_pair(p_user_info, _("Common Friends"), escaped_cf); + g_free(escaped_cf); + } + } + } +} + + + +static GList *gfire_purple_status_types(PurpleAccount *p_account) +{ + PurpleStatusType *type; + GList *types = NULL; + + type = purple_status_type_new_with_attrs( + PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, + "message", "Message", purple_value_new(PURPLE_TYPE_STRING), + NULL); + types = g_list_append(types, type); + + type = purple_status_type_new_with_attrs( + PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, + "message", "Message", purple_value_new(PURPLE_TYPE_STRING), + NULL); + types = g_list_append(types, type); + + type = purple_status_type_new_with_attrs( + PURPLE_STATUS_UNAVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, + "message", "Message", purple_value_new(PURPLE_TYPE_STRING), + NULL); + types = g_list_append(types, type); + + type = purple_status_type_new(PURPLE_STATUS_OFFLINE, NULL, NULL, TRUE); + types = g_list_append(types, type); + + return types; +} + +static void gfire_purple_login(PurpleAccount *p_account) +{ + static gboolean signals_registered = FALSE; + if(!signals_registered) + { + purple_signal_connect(purple_blist_get_handle(), "blist-node-added", _gfire_plugin, + PURPLE_CALLBACK(gfire_purple_blist_node_added_signal), NULL); + purple_signal_connect(purple_blist_get_handle(), "blist-node-removed", _gfire_plugin, + PURPLE_CALLBACK(gfire_purple_blist_node_removed_signal), NULL); + purple_signal_connect(purple_blist_get_handle(), "blist-node-extended-menu", _gfire_plugin, + PURPLE_CALLBACK(gfire_purple_blist_node_ext_menu_signal), NULL); + + signals_registered = TRUE; + } + + gfire_data *gfire; + + PurpleConnection *gc = purple_account_get_connection(p_account); + /* set connection flags for chats and im's tells purple what we can and can't handle */ + gc->flags |= PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_FONTSIZE + | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_NO_IMAGES; + + gfire = gfire_create(gc); + if(!gfire) + { + purple_connection_error(gc, _("Protocol initialization failed.")); + return; + } + + gc->proto_data = gfire; + + gfire_login(gfire); +} + +static void gfire_purple_close(PurpleConnection *p_gc) +{ + gfire_close((gfire_data*)p_gc->proto_data); +} + +static int gfire_purple_im_send(PurpleConnection *p_gc, const gchar *p_who, const gchar *p_what, PurpleMessageFlags p_flags) +{ + PurplePresence *p = NULL; + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + PurpleAccount *account = NULL; + PurpleBuddy *buddy = NULL; + + if (!p_gc || !(gfire = (gfire_data*)p_gc->proto_data)) + return -ENOTCONN; + + gf_buddy = gfire_find_buddy(gfire, p_who, GFFB_NAME); + if (!gf_buddy) + return -1; + + account = purple_connection_get_account(p_gc); + buddy = purple_find_buddy(account, gf_buddy->name); + if(!buddy) + { + purple_conv_present_error(p_who, account, _("Message could not be sent. Buddy not in contact list")); + return 1; + } + + p = purple_buddy_get_presence(buddy); + + if(purple_presence_is_online(p)) + { + gfire_buddy_send(gf_buddy, p_what); + return 1; + } + else + { + purple_conv_present_error(p_who, account, _("Message could not be sent. Buddy offline")); + return 1; + } +} + +static unsigned int gfire_purple_send_typing(PurpleConnection *p_gc, const gchar *p_who, PurpleTypingState p_state) +{ + gfire_buddy *gf_buddy = NULL; + gfire_data *gfire = NULL; + gboolean typenorm = TRUE; + + if (!p_gc || !(gfire = (gfire_data*)p_gc->proto_data)) + return 1; + + gf_buddy = gfire_find_buddy(gfire, p_who, GFFB_NAME); + if (!gf_buddy) return 1; + + typenorm = purple_account_get_bool(purple_connection_get_account(p_gc), "typenorm", TRUE); + + if (!typenorm) + return 0; + + gfire_buddy_send_typing(gf_buddy, p_state == PURPLE_TYPING); + + if(p_state == PURPLE_TYPING) + return XFIRE_SEND_TYPING_TIMEOUT; + else + return 0; +} + +static void gfire_purple_get_info(PurpleConnection *p_gc, const gchar *p_who) +{ + gfire_show_buddy_info((gfire_data*)p_gc->proto_data, p_who); +} + +static void gfire_purple_set_status(PurpleAccount *p_account, PurpleStatus *p_status) +{ + PurpleConnection *gc = NULL; + gfire_data *gfire = NULL; + + if (!purple_status_is_active(p_status)) + return; + + gc = purple_account_get_connection(p_account); + gfire = (gfire_data *)gc->proto_data; + + purple_debug(PURPLE_DEBUG_MISC, "gfire", "(status): got status change to name: %s id: %s\n", + NN(purple_status_get_name(p_status)), + NN(purple_status_get_id(p_status))); + + gfire_set_status(gfire, p_status); +} + +static void gfire_purple_add_buddy_msg_ok_cb(PurpleBuddy *p_buddy, const gchar *p_msg) +{ + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(p_buddy)); + if(!gc) + return; + + // Send the invite with a message + guint16 packet_len = gfire_proto_create_invitation(purple_buddy_get_name(p_buddy), p_msg ? p_msg : ""); + if(packet_len > 0) gfire_send(gc, packet_len); +} + +static void gfire_purple_add_buddy_msg_cancel_cb(PurpleBuddy *p_buddy) +{ + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(p_buddy)); + if(!gc) + return; + + // Just send the invite + guint16 packet_len = gfire_proto_create_invitation(purple_buddy_get_name(p_buddy), ""); + if(packet_len > 0) gfire_send(gc, packet_len); +} + +static void gfire_purple_add_buddy(PurpleConnection *p_gc, PurpleBuddy *p_buddy, PurpleGroup *p_group) +{ + gfire_data *gfire = NULL; + if(!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_buddy || !purple_buddy_get_name(p_buddy)) + return; + + gfire_group *group = NULL; + if(p_group && p_group != purple_find_group(GFIRE_DEFAULT_GROUP_NAME) && + p_group != purple_find_group(GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME)) + { + group = gfire_find_group(gfire, p_group, GFFG_PURPLE); + if(!group) + { + group = gfire_group_create(gfire, purple_group_get_name(p_group), 0); + gfire_add_group(gfire, group); + } + } + + gfire_buddy *gf_buddy = gfire_find_buddy(gfire, purple_buddy_get_name(p_buddy), GFFB_NAME); + if(!gf_buddy) + { + gf_buddy = gfire_buddy_create(0, purple_buddy_get_name(p_buddy), purple_buddy_get_alias(p_buddy), GFBT_FRIEND); + if(!gf_buddy) + return; + + gfire_add_buddy(gfire, gf_buddy, group); + } + else + gfire_buddy_make_friend(gf_buddy, group); + + // Request the invitation message + purple_request_input(p_gc, _("Xfire Invitation Message"), + NULL, _("Please enter the message you want to send your buddy with this invite:"), + _("Please add me to your friends list!"), TRUE, FALSE, "", + _("Invite with a message"), G_CALLBACK(gfire_purple_add_buddy_msg_ok_cb), + _("Invite without a message"), G_CALLBACK(gfire_purple_add_buddy_msg_cancel_cb), + purple_connection_get_account(p_gc), NULL, NULL, p_buddy); +} + +static void gfire_purple_remove_buddy(PurpleConnection *p_gc, PurpleBuddy *p_buddy, PurpleGroup *p_group) +{ + gfire_data *gfire = NULL; + gfire_buddy *gf_buddy = NULL; + PurpleAccount *account = NULL; + + if(!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_buddy || !p_buddy->name) return; + + if(!(account = purple_connection_get_account(p_gc))) return; + + gf_buddy = gfire_find_buddy(gfire, p_buddy->name, GFFB_NAME); + if(!gf_buddy) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "gfire_purple_remove_buddy: buddy find returned NULL\n"); + return; + } + + if(gfire_buddy_is_friend(gf_buddy)) + { + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Removing buddy: %s\n", gfire_buddy_get_name(gf_buddy)); + gfire_remove_buddy(gfire, gf_buddy, TRUE, FALSE); + } + else + { + purple_notify_message((void *)p_gc, PURPLE_NOTIFY_MSG_INFO, _("Xfire Buddy Removal"), _("Xfire Buddy Removal"), + _("You have removed a buddy which is not on your friends list, it will be " + "restored on the next login."), NULL, NULL); + gfire_remove_buddy(gfire, gf_buddy, FALSE, FALSE); + } +} + +/* connection keep alive. We send a packet to the xfire server + * saying we are still around. Otherwise they will forcibly close our connection + * purple allows for this, but calls us every 30 seconds. We keep track of *all* sent + * packets. We only need to send this keep alive if we haven't sent anything in a long + * time. So we watch and wait. +*/ +static void gfire_purple_keep_alive(PurpleConnection *p_gc) +{ + gfire_data *gfire = NULL; + + + if ((purple_connection_get_state(p_gc) != PURPLE_DISCONNECTED) && + (NULL != (gfire = (gfire_data *)p_gc->proto_data))) + gfire_keep_alive(gfire); +} + +/* + * purple callback function. Not used directly. Purple calls this callback + * when user right clicks on Xfire buddy (but before menu is displayed) + * Function adds right click "Join Game . . ." menu option. If game is + * playable (configured through launch.xml), and user is not already in + * a game. + * + * @param node Pidgin buddy list node entry that was right clicked + * + * @return Glist list of menu items with callbacks attached (or null) +*/ +static GList *gfire_purple_node_menu(PurpleBlistNode *p_node) +{ + GList *ret = NULL; + PurpleMenuAction *me = NULL; + PurpleBuddy *b = (PurpleBuddy*)p_node; + gfire_buddy *gf_buddy = NULL; + PurpleConnection *gc = NULL; + gfire_data *gfire = NULL; + + if(PURPLE_BLIST_NODE_IS_BUDDY(p_node)) + { + if (!b || !b->account || !(gc = purple_account_get_connection(b->account)) || + !(gfire = (gfire_data *)gc->proto_data)) + return NULL; + + + gf_buddy = gfire_find_buddy(gfire, b->name, GFFB_NAME); + if(!gf_buddy) + return NULL; + + if(!gfire_buddy_is_friend(gf_buddy)) + { + me = purple_menu_action_new(_("Add as friend"), + PURPLE_CALLBACK(gfire_buddy_menu_add_as_friend_cb),NULL, NULL); + + if (!me) + return NULL; + + ret = g_list_append(ret, me); + } + +#ifdef USE_GAME_DETECTION + if(gfire_buddy_is_playing(gf_buddy) && !gfire_game_detector_is_playing()) +#else + if(gfire_buddy_is_playing(gf_buddy)) +#endif // USE_GAME_DETECTION + { + const gfire_game_data *game_data = gfire_buddy_get_game_data(gf_buddy); + + if(gfire_game_playable(game_data->id)) + { + me = purple_menu_action_new(_("Join Game ..."), + PURPLE_CALLBACK(gfire_buddy_menu_joingame_cb),NULL, NULL); + + if(!me) + return NULL; + + ret = g_list_append(ret, me); + } + +#ifdef HAVE_GTK + if(game_data->ip.value && gfire_server_query_supports(gfire_game_server_query_type(game_data->id))) + { + me = purple_menu_action_new(_("Display Server Details"), + PURPLE_CALLBACK(gfire_buddy_menu_server_details_cb), NULL, NULL); + + if(!me) + return NULL; + + ret = g_list_append(ret, me); + } +#endif // HAVE_GTK + } + +#ifdef USE_GAME_DETECTION + if(gfire_buddy_is_talking(gf_buddy) && !gfire_game_detector_is_voiping()) +#else + if(gfire_buddy_is_talking(gf_buddy)) +#endif // USE_GAME_DETECTION + { + const gfire_game_data *voip_data = gfire_buddy_get_voip_data(gf_buddy); + + if(gfire_game_playable(voip_data->id)) + { + me = purple_menu_action_new(_("Join VoIP ..."), + PURPLE_CALLBACK(gfire_buddy_menu_joinvoip_cb),NULL, NULL); + + if (!me) + return NULL; + + ret = g_list_append(ret, me); + } + } + + me = purple_menu_action_new(_("Xfire Profile"), + PURPLE_CALLBACK(gfire_buddy_menu_profile_cb),NULL, NULL); + + if (!me) + return NULL; + + ret = g_list_append(ret, me); + + return ret; + } + + return NULL; + } + +void gfire_purple_nick_change_cb(PurpleConnection *p_gc, const gchar *p_entry) +{ + gfire_data *gfire = NULL; + + if (!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_entry) return; + + gfire_set_nick(gfire, p_entry); + + purple_connection_set_display_name(p_gc, p_entry); +} + +static gboolean gfire_purple_actions_game_cb(const gfire_game_configuration *p_gconf, GList **p_list) +{ + if(p_gconf && p_list) + { + const gfire_game *game = gfire_game_by_id(p_gconf->game_id); + if(game) + { + gchar *label = g_strdup_printf(_("Launch %s"), game->name); + PurplePluginAction *act = purple_plugin_action_new(label, gfire_menu_action_launch_game_cb); + if(act) + { + act->user_data = GUINT_TO_POINTER(p_gconf->game_id); + *p_list = g_list_append(*p_list, act); + } + } + } + + return FALSE; +} + +static GList *gfire_purple_actions(PurplePlugin *p_plugin, gpointer p_context) +{ + GList *m = NULL; + PurplePluginAction *act; + + // General things + act = purple_plugin_action_new(_("Change Nickname"), + gfire_menu_action_nick_change_cb); + m = g_list_append(m, act); + act = purple_plugin_action_new(_("My Profile Page"), + gfire_menu_action_profile_page_cb); + m = g_list_append(m, act); + m = g_list_append(m, NULL); + act = purple_plugin_action_new(_("Friend Search"), + gfire_show_friend_search_cb); + m = g_list_append(m, act); + + // Game configuration + act = purple_plugin_action_new(_("Reload Game Config"), + gfire_menu_action_reload_lconfig_cb); + m = g_list_append(m, act); + +#ifdef HAVE_GTK + if(strcmp(purple_core_get_ui(), "gnt-purple") != 0) + { + act = purple_plugin_action_new(_("Manage Games"), gfire_game_manager_show); + m = g_list_append(m, act); + + // Server browser + act = purple_plugin_action_new(_("Server Browser"), gfire_show_server_browser); + m = g_list_append(m, act); + } +#endif // HAVE_GTK + + // Game launchers + m = g_list_append(m, NULL); + gfire_game_config_foreach(G_CALLBACK(gfire_purple_actions_game_cb), &m); + if(g_list_last(m)->data) + m = g_list_append(m, NULL); + + // About + act = purple_plugin_action_new(_("About"), + gfire_menu_action_about_cb); + m = g_list_append(m, act); + return m; +} + +static void gfire_purple_join_chat(PurpleConnection *p_gc, GHashTable *p_table) +{ + gfire_data *gfire = NULL; + if (!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_table) + return; + + gchar *cid_base64 = NULL; + guint8 *cid = NULL; + gchar *room = (gchar*)g_hash_table_lookup(p_table, "room"); + gchar *pass = (gchar*)g_hash_table_lookup(p_table, "password"); + if(!(cid_base64 = g_hash_table_lookup(p_table, "chat_id"))) + { + // no cid, we need to create this room + purple_debug(PURPLE_DEBUG_MISC, "gfire", "Attempting to create chat room %s\n", NN(room)); + cid = g_malloc0(XFIRE_CHATID_LEN); + } + else + { + cid = purple_base64_decode(cid_base64, NULL); + } + + gfire_chat_join(cid, room, pass, p_gc); + + g_free(cid); +} + +static void gfire_purple_chat_leave(PurpleConnection *p_gc, int p_prpl_id) +{ + gfire_data *gfire = NULL; + if (!p_gc || !(gfire = (gfire_data *)p_gc->proto_data)) + return; + + gfire_chat *chat = gfire_find_chat(gfire, &p_prpl_id, GFFC_PURPLEID); + if(!chat) + { + purple_debug(PURPLE_DEBUG_ERROR, "gfire", "gfire_purple_chat_leave: Unknown purple chat id!\n"); + return; + } + + gfire_leave_chat(gfire, chat); +} + +static GList *gfire_purple_chat_info(PurpleConnection *p_gc) +{ + GList *m = NULL; + struct proto_chat_entry *pce; + + pce = g_malloc0(sizeof(struct proto_chat_entry)); + pce->label = _("_Room:"); + pce->identifier = "room"; + pce->required = TRUE; + m = g_list_append(m, pce); + + pce = g_malloc0(sizeof(struct proto_chat_entry)); + pce->label = _("_Password:"); + pce->identifier = "password"; + pce->secret = TRUE; + m = g_list_append(m, pce); + + return m; +} + +static GHashTable *gfire_purple_chat_info_defaults(PurpleConnection *p_gc, const gchar *p_chat_name) +{ + GHashTable *defaults; + + defaults = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + + if (p_chat_name != NULL) + g_hash_table_insert(defaults, g_strdup("room"), g_strdup(p_chat_name)); + + return defaults; +} + +static gchar *gfire_purple_get_chat_name(GHashTable *p_data) +{ + return g_strdup(g_hash_table_lookup(p_data, "room")); +} + +static void gfire_purple_reject_chat(PurpleConnection *p_gc, GHashTable *p_components) +{ + guint8 *cid = NULL; + + if (!p_gc || !p_components) return; + + if ((cid = g_hash_table_lookup(p_components, "chat_id"))) + gfire_chat_reject(cid, p_gc); +} + +static void gfire_purple_chat_invite(PurpleConnection *p_gc, int p_id, const gchar *p_message, const gchar *p_who) +{ + gfire_data *gfire = NULL; + gfire_chat *chat = NULL; + gfire_buddy *buddy = NULL; + + if (!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_who) return; + + chat = gfire_find_chat(gfire, &p_id, GFFC_PURPLEID); + if(!chat) + return; + + buddy = gfire_find_buddy(gfire, p_who, GFFB_NAME); + if(!buddy) + return; + + gfire_chat_invite(chat, buddy); +} + +static int gfire_purple_chat_send(PurpleConnection *p_gc, int p_id, const gchar *p_message, PurpleMessageFlags p_flags) +{ + gfire_data *gfire = NULL; + gfire_chat *chat = NULL; + + if (!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_message) return -1; + + chat = gfire_find_chat(gfire, &p_id, GFFC_PURPLEID); + if(!chat) + return -1; + + gfire_chat_send(chat, p_message); + return 0; +} + +static void gfire_purple_chat_change_motd(PurpleConnection *p_gc, int p_id, const gchar *p_motd) +{ + gfire_data *gfire = NULL; + gfire_chat *chat = NULL; + + if (!p_gc || !(gfire = (gfire_data *)p_gc->proto_data) || !p_motd) return; + + chat = gfire_find_chat(gfire, &p_id, GFFC_PURPLEID); + if(!chat) + return; + + gchar *unescaped = purple_unescape_html(p_motd); + + if(strlen(unescaped) > 200) + { + purple_notify_message(NULL, PURPLE_NOTIFY_MSG_WARNING, _("Xfire Groupchat"), _("MotD change failed"), + _("The MotD contains more than 200 characters."), NULL, NULL); + g_free(unescaped); + return; + } + + gfire_chat_change_motd(chat, unescaped); + g_free(unescaped); +} + +// By default everyone can receive a file +static gboolean gfire_purple_can_receive_file(PurpleConnection *p_gc, const gchar *p_who) +{ + if(!p_gc || !p_gc->proto_data || !p_who) + return FALSE; + + gfire_data *gfire = p_gc->proto_data; + + gfire_buddy *gf_buddy = gfire_find_buddy(gfire, p_who, GFFB_NAME); + if(!gf_buddy) + { + purple_debug_warning("gfire", "gfire_purple_can_receive_file: called on invalid buddy\n"); + return FALSE; + } + + return (gfire_has_p2p(gfire) && gfire_buddy_is_online(gf_buddy) && gfire_buddy_has_p2p(gf_buddy)); +} + +static PurpleXfer *gfire_purple_new_xfer(PurpleConnection *p_gc, const gchar *p_who) +{ + if(!p_gc || !p_gc->proto_data || !p_who) + return NULL; + + gfire_data *gfire = p_gc->proto_data; + + gfire_buddy *gf_buddy = gfire_find_buddy(gfire, p_who, GFFB_NAME); + if(!gf_buddy) + { + purple_debug_warning("gfire", "gfire_purple_new_xfer: called on invalid buddy\n"); + return NULL; + } + + if(!gfire_buddy_uses_p2p(gf_buddy)) + gfire_buddy_request_p2p(gf_buddy, TRUE); + + PurpleXfer *xfer = purple_xfer_new(purple_connection_get_account(p_gc), PURPLE_XFER_SEND, p_who); + if(!xfer) + { + purple_debug_warning("gfire", "gfire_purple_new_xfer: xfer creation failed\n"); + return NULL; + } + + xfer->data = gf_buddy; + purple_xfer_set_init_fnc(xfer, gfire_buddy_p2p_ft_init); + + return xfer; +} + +static void gfire_purple_send_file(PurpleConnection *p_gc, const gchar *p_who, const gchar *p_filename) +{ + if(!p_gc || !p_gc->proto_data || !p_who) + return; + + gfire_buddy *gf_buddy = gfire_find_buddy(p_gc->proto_data, p_who, GFFB_NAME); + if(!gf_buddy || !gfire_buddy_is_online(gf_buddy)) + return; + + purple_debug_info("gfire", "request for a file transfer!\n"); + + PurpleXfer *xfer = gfire_purple_new_xfer(p_gc, p_who); + if(!xfer) + return; + + if(p_filename) + purple_xfer_request_accepted(xfer, p_filename); + else + purple_xfer_request(xfer); +} + +static void gfire_purple_rename_group(PurpleConnection *p_gc, const gchar *p_old_name, PurpleGroup *p_group, GList *p_buddies) +{ + // Handle FoF group renamings + if(g_utf8_collate(p_old_name, GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME) == 0) + { + purple_debug_info("gfire", "FoF group has been renamed, restoring the name...\n"); + purple_blist_rename_group(p_group, GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME); + + purple_notify_info(p_gc, _("Friends of friends group name restored"), _("Group name restored"), _("You have renamed Xfire's FoF group name. Unfortunately we had to restore this groups name.")); + + return; + } + // Handle Clan group renamings + else if(purple_blist_node_get_int(PURPLE_BLIST_NODE(p_group), "clanid") != 0) + { + gfire_clan *clan = gfire_find_clan(p_gc->proto_data, purple_blist_node_get_int(PURPLE_BLIST_NODE(p_group), "clanid")); + if(!clan) + return; + + // Was the name really changed? + if(g_utf8_collate(purple_group_get_name(p_group), gfire_clan_get_name(clan)) == 0) + return; + + purple_debug_info("gfire", "Clan group has been renamed, restoring the name...\n"); + purple_blist_rename_group(p_group, gfire_clan_get_name(clan)); + + purple_notify_info(p_gc, _("Clan's group name restored"), _("Group name restored"), _("You have renamed the group name of a Xfire clan. Unfortunately we had to restore this groups name.")); + return; + } + + // Rename custom groups + gfire_group *group = gfire_find_group(p_gc->proto_data, p_old_name, GFFB_NAME); + if(!group) + return; + + gfire_group_rename(group, purple_group_get_name(p_group)); +} + +static void gfire_purple_remove_group(PurpleConnection *p_gc, PurpleGroup *p_group) +{ + if(!p_gc || !p_group) + return; + + gfire_group *group = gfire_find_group(p_gc->proto_data, p_group, GFFG_PURPLE); + if(group) + { + gfire_remove_group(p_gc->proto_data, group, TRUE); + } +} + +static void gfire_purple_group_buddy(PurpleConnection *p_gc, const char *p_who, + const char *p_old_group, const char *p_new_group) +{ + if(!p_gc || !p_who || !p_new_group) + return; + + gfire_data *gfire = p_gc->proto_data; + + gfire_buddy *buddy = gfire_find_buddy(gfire, p_who, GFFB_NAME); + if(!buddy) + return; + + if(!gfire_buddy_is_friend(buddy)) + { + // TODO: Ask if the user wants to add this buddy + return; + } + + if(p_old_group) + { + gfire_group *old_group = gfire_find_group(gfire, p_old_group, GFFG_NAME); + if(old_group) + { + gfire_group_remove_buddy(old_group, buddy->userid); + } + } + + if(strcmp(p_new_group, GFIRE_DEFAULT_GROUP_NAME) && + strcmp(p_new_group, GFIRE_FRIENDS_OF_FRIENDS_GROUP_NAME)) + { + gfire_group *new_group = gfire_find_group(gfire, p_new_group, GFFG_NAME); + if(!new_group) + { + new_group = gfire_group_create(gfire, p_new_group, 0); + gfire_add_group(gfire, new_group); + } + + gfire_group_add_buddy(new_group, buddy->userid, TRUE); + } +} + +static gboolean gfire_purple_offline_message(const PurpleBuddy *p_buddy) +{ + return FALSE; +} + +/** + * + * Plugin initialization section + * +*/ + +static gboolean _load_plugin(PurplePlugin *p_plugin) +{ + gfire_chat_register_commands(); + return TRUE; +} + +static gboolean _unload_plugin(PurplePlugin *p_plugin) +{ + gfire_chat_unregister_commands(); + +#ifdef USE_NOTIFICATIONS + gfire_notify_uninit(); +#endif // USE_NOTIFICATION + + // Delete all game data + gfire_game_config_cleanup(); + gfire_game_cleanup(); + + purple_signals_disconnect_by_handle(p_plugin); + return TRUE; +} + +static PurplePluginProtocolInfo prpl_info = +{ + OPT_PROTO_CHAT_TOPIC, /* Protocol options */ + NULL, /* user_splits */ + NULL, /* protocol_options */ + NO_BUDDY_ICONS, /* icon_spec */ + gfire_purple_blist_icon, /* list_icon */ + gfire_purple_blist_emblems, /* list_emblems */ + gfire_purple_status_text, /* status_text */ + gfire_purple_blist_tooltip_text, /* tooltip_text */ + gfire_purple_status_types, /* away_states */ + gfire_purple_node_menu, /* blist_node_menu */ + gfire_purple_chat_info, /* chat_info */ + gfire_purple_chat_info_defaults, /* chat_info_defaults */ + gfire_purple_login, /* login */ + gfire_purple_close, /* close */ + gfire_purple_im_send, /* send_im */ + NULL, /* set_info */ + gfire_purple_send_typing, /* send_typing */ + gfire_purple_get_info, /* get_info */ + gfire_purple_set_status, /* set_status */ + NULL, /* set_idle */ + NULL, /* change_passwd */ + gfire_purple_add_buddy, /* add_buddy */ + NULL, /* add_buddies */ + gfire_purple_remove_buddy, /* remove_buddy */ + NULL, /* remove_buddies */ + NULL, /* add_permit */ + NULL, /* add_deny */ + NULL, /* rem_permit */ + NULL, /* rem_deny */ + NULL, /* set_permit_deny */ + gfire_purple_join_chat, /* join_chat */ + gfire_purple_reject_chat, /* reject chat invite */ + gfire_purple_get_chat_name, /* get_chat_name */ + gfire_purple_chat_invite, /* chat_invite */ + gfire_purple_chat_leave, /* chat_leave */ + NULL, /* chat_whisper */ + gfire_purple_chat_send, /* chat_send */ + gfire_purple_keep_alive, /* keepalive */ + NULL, /* register_user */ + NULL, /* get_cb_info */ + NULL, /* get_cb_away */ + NULL, /* alias_buddy */ + gfire_purple_group_buddy, /* group_buddy */ + gfire_purple_rename_group, /* rename_group */ + NULL, /* buddy_free */ + NULL, /* convo_closed */ + purple_normalize_nocase, /* normalize */ + NULL, /* set_buddy_icon */ + gfire_purple_remove_group, /* remove_group */ + NULL, /* get_cb_real_name */ + gfire_purple_chat_change_motd, /* set_chat_topic */ + NULL, /* find_blist_chat */ + NULL, /* roomlist_get_list */ + NULL, /* roomlist_cancel */ + NULL, /* roomlist_expand_category */ + gfire_purple_can_receive_file, /* can_receive_file */ + gfire_purple_send_file, /* send_file */ + gfire_purple_new_xfer, /* new_xfer */ + gfire_purple_offline_message, /* offline_message */ + NULL, /* whiteboard_prpl_ops */ + NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ + NULL, /* unregister_user */ + NULL, /* send_attention */ + NULL, /* attention_types */ + + /* padding */ + sizeof(PurplePluginProtocolInfo), + NULL +}; + + +static PurplePluginInfo info = +{ + PURPLE_PLUGIN_MAGIC, + PURPLE_MAJOR_VERSION, + PURPLE_MINOR_VERSION, + PURPLE_PLUGIN_PROTOCOL, /* type */ + NULL, /* ui_requirement */ + 0, /* flags */ + NULL, /* dependencies */ + PURPLE_PRIORITY_DEFAULT, /* priority */ + GFIRE_PRPL_ID, /* id */ + NULL, /* name (done for NLS in _init_plugin) */ + GFIRE_VERSION_STRING, /* version */ + NULL, /* summary (done for NLS in _init_plugin) */ + NULL, /* description (done for NLS in _init_plugin) */ + NULL, /* author */ + GFIRE_WEBSITE, /* homepage */ + _load_plugin, /* load */ + _unload_plugin, /* unload */ + NULL, /* destroy */ + NULL, /* ui_info */ + &prpl_info, /* extra_info */ + NULL, /* prefs_info */ + gfire_purple_actions, + + /* padding */ + NULL, + NULL, + NULL, + NULL +}; + +static void _init_plugin(PurplePlugin *p_plugin) +{ +#ifdef ENABLE_NLS + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); +#endif // ENABLE_NLS + + PurpleAccountOption *option; + + option = purple_account_option_string_new(_("Server"), "server",XFIRE_SERVER); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); + + option = purple_account_option_int_new(_("Port"), "port", XFIRE_PORT); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); + + option = purple_account_option_int_new(_("Version"), "version", XFIRE_PROTO_VERSION); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); + + option = purple_account_option_bool_new(_("Buddies can see if I'm typing"), "typenorm", TRUE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); + +#ifdef USE_GAME_DETECTION + option = purple_account_option_bool_new(_("Auto detect for ingame status"), "ingamedetectionnorm", TRUE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); + + option = purple_account_option_bool_new(_("Change my status for other protocols as well"), "use_global_status", TRUE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + + option = purple_account_option_bool_new(_("Notify me when my status is ingame"), "ingamenotificationnorm", FALSE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); + + option = purple_account_option_bool_new(_("Enable server detection"), "server_detection_option", FALSE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); +#endif // USE_GAME_DETECTION + + option = purple_account_option_bool_new(_("Use Xfires P2P features"), "p2p_option", TRUE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + +#ifdef USE_NOTIFICATIONS + option = purple_account_option_bool_new(_("Display notifications for certain events"), "use_notify", TRUE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); +#endif // USE_NOTIFICATIONS + + option = purple_account_option_bool_new(_("Show Friends of Friends"), "show_fofs", TRUE); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + + info.name = _("Xfire"); + info.summary = _("Xfire Protocol Plugin"); + info.description = _("Xfire Protocol Plugin"); + + _gfire_plugin = p_plugin; +} + +PURPLE_INIT_PLUGIN(gfire, _init_plugin, info) diff -Nru gfire-0.8.3/src/gf_purple.h gfire-0.9.4/src/gf_purple.h --- gfire-0.8.3/src/gf_purple.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_purple.h 2011-03-14 20:21:37.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_PURPLE_H +#define _GF_PURPLE_H + +#include "gf_base.h" + +void gfire_purple_nick_change_cb(PurpleConnection *p_gc, const gchar *p_entry); + +#endif // _GF_PURPLE_H diff -Nru gfire-0.8.3/src/gf_server_browser.c gfire-0.9.4/src/gf_server_browser.c --- gfire-0.8.3/src/gf_server_browser.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_browser.c 2011-03-14 20:21:32.000000000 +0000 @@ -0,0 +1,869 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_browser.h" +#include "gf_server_browser_proto.h" +#include "gf_games.h" +#include "gfire.h" + +// Prototypes +static void gfire_server_browser_close(gfire_server_browser *p_browser, GtkWidget *p_sender); + +// Creation & freeing +gfire_server_browser *gfire_server_browser_create(PurpleConnection *p_gc) +{ + if(!p_gc) + return NULL; + + gfire_server_browser *ret = (gfire_server_browser*)g_malloc0(sizeof(gfire_server_browser)); + + ret->gc = p_gc; + g_datalist_init(&ret->favourites); + g_datalist_init(&ret->recent); + + return ret; +} + +void gfire_server_browser_free(gfire_server_browser *p_browser) +{ + if(!p_browser) + return; + + gfire_server_browser_close(p_browser, NULL); + + g_datalist_clear(&p_browser->recent); + g_datalist_clear(&p_browser->favourites); + + g_free(p_browser); +} + +// GUI functions (displayal) +static void gfire_server_browser_add_parent_rows(gfire_server_browser *p_browser) +{ + // Add main (parent) rows + gchar *label = g_strdup_printf(_("Recent servers (%u)"), 0); + gtk_tree_store_append(p_browser->tree_store, &(p_browser->recent_iter), NULL); + gtk_tree_store_set(p_browser->tree_store, &(p_browser->recent_iter), 0, label, 4, NULL, -1); + g_free(label); + + label = g_strdup_printf(_("Favourite servers (%u)"), 0); + gtk_tree_store_append(p_browser->tree_store, &(p_browser->fav_iter), NULL); + gtk_tree_store_set(p_browser->tree_store, &(p_browser->fav_iter), 0, label, 4, NULL, -1); + g_free(label); + + label = g_strdup_printf(_("Friends' favourite servers (%u)"), 0); + gtk_tree_store_append(p_browser->tree_store, &(p_browser->ffav_iter), NULL); + gtk_tree_store_set(p_browser->tree_store, &(p_browser->ffav_iter), 0, label, 4, NULL, -1); + g_free(label); + + label = g_strdup_printf(_("All servers (%u)"), 0); + gtk_tree_store_append(p_browser->tree_store, &(p_browser->serverlist_iter), NULL); + gtk_tree_store_set(p_browser->tree_store, &(p_browser->serverlist_iter), 0, label, 4, NULL, -1); + g_free(label); +} + +static gboolean gfire_server_browser_free_cached_server(GtkTreeModel *p_model, GtkTreePath *p_path, + GtkTreeIter *p_iter, gpointer p_data) +{ + gfire_game_server *server = NULL; + gtk_tree_model_get(p_model, p_iter, 4, &server, -1); + + if(server) + gfire_game_server_free(server); + + return TRUE; +} + +static void gfire_server_browser_clear(gfire_server_browser *p_browser) +{ + gtk_tree_model_foreach(GTK_TREE_MODEL(p_browser->tree_store), gfire_server_browser_free_cached_server, p_browser); + gtk_tree_store_clear(p_browser->tree_store); +} + +static void gfire_server_browser_free_server_list(gpointer p_data) +{ + GSList *servers = (GSList*)p_data; + while(servers) + { + gfire_game_server_free((gfire_game_server*)servers->data); + servers = g_slist_delete_link(servers, servers); + } +} + +void gfire_server_browser_add_recent(gfire_server_browser *p_browser, guint32 p_gameid, guint32 p_ip, guint16 p_port) +{ + if(!p_browser) + return; + + // Check whether we already got that server + GSList *servers = (GSList*)g_datalist_id_get_data(&p_browser->recent, p_gameid); + GSList *cur = servers; + while(cur) + { + gfire_game_server *server = (gfire_game_server*)cur->data; + if(server->ip == p_ip && server->port == p_port) + return; + cur = g_slist_next(cur); + } + + // No, so add it + gfire_game_server *server = g_malloc0(sizeof(gfire_game_server)); + server->ip = p_ip; + server->port = p_port; + + g_datalist_id_remove_no_notify(&p_browser->recent, p_gameid); + g_datalist_id_set_data_full(&p_browser->recent, p_gameid, g_slist_append(servers, server), + gfire_server_browser_free_server_list); + + if(p_browser->query && p_browser->query_game == p_gameid) + gfire_server_query_add_server(p_browser->query, p_ip, p_port, GUINT_TO_POINTER(GFSBT_RECENT)); +} + +gboolean gfire_server_browser_add_favourite(gfire_server_browser *p_browser, guint32 p_gameid, + guint32 p_ip, guint16 p_port, gboolean p_remote) +{ + if(!p_browser || p_browser->num_fav >= p_browser->max_fav) + return FALSE; + + // Check whether we already got that server + GSList *servers = (GSList*)g_datalist_id_get_data(&p_browser->favourites, p_gameid); + GSList *cur = servers; + while(cur) + { + gfire_game_server *server = (gfire_game_server*)cur->data; + if(server->ip == p_ip && server->port == p_port) + return FALSE; + cur = g_slist_next(cur); + } + + // No, so add it + gfire_game_server *server = g_malloc0(sizeof(gfire_game_server)); + server->ip = p_ip; + server->port = p_port; + + g_datalist_id_remove_no_notify(&p_browser->favourites, p_gameid); + g_datalist_id_set_data_full(&p_browser->favourites, p_gameid, g_slist_append(servers, server), + gfire_server_browser_free_server_list); + + p_browser->num_fav++; + + if(p_remote) + { + guint16 len = gfire_server_browser_proto_create_add_fav_server(p_gameid, p_ip, p_port); + if(len > 0) gfire_send(p_browser->gc, len); + } + + return TRUE; +} + +void gfire_server_browser_remove_favourite(gfire_server_browser *p_browser, guint32 p_gameid, + guint32 p_ip, guint16 p_port) +{ + if(!p_browser) + return; + + GSList *servers = (GSList*)g_datalist_id_get_data(&p_browser->favourites, p_gameid); + GSList *cur = servers; + while(cur) + { + gfire_game_server *server = (gfire_game_server*)cur->data; + if(server->ip == p_ip && server->port == p_port) + { + gfire_game_server_free(server); + g_datalist_id_remove_no_notify(&p_browser->favourites, p_gameid); + g_datalist_id_set_data_full(&p_browser->favourites, p_gameid, g_slist_delete_link(servers, cur), + gfire_server_browser_free_server_list); + + p_browser->num_fav--; + + guint16 len = gfire_server_browser_proto_create_remove_fav_server(p_gameid, p_ip, p_port); + if(len > 0) gfire_send(p_browser->gc, len); + return; + } + cur = g_slist_next(cur); + } +} + +void gfire_server_browser_max_favs(gfire_server_browser *p_browser, guint p_max) +{ + if(p_browser) p_browser->max_fav = p_max; +} + +void gfire_server_browser_add_server(gfire_server_browser *p_browser, gfire_server_browser_type p_type, + guint32 p_ip, guint16 p_port) +{ + if(!p_browser || !p_browser->query) + return; + + gfire_server_query_add_server(p_browser->query, p_ip, p_port, GUINT_TO_POINTER(p_type)); +} + +static void gfire_server_browser_show_details_cb(gfire_server_browser *p_browser, GtkWidget *p_sender) +{ + // Get selected server + GtkTreeSelection *selection = gtk_tree_view_get_selection( + GTK_TREE_VIEW(gtk_builder_get_object(p_browser->builder, "servers_tree_view"))); + GtkTreeModel *model; + GtkTreeIter iter; + + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gfire_game_server *server; + gtk_tree_model_get(model, &iter, 4, &server, -1); + + if(server) + { + gchar *content = gfire_game_server_details(server); + if(!content) + content = g_strdup(_("No detailed information available!")); + + gchar *title = g_strdup_printf(_("Server Details for %u.%u.%u.%u:%u"), + (server->ip & 0xff000000) >> 24, + (server->ip & 0xff0000) >> 16, + (server->ip & 0xff00) >> 8, + server->ip & 0xff, server->port); + purple_notify_formatted(p_browser->gc, _("Server Details"), title, NULL, content, NULL, NULL); + g_free(content); + g_free(title); + } + } +} + +static void gfire_server_browser_add_fav_server_cb(gfire_server_browser *p_browser, GtkWidget *p_sender) +{ + if(p_browser->num_fav >= p_browser->max_fav) + { + purple_notify_error(NULL, _("Server Browser: Error"), _("Can't add favourite server"), + _("You've reached the limit of favourite servers, you can however still remove favourite servers in order to add new ones.")); + + return; + } + + GtkComboBox *game_combo = GTK_COMBO_BOX(gtk_builder_get_object(p_browser->builder, "game_combo")); + GtkDialog *add_favorite_dialog = GTK_DIALOG(gtk_builder_get_object(p_browser->builder, "add_favorite_dialog")); + GtkEntry *ip_address_entry = GTK_ENTRY(gtk_builder_get_object(p_browser->builder, "ip_address_entry")); + GtkEntry *port_entry = GTK_ENTRY(gtk_builder_get_object(p_browser->builder, "port_entry")); + + // Get the currently selected game id + GtkTreeIter iter; + gtk_combo_box_get_active_iter(game_combo, &iter); + guint32 game_id; + gtk_tree_model_get(gtk_combo_box_get_model(game_combo), &iter, 1, &game_id, -1); + + // Eventually get selected server + GtkTreeSelection *selection = gtk_tree_view_get_selection( + GTK_TREE_VIEW(gtk_builder_get_object(p_browser->builder, "servers_tree_view"))); + GtkTreeModel *model; + + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gfire_game_server *server; + gtk_tree_model_get(model, &iter, 4, &server, -1); + + if(server) + { + gchar *ip_str = g_strdup_printf("%u.%u.%u.%u", + (server->ip & 0xff000000) >> 24, + (server->ip & 0xff0000) >> 16, + (server->ip & 0xff00) >> 8, + server->ip & 0xff); + gchar *port_str = g_strdup_printf("%u", server->port); + + gtk_entry_set_text(ip_address_entry, ip_str); + gtk_entry_set_text(port_entry, port_str); + + g_free(ip_str); + g_free(port_str); + } + } + + while(TRUE) + { + if(gtk_dialog_run(add_favorite_dialog) == 0) + { + const gchar *ip_str = gtk_entry_get_text(ip_address_entry); + const gchar *port_str = gtk_entry_get_text(port_entry); + + // Check given IP + guint16 ip1, ip2, ip3, ip4; + + if(sscanf(ip_str, "%3hu.%3hu.%3hu.%3hu", &ip1, &ip2, &ip3, &ip4) == 4) + { + // Check every IP part + if((ip1 < 256) && (ip2 < 256) && (ip3 < 256) && (ip4 < 256)) + { + // Check port + guint16 port; + + if(sscanf(port_str, "%hu", &port) == 1 && port > 0) + { + guint32 ip = (ip1 << 24) | (ip2 << 16) | (ip3 << 8) | ip4; + + // Add fav server to user Xfire's profile + if(!gfire_server_browser_add_favourite(p_browser, game_id, ip, port, TRUE)) + { + purple_notify_error(NULL, _("Server Browser: Error"), _("Can't add favourite server"), + _("This server is already one of your favourites!")); + continue; + } + + // Display the server if we are currently querying this game + if(p_browser->query && p_browser->query_game == game_id) + gfire_server_query_add_server(p_browser->query, ip, port, GUINT_TO_POINTER(GFSBT_FAVOURITE)); + + break; + } + else + purple_notify_error(NULL, _("Server Browser: Error"), _("Can't add favourite server"), + _("The port you've entered is invalid!")); + } + else + purple_notify_error(NULL, _("Server Browser: Error"), _("Can't add favourite server"), + _("The IP address you've entered is invalid!")); + } + else + purple_notify_error(NULL, _("Server Browser: Error"), _("Can't add favourite server"), + _("The IP address you've entered is invalid!")); + } + else + break; + } + + gtk_widget_hide(GTK_WIDGET(add_favorite_dialog)); +} + +static void gfire_server_browser_remove_fav_server_cb(gfire_server_browser *p_browser, GtkWidget *p_sender) +{ + // Get selected server + GtkTreeSelection *selection = gtk_tree_view_get_selection( + GTK_TREE_VIEW(gtk_builder_get_object(p_browser->builder, "servers_tree_view"))); + GtkTreeModel *model; + GtkTreeIter iter; + + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gfire_game_server *server = NULL; + gtk_tree_model_get(model, &iter, 4, &server, -1); + + // Remove it + if(server) + { + gfire_server_browser_remove_favourite(p_browser, p_browser->query_game, server->ip, server->port); + + gtk_tree_store_remove(GTK_TREE_STORE(model), &iter); + gchar *label = g_strdup_printf(_("Favourite servers (%u)"), + gtk_tree_model_iter_n_children(model, &p_browser->fav_iter)); + gtk_tree_store_set(GTK_TREE_STORE(model), &p_browser->fav_iter, 0, label, -1); + g_free(label); + } + } +} + +static void gfire_server_browser_add_queried_server(gfire_game_server *p_server, gpointer p_server_data, gpointer p_data) +{ + gfire_server_browser *browser = (gfire_server_browser*)p_data; + gfire_server_browser_type type = GPOINTER_TO_UINT(p_server_data); + + if(!p_server->data) + { + // Don't display servers which could not be queried and are no favourites + if(type != GFSBT_FAVOURITE) + { + // Remove recent servers since they don't seem to exist + if(type == GFSBT_RECENT) + { + GSList *servers = (GSList*)g_datalist_id_get_data(&browser->recent, browser->query_game); + GSList *cur = servers; + while(cur) + { + gfire_game_server *server = (gfire_game_server*)cur->data; + if(server->ip == p_server->ip && server->port == p_server->port) + { + gfire_game_server_free(server); + g_datalist_id_remove_no_notify(&browser->recent, browser->query_game); + g_datalist_id_set_data_full(&browser->recent, browser->query_game, + g_slist_delete_link(servers, cur), + gfire_server_browser_free_server_list); + break; + } + cur = g_slist_next(cur); + } + } + gfire_game_server_free(p_server); + return; + } + } + + gchar *label = NULL; + GtkTreeIter iter; + switch(type) + { + case GFSBT_RECENT: + gtk_tree_store_append(browser->tree_store, &iter, &browser->recent_iter); + label = g_strdup_printf(_("Recent servers (%u)"), + gtk_tree_model_iter_n_children(GTK_TREE_MODEL(browser->tree_store), + &browser->recent_iter)); + gtk_tree_store_set(browser->tree_store, &browser->recent_iter, 0, label, -1); + break; + case GFSBT_FAVOURITE: + gtk_tree_store_append(browser->tree_store, &iter, &browser->fav_iter); + label = g_strdup_printf(_("Favourite servers (%u)"), + gtk_tree_model_iter_n_children(GTK_TREE_MODEL(browser->tree_store), + &browser->fav_iter)); + gtk_tree_store_set(browser->tree_store, &browser->fav_iter, 0, label, -1); + break; + case GFSBT_FFAVOURITE: + gtk_tree_store_append(browser->tree_store, &iter, &browser->ffav_iter); + label = g_strdup_printf(_("Friends' favourite servers (%u)"), + gtk_tree_model_iter_n_children(GTK_TREE_MODEL(browser->tree_store), + &browser->ffav_iter)); + gtk_tree_store_set(browser->tree_store, &browser->ffav_iter, 0, label, -1); + break; + case GFSBT_GENERAL: + gtk_tree_store_append(browser->tree_store, &iter, &browser->serverlist_iter); + label = g_strdup_printf(_("All servers (%u)"), + gtk_tree_model_iter_n_children(GTK_TREE_MODEL(browser->tree_store), + &browser->serverlist_iter)); + gtk_tree_store_set(browser->tree_store, &browser->serverlist_iter, 0, label, -1); + break; + } + g_free(label); + + // Format the output + gchar *name = (p_server->data && p_server->data->name) ? g_strdup(p_server->data->name) + : g_strdup_printf("%u.%u.%u.%u:%u", + (p_server->ip & 0xff000000) >> 24, + (p_server->ip & 0xff0000) >> 16, + (p_server->ip & 0xff00) >> 8, + p_server->ip & 0xff, + p_server->port); + gchar *players = p_server->data ? g_strdup_printf("%u/%u", p_server->data->players, p_server->data->max_players) + : g_strdup(_("N/A")); + gchar *ping = p_server->data ? g_strdup_printf("%u", p_server->data->ping) : g_strdup(_("N/A")); + gchar *map = (p_server->data && p_server->data->map) ? g_strdup(p_server->data->map) : g_strdup(_("N/A")); + + gtk_tree_store_set(browser->tree_store, &iter, 0, name, 1, ping, 2, players, 3, map, 4, p_server, -1); + + g_free(name); + g_free(ping); + g_free(players); + g_free(map); +} + +static void gfire_server_browser_request_serverlist_cb(gfire_server_browser *p_browser, GtkWidget *p_sender) +{ + GtkComboBox *game_combo = GTK_COMBO_BOX(gtk_builder_get_object(p_browser->builder, "game_combo")); + + gfire_server_browser_clear(p_browser); + + gfire_server_query_free(p_browser->query); + p_browser->query = NULL; + + // Get the currently selected game id + GtkTreeIter iter; + gtk_combo_box_get_active_iter(game_combo, &iter); + guint32 game_id; + gtk_tree_model_get(gtk_combo_box_get_model(game_combo), &iter, 1, &game_id, -1); + + if(game_id != 0) + { + // Start the querying + p_browser->query_game = game_id; + p_browser->query = gfire_server_query_create(); + if(!gfire_server_query_start(p_browser->query, gfire_game_server_query_type(game_id), TRUE, + gfire_server_browser_add_queried_server, p_browser)) + { + purple_notify_error(p_browser->gc, _("Game Server Type not supported"), + _("Game Server Type not supported"), + _("Sorry, but the server query protocol for this game is not yet supported by Gfire!")); + gfire_server_query_free(p_browser->query); + p_browser->query = NULL; + return; + } + + // Add parent rows (also clears tree store) + gfire_server_browser_add_parent_rows(p_browser); + + // Request recent and favourite servers + GSList *servers = g_datalist_id_get_data(&p_browser->recent, game_id); + while(servers) + { + gfire_game_server *server = (gfire_game_server*)servers->data; + gfire_server_query_add_server(p_browser->query, server->ip, server->port, GUINT_TO_POINTER(GFSBT_RECENT)); + servers = g_slist_next(servers); + } + + servers = g_datalist_id_get_data(&p_browser->favourites, game_id); + while(servers) + { + gfire_game_server *server = (gfire_game_server*)servers->data; + gfire_server_query_add_server(p_browser->query, server->ip, server->port, GUINT_TO_POINTER(GFSBT_FAVOURITE)); + servers = g_slist_next(servers); + } + + // Request serverlist from Xfire + guint16 packet_len = gfire_server_browser_proto_create_serverlist_request(game_id); + if(packet_len > 0) + gfire_send(p_browser->gc, packet_len); + + // Request friends' fav serverlist from Xfire + packet_len = gfire_server_browser_proto_create_friends_fav_serverlist_request(game_id); + if(packet_len > 0) + gfire_send(p_browser->gc, packet_len); + } +} + +static void gfire_server_browser_connect_cb(gfire_server_browser *p_browser, GtkWidget *p_sender) +{ + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtk_builder_get_object(p_browser->builder, "servers_tree_view"))); + GtkTreeModel *model; + GtkTreeIter iter; + + // Get selected server + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gfire_game_server *server = NULL; + gtk_tree_model_get(model, &iter, 4, &server, -1); + + if(!server) + return; + + // Put server in struct + gfire_game_data game; + + game.id = p_browser->query_game; + game.ip.value = server->ip; + game.port = server->port; + + // Finally join server + gfire_join_game(&game); + } + else + purple_debug_error("gfire", "Server Browser: Couldn't get selected server to join.\n"); +} + +static void gfire_server_browser_close(gfire_server_browser *p_browser, GtkWidget *p_sender) +{ + if(p_browser->query) + { + gfire_server_query_free(p_browser->query); + p_browser->query = NULL; + } + + if(p_browser->builder) + { + // Free all cached servers + gfire_server_browser_clear(p_browser); + + // Destroy window + GtkWidget *server_browser_window = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "server_browser_window")); + gtk_widget_destroy(server_browser_window); + + // Free builder + g_object_unref(G_OBJECT(p_browser->builder)); + p_browser->builder = NULL; + } +} + +static void gfire_server_browser_game_changed_cb(GtkComboBox *p_cbox, gpointer p_data) +{ + gfire_server_browser *browser = (gfire_server_browser*)p_data; + + GtkWidget *refresh_button = GTK_WIDGET(gtk_builder_get_object(browser->builder, "refresh_button")); + GtkWidget *addfav_button = GTK_WIDGET(gtk_builder_get_object(browser->builder, "add_favorite_button")); + gtk_widget_set_sensitive(refresh_button, gtk_combo_box_get_active(p_cbox) >= 0); + gtk_widget_set_sensitive(addfav_button, gtk_combo_box_get_active(p_cbox) >= 0); + + if(gtk_combo_box_get_active(p_cbox) >= 0) + gfire_server_browser_request_serverlist_cb(browser, NULL); +} + +static void gfire_server_browser_selection_changed_cb(GtkTreeSelection *p_selection, gpointer p_data) +{ + GtkTreeIter iter; + GtkTreeModel *model; + gfire_server_browser *browser = (gfire_server_browser*)p_data; + + GtkWidget *details_button = GTK_WIDGET(gtk_builder_get_object(browser->builder, "details_button")); + GtkWidget *connect_button = GTK_WIDGET(gtk_builder_get_object(browser->builder, "connect_button")); + GtkWidget *remfav_button = GTK_WIDGET(gtk_builder_get_object(browser->builder, "remove_favorite_button")); + + if(gtk_tree_selection_get_selected(p_selection, &model, &iter)) + { + gfire_game_server *server = NULL; + gtk_tree_model_get(model, &iter, 4, &server, -1); + if(server) + { + GtkTreePath *path = gtk_tree_model_get_path(model, &iter); + GtkTreePath *path_fav = gtk_tree_model_get_path(model, &browser->fav_iter); + + gtk_widget_set_sensitive(details_button, TRUE); + gtk_widget_set_sensitive(connect_button, TRUE); + + if(gtk_tree_path_is_ancestor(path_fav, path)) + gtk_widget_set_sensitive(remfav_button, TRUE); + else + gtk_widget_set_sensitive(remfav_button, FALSE); + + gtk_tree_path_free(path); + gtk_tree_path_free(path_fav); + return; + } + } + + // By default: turn everything off + gtk_widget_set_sensitive(details_button, FALSE); + gtk_widget_set_sensitive(connect_button, FALSE); + gtk_widget_set_sensitive(remfav_button, FALSE); +} + +static gint gfire_server_browser_sort_name_column(GtkTreeModel *p_model, GtkTreeIter *p_a, GtkTreeIter *p_b, + gpointer p_data) +{ + gfire_game_server *server_a = NULL, *server_b = NULL; + gtk_tree_model_get(p_model, p_a, 4, &server_a, -1); + gtk_tree_model_get(p_model, p_b, 4, &server_b, -1); + + // Keep the sorting of the root elements constant + if(!server_a || !server_b) + { + if(!server_a && !server_b) + return 0; + else + return server_a ? -1 : 1; + } + + // Sort the servers by name, but IP only servers last + if(!server_a->data || !server_a->data->name || !server_b->data || !server_b->data->name) + { + if((!server_a->data || !server_a->data->name) && (!server_b->data || !server_b->data->name)) + return 0; + else + return (server_a->data && server_a->data->name) ? -1 : 1; + } + + return g_utf8_collate(server_a->data->name, server_b->data->name); +} + +static gint gfire_server_browser_sort_ping_column(GtkTreeModel *p_model, GtkTreeIter *p_a, GtkTreeIter *p_b, + gpointer p_data) +{ + gfire_game_server *server_a = NULL, *server_b = NULL; + gtk_tree_model_get(p_model, p_a, 4, &server_a, -1); + gtk_tree_model_get(p_model, p_b, 4, &server_b, -1); + + // Keep the sorting of the root elements constant + if(!server_a || !server_a->data || !server_b || !server_b->data) + { + if((!server_a || !server_a->data) && (!server_b || !server_b->data)) + return 0; + else + return (server_a && server_a->data) ? -1 : 1; + } + + // Sort the servers by ping + if(server_a->data->ping > server_b->data->ping) + return -1; + else if(server_a->data->ping < server_b->data->ping) + return 1; + else + return 0; +} + +static gint gfire_server_browser_sort_player_column(GtkTreeModel *p_model, GtkTreeIter *p_a, GtkTreeIter *p_b, + gpointer p_data) +{ + gfire_game_server *server_a = NULL, *server_b = NULL; + gtk_tree_model_get(p_model, p_a, 4, &server_a, -1); + gtk_tree_model_get(p_model, p_b, 4, &server_b, -1); + + // Keep the sorting of the root elements constant + if(!server_a || !server_a->data || !server_b || !server_b->data) + { + if((!server_a || !server_a->data) && (!server_b || !server_b->data)) + return 0; + else + return (server_a && server_a->data) ? -1 : 1; + } + + // Sort the servers by players + if(server_a->data->players > server_b->data->players) + return -1; + else if(server_a->data->players < server_b->data->players) + return 1; + else + return 0; +} + +static gint gfire_server_browser_sort_map_column(GtkTreeModel *p_model, GtkTreeIter *p_a, GtkTreeIter *p_b, + gpointer p_data) +{ + gfire_game_server *server_a = NULL, *server_b = NULL; + gtk_tree_model_get(p_model, p_a, 4, &server_a, -1); + gtk_tree_model_get(p_model, p_b, 4, &server_b, -1); + + // Keep the sorting of the root elements constant + if(!server_a || !server_b) + { + if(!server_a && !server_b) + return 0; + else + return server_a ? -1 : 1; + } + + // Sort the servers by mapname + if(!server_a->data || !server_a->data->map || !server_b->data || !server_b->data->map) + { + if((!server_a->data || !server_a->data->map) && (!server_b->data || !server_b->data->map)) + return 0; + else + return (server_a->data && server_a->data->map) ? -1 : 1; + } + + return g_utf8_collate(server_a->data->map, server_b->data->map); +} + +static gboolean gfire_server_browser_add_configured_games_cb(const gfire_game_configuration *p_gconf, + GtkComboBox *p_game_combo) +{ + // Check if the game has a protocol defined + const gchar *protocol = gfire_game_server_query_type(p_gconf->game_id); + if(protocol) + { + const gfire_game *game = gfire_game_by_id(p_gconf->game_id); + if(game) + { + GtkListStore *store = GTK_LIST_STORE(gtk_combo_box_get_model(p_game_combo)); + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, game->name, 1, game->id, -1); + } + } + + return FALSE; +} + +void gfire_server_browser_show(gfire_server_browser *p_browser) +{ + if(!p_browser || p_browser->builder) + return; + + if(!(p_browser->builder = gtk_builder_new())) + { + purple_debug_error("gfire", "Couldn't build server browser interface.\n"); + return; + } + + gtk_builder_set_translation_domain(p_browser->builder, GETTEXT_PACKAGE); + + gchar *builder_file = g_build_filename(DATADIR, "purple", "gfire", "servers.glade", NULL); + gtk_builder_add_from_file(p_browser->builder, builder_file, NULL); + g_free(builder_file); + + GtkWidget *server_browser_window = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "server_browser_window")); + GtkWidget *tree_view = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "servers_tree_view")); + GtkWidget *refresh_button = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "refresh_button")); + GtkWidget *details_button = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "details_button")); + GtkWidget *connect_button = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "connect_button")); + GtkWidget *add_fav_button = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "add_favorite_button")); + GtkWidget *remove_fav_button = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "remove_favorite_button")); + GtkWidget *quit_button = GTK_WIDGET(gtk_builder_get_object(p_browser->builder, "quit_button")); + GtkComboBox *game_combo = GTK_COMBO_BOX(gtk_builder_get_object(p_browser->builder, "game_combo")); + + // Connect signals + g_signal_connect_swapped(server_browser_window, "destroy", G_CALLBACK(gfire_server_browser_close), p_browser); + g_signal_connect_swapped(quit_button, "clicked", G_CALLBACK(gfire_server_browser_close), p_browser); + + g_signal_connect_swapped(refresh_button, "clicked", G_CALLBACK(gfire_server_browser_request_serverlist_cb), p_browser); + g_signal_connect_swapped(details_button, "clicked", G_CALLBACK(gfire_server_browser_show_details_cb), p_browser); + g_signal_connect_swapped(connect_button, "clicked", G_CALLBACK(gfire_server_browser_connect_cb), p_browser); + g_signal_connect_swapped(add_fav_button, "clicked", G_CALLBACK(gfire_server_browser_add_fav_server_cb), p_browser); + g_signal_connect_swapped(remove_fav_button, "clicked", G_CALLBACK(gfire_server_browser_remove_fav_server_cb), p_browser); + + // Connect too when user double clicks on a server + g_signal_connect_swapped(tree_view, "row-activated", G_CALLBACK(gfire_server_browser_connect_cb), p_browser); + + // Add configured games + gfire_game_config_foreach(G_CALLBACK(gfire_server_browser_add_configured_games_cb), game_combo); + g_signal_connect(game_combo, "changed", G_CALLBACK(gfire_server_browser_game_changed_cb), p_browser); + + // Initialize the tree view + p_browser->tree_store = GTK_TREE_STORE(gtk_builder_get_object(p_browser->builder, "servers_list_tree_store")); + gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(p_browser->tree_store), 0, gfire_server_browser_sort_name_column, NULL, NULL); + gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(p_browser->tree_store), 1, gfire_server_browser_sort_ping_column, NULL, NULL); + gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(p_browser->tree_store), 2, gfire_server_browser_sort_player_column, NULL, NULL); + gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(p_browser->tree_store), 3, gfire_server_browser_sort_map_column, NULL, NULL); + + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtk_builder_get_object(p_browser->builder, "servers_tree_view"))); + g_signal_connect(selection, "changed", G_CALLBACK(gfire_server_browser_selection_changed_cb), p_browser); + + // Show window + gtk_widget_show_all(server_browser_window); +} + +static gboolean gfire_server_browser_delete_query(gpointer p_data) +{ + gfire_server_query_free((gfire_server_query*)p_data); + return FALSE; +} + +static void gfire_server_browser_single_queried(gfire_game_server *p_server, gpointer p_server_data, gpointer p_data) +{ + if(p_server->data) + { + gchar *content = gfire_game_server_details(p_server); + if(!content) + content = g_strdup(_("No detailed information available!")); + + gchar *title = g_strdup_printf(_("Server Details for %u.%u.%u.%u:%u"), + (p_server->ip & 0xff000000) >> 24, + (p_server->ip & 0xff0000) >> 16, + (p_server->ip & 0xff00) >> 8, + p_server->ip & 0xff, p_server->port); + purple_notify_formatted(NULL, _("Server Details"), title, NULL, content, NULL, NULL); + g_free(content); + g_free(title); + } + else + purple_notify_error(NULL, _("Server Query: Error"), _("Could not query the server"), + _("Unfortunately Gfire wasn't able to query the server. Maybe another try shows a better result...")); + + // Deferred delete of the query manager + g_idle_add(gfire_server_browser_delete_query, p_data); +} + +gboolean gfire_server_browser_show_single(guint32 p_gameid, guint32 p_ip, guint16 p_port) +{ + if(!p_gameid || !p_ip) + return FALSE; + + gfire_server_query *query = gfire_server_query_create(); + if(!gfire_server_query_start(query, gfire_game_server_query_type(p_gameid), TRUE, + gfire_server_browser_single_queried, query)) + { + gfire_server_query_free(query); + return FALSE; + } + + gfire_server_query_add_server(query, p_ip, p_port, NULL); + + return TRUE; +} diff -Nru gfire-0.8.3/src/gf_server_browser.h gfire-0.9.4/src/gf_server_browser.h --- gfire-0.8.3/src/gf_server_browser.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_browser.h 2011-03-14 20:21:28.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_SERVER_BROWSER_H +#define _GF_SERVER_BROWSER_H + +typedef struct _gfire_server_browser gfire_server_browser; + +#include "gf_base.h" +#include "gf_server_query.h" + +typedef enum _gfire_server_browser_type { + GFSBT_RECENT = 0, + GFSBT_FAVOURITE = 1, + GFSBT_FFAVOURITE = 2, + GFSBT_GENERAL = 3 +} gfire_server_browser_type; + +struct _gfire_server_browser +{ + PurpleConnection *gc; + + // Favourite servers + guint max_fav; + guint num_fav; + GData *favourites; + + // Recently visited servers + GData *recent; + + // Query + gfire_server_query *query; + guint32 query_game; + + // GUI + GtkBuilder *builder; + GtkTreeStore *tree_store; + + GtkTreeIter recent_iter; + GtkTreeIter fav_iter; + GtkTreeIter ffav_iter; + GtkTreeIter serverlist_iter; +}; + +// Creation & freeing +gfire_server_browser *gfire_server_browser_create(PurpleConnection *p_gc); +void gfire_server_browser_free(gfire_server_browser *p_browser); + +// Recently visited servers +void gfire_server_browser_add_recent(gfire_server_browser *p_browser, guint32 p_gameid, guint32 p_ip, + guint16 p_port); + +// Favourite servers +gboolean gfire_server_browser_add_favourite(gfire_server_browser *p_browser, guint32 p_gameid, guint32 p_ip, + guint16 p_port, gboolean p_remote); +void gfire_server_browser_remove_favourite(gfire_server_browser *p_browser, guint32 p_gameid, guint32 p_ip, + guint16 p_port); + +// Internal +void gfire_server_browser_max_favs(gfire_server_browser *p_browser, guint p_max); +void gfire_server_browser_add_server(gfire_server_browser *p_browser, gfire_server_browser_type p_type, + guint32 p_ip, guint16 p_port); + +// GUI functions (displayal) +void gfire_server_browser_show(gfire_server_browser *p_browser); +gboolean gfire_server_browser_show_single(guint32 p_gameid, guint32 p_ip, guint16 p_port); + +#endif // _GF_SERVER_BROWSER_H diff -Nru gfire-0.8.3/src/gf_server_browser_proto.c gfire-0.9.4/src/gf_server_browser_proto.c --- gfire-0.8.3/src/gf_server_browser_proto.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_browser_proto.c 2011-03-14 20:21:22.000000000 +0000 @@ -0,0 +1,284 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_browser_proto.h" +#include "gf_server_browser.h" + +// Serverlist requests +guint16 gfire_server_browser_proto_create_friends_fav_serverlist_request(guint32 p_gameid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + p_gameid = GUINT32_TO_LE(p_gameid); + offset = gfire_proto_write_attr_ss("gameid", 0x02, &p_gameid, sizeof(p_gameid), offset); + + gfire_proto_write_header(offset, 0x15, 1, 0); + return offset; +} + +guint16 gfire_server_browser_proto_create_serverlist_request(guint32 p_gameid) +{ + guint32 offset = XFIRE_HEADER_LEN; + + p_gameid = GUINT32_TO_LE(p_gameid); + offset = gfire_proto_write_attr_bs(0x21, 0x02, &p_gameid, sizeof(p_gameid), offset); + + gfire_proto_write_header(offset, 0x16, 1, 0); + return offset; +} + +// Remote fav serverlist functions (requests) +guint16 gfire_server_browser_proto_create_add_fav_server(guint32 p_gameid, guint32 p_ip, guint32 p_port) +{ + guint32 offset = XFIRE_HEADER_LEN; + + p_gameid = GUINT32_TO_LE(p_gameid); + offset = gfire_proto_write_attr_ss("gameid", 0x02, &p_gameid, sizeof(p_gameid), offset); + + p_ip = GUINT32_TO_LE(p_ip); + offset = gfire_proto_write_attr_ss("gip", 0x02, &p_ip, sizeof(p_ip), offset); + + p_port = GUINT32_TO_LE(p_port); + offset = gfire_proto_write_attr_ss("gport", 0x02, &p_port, sizeof(p_port), offset); + + gfire_proto_write_header(offset, 0x13, 3, 0); + return offset; +} + +guint16 gfire_server_browser_proto_create_remove_fav_server(guint32 p_gameid, guint32 p_ip, guint32 p_port) +{ + guint32 offset = XFIRE_HEADER_LEN; + + p_gameid = GUINT32_TO_LE(p_gameid); + offset = gfire_proto_write_attr_ss("gameid", 0x02, &p_gameid, sizeof(p_gameid), offset); + + p_ip = GUINT32_TO_LE(p_ip); + offset = gfire_proto_write_attr_ss("gip", 0x02, &p_ip, sizeof(p_ip), offset); + + p_port = GUINT32_TO_LE(p_port); + offset = gfire_proto_write_attr_ss("gport", 0x02, &p_port, sizeof(p_port), offset); + + gfire_proto_write_header(offset, 0x14, 3, 0); + return offset; +} + +void gfire_server_browser_proto_friends_fav_serverlist(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + // FIXME: What's the correct length in bytes? + if(p_packet_len < 16) + { + purple_debug_error("gfire", "Packet 149 received, but too short (%d bytes)\n", p_packet_len); + return; + } + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 gameid; + GList *ips = NULL; + GList *ports = NULL; + GList *userids = NULL; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &gameid, "gameid", offset); + + if(gameid != p_gfire->server_browser->query_game) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &ips, "gip", offset); + if(offset == -1) + { + if(ips) gfire_list_clear(ips); + + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &ports, "gport", offset); + if(offset == -1) + { + if(ips) gfire_list_clear(ips); + if(ports) gfire_list_clear(ports); + + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &userids, "friends", offset); + if(offset == -1) + { + if(ips) gfire_list_clear(ips); + if(ports) gfire_list_clear(ports); + if(userids) gfire_list_clear(userids); + + return; + } + + // FIXME: Not used yet, free... + while(userids) + { + gfire_list_clear(userids->data); + userids = g_list_delete_link(userids, userids); + } + + GList *ip = ips, *port = ports; + for(; ip; ip = g_list_next(ip)) + { + gfire_server_browser_add_server(p_gfire->server_browser, GFSBT_FFAVOURITE, + *((guint32*)ip->data), *((guint16*)port->data)); + + // Free data and go to next server + g_free(ip->data); + g_free(port->data); + + port = g_list_next(port); + } + + g_list_free(ips); + g_list_free(ports); +} + +void gfire_server_browser_proto_fav_serverlist(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + if(p_packet_len < 42) + { + purple_debug_error("gfire", "Packet 148 received, but too short (%d bytes)\n", p_packet_len); + return; + } + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 max_favs; + GList *gameids = NULL; + GList *ips = NULL; + GList *ports = NULL; + + offset = gfire_proto_read_attr_int32_ss(p_gfire->buff_in, &max_favs, "max", offset); + if(offset == -1) + return; + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &gameids, "gameid", offset); + if(offset == -1) + { + if(gameids) gfire_list_clear(gameids); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &ips, "gip", offset); + if(offset == -1) + { + if(gameids) gfire_list_clear(gameids); + if(ips) gfire_list_clear(ips); + return; + } + + offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &ports, "gport", offset); + if(offset == -1) + { + if(gameids) gfire_list_clear(gameids); + if(ips) gfire_list_clear(ips); + if(ports) gfire_list_clear(ports); + return; + } + + // Set max favs + gfire_server_browser_max_favs(p_gfire->server_browser, max_favs); + + // Fill in favorite server list + GList *id = gameids, *ip = ips, *port = ports; + for(; id; id = g_list_next(id)) + { + gfire_server_browser_add_favourite(p_gfire->server_browser, *((guint32*)id->data), + *((guint32*)ip->data), *((guint16*)port->data), FALSE); + + // Free data and go to next server + g_free(id->data); + g_free(ip->data); + g_free(port->data); + + ip = g_list_next(ip); + port = g_list_next(port); + } + + g_list_free(gameids); + g_list_free(ips); + g_list_free(ports); +} + +void gfire_server_browser_proto_serverlist(gfire_data *p_gfire, guint16 p_packet_len) +{ + if(!p_gfire) + return; + + if(p_packet_len < 16) + { + purple_debug_error("gfire", "Packet 150 received, but too short (%d bytes)\n", p_packet_len); + return; + } + + guint32 offset = XFIRE_HEADER_LEN; + + guint32 gameid; + GList *ips = NULL; + GList *ports = NULL; + + offset = gfire_proto_read_attr_int32_bs(p_gfire->buff_in, &gameid, 0x21, offset); + if(offset == -1) + return; + + if(gameid != p_gfire->server_browser->query_game) + return; + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &ips, 0x22, offset); + if(offset == -1) + { + if(ips) gfire_list_clear(ips); + + return; + } + + offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &ports, 0x23, offset); + if(offset == -1) + { + if(ips) gfire_list_clear(ips); + if(ports) gfire_list_clear(ports); + + return; + } + + GList *ip = ips, *port = ports; + for(; ip; ip = g_list_next(ip)) + { + gfire_server_browser_add_server(p_gfire->server_browser, GFSBT_GENERAL, *((guint32*)ip->data), + *((guint16*)port->data)); + + // Free data and go to next server + g_free(ip->data); + g_free(port->data); + + port = g_list_next(port); + } + + g_list_free(ips); + g_list_free(ports); +} diff -Nru gfire-0.8.3/src/gf_server_browser_proto.h gfire-0.9.4/src/gf_server_browser_proto.h --- gfire-0.8.3/src/gf_server_browser_proto.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_browser_proto.h 2011-03-14 20:21:14.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_SERVER_BROWSER_PROTO_H +#define _GF_SERVER_BROWSER_PROTO_H + +#include "gf_base.h" +#include "gf_server_browser.h" + +#ifdef HAVE_GTK +#include "gf_network.h" +#include "gf_protocol.h" +#include "gfire.h" + +// Packet creation +guint16 gfire_server_browser_proto_create_friends_fav_serverlist_request(guint32 p_gameid); +guint16 gfire_server_browser_proto_create_serverlist_request(guint32 p_gameid); +guint16 gfire_server_browser_proto_create_add_fav_server(guint32 p_gameid, guint32 p_ip, guint32 p_port); +guint16 gfire_server_browser_proto_create_remove_fav_server(guint32 p_gameid, guint32 p_ip, guint32 p_port); + +// Packet parsing +void gfire_server_browser_proto_friends_fav_serverlist(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_server_browser_proto_fav_serverlist(gfire_data *p_gfire, guint16 p_packet_len); +void gfire_server_browser_proto_serverlist(gfire_data *p_gfire, guint16 p_packet_len); + +#endif // HAVE_GTK + +#endif // _GF_SERVER_BROWSER_PROTO_H diff -Nru gfire-0.8.3/src/gf_server_detection.c gfire-0.9.4/src/gf_server_detection.c --- gfire-0.8.3/src/gf_server_detection.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_detection.c 2011-03-14 20:21:09.000000000 +0000 @@ -0,0 +1,213 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_detection.h" + +gfire_server_detector *gfire_server_detector_create(GCallback p_server_callback) +{ + if(!p_server_callback) + return NULL; + + gfire_server_detector *ret = g_malloc0(sizeof(gfire_server_detector)); + if(!ret) + return NULL; + + ret->mutex = g_mutex_new(); + ret->server_callback = p_server_callback; + + return ret; +} + +void gfire_server_detector_free(gfire_server_detector *p_detector) +{ + if(!p_detector) + return; + + // Stop the detector first + gfire_server_detector_stop(p_detector); + + g_mutex_free(p_detector->mutex); + + g_free(p_detector); +} + +gboolean gfire_server_detector_running(const gfire_server_detector *p_detector) +{ + if(!p_detector) + return FALSE; + + g_mutex_lock(p_detector->mutex); + gboolean ret = p_detector->running; + g_mutex_unlock(p_detector->mutex); + return ret; +} + +gboolean gfire_server_detector_finished(const gfire_server_detector *p_detector) +{ + if(!p_detector) + return FALSE; + + g_mutex_lock(p_detector->mutex); + gboolean ret = p_detector->finished; + g_mutex_unlock(p_detector->mutex); + return ret; +} + +void gfire_server_detection_remove_invalid_servers(gfire_server_detector *p_detection, const GList *p_local_ips) +{ + // Check detected TCP servers + GList *cur = p_detection->tcp_servers; + while(cur) + { + gboolean deleted = FALSE; + gfire_server *server = (gfire_server*)cur->data; + + // Check against local IPs + const GList *lip = p_local_ips; + while(lip) + { + if(server->ip == *((guint32*)lip->data)) + { + deleted = TRUE; + GList *to_delete = cur; + cur = g_list_next(cur); + + g_free(server); + p_detection->tcp_servers = g_list_delete_link(p_detection->tcp_servers, to_delete); + + break; + } + lip = g_list_next(lip); + } + if(deleted) + continue; + + // Check against invalid ports + GList *port = p_detection->excluded_ports; + while(port) + { + if(server->port == *((guint16*)port->data)) + { + deleted = TRUE; + GList *to_delete = cur; + cur = g_list_next(cur); + + g_free(server); + p_detection->tcp_servers = g_list_delete_link(p_detection->tcp_servers, to_delete); + + break; + } + port = g_list_next(port); + } + if(deleted) + continue; + + cur = g_list_next(cur); + } + + // Check detected UDP servers + cur = p_detection->udp_servers; + while(cur) + { + gboolean deleted = FALSE; + gfire_server *server = (gfire_server*)cur->data; + + // Check against local IPs + const GList *lip = p_local_ips; + while(lip) + { + if(server->ip == *((guint32*)lip->data)) + { + deleted = TRUE; + GList *to_delete = cur; + cur = g_list_next(cur); + + g_free(server); + p_detection->udp_servers = g_list_delete_link(p_detection->udp_servers, to_delete); + + break; + } + lip = g_list_next(lip); + } + if(deleted) + continue; + + // Check against invalid ports + GList *port = p_detection->excluded_ports; + while(port) + { + if(server->port == *((guint16*)port->data)) + { + deleted = TRUE; + GList *to_delete = cur; + cur = g_list_next(cur); + + g_free(server); + p_detection->udp_servers = g_list_delete_link(p_detection->udp_servers, to_delete); + + break; + } + port = g_list_next(port); + } + if(deleted) + continue; + + cur = g_list_next(cur); + } +} + +// Sorts from highest to lowest priority +static gint gfire_server_cmp(const gfire_server *p_server1, const gfire_server *p_server2) +{ + if(p_server1->priority < p_server2->priority) + return 1; + else if(p_server1->priority == p_server2->priority) + return 0; + else + return -1; +} + +const gfire_server *gfire_server_detection_guess_server(gfire_server_detector *p_detection) +{ + // Get best TCP server + gfire_server *tcp = NULL; + if(p_detection->tcp_servers) + { + p_detection->tcp_servers = g_list_sort(p_detection->tcp_servers, (GCompareFunc)gfire_server_cmp); + tcp = p_detection->tcp_servers->data; + } + + // Get best UDP server + gfire_server *udp = NULL; + if(p_detection->udp_servers) + { + p_detection->udp_servers = g_list_sort(p_detection->udp_servers, (GCompareFunc)gfire_server_cmp); + udp = p_detection->udp_servers->data; + } + + if(!tcp) + return udp; + else if(!udp) + return tcp; + else + // Return TCP only if it has better priority than UDP (most servers use UDP anyway) + return (tcp->priority > udp->priority) ? tcp : udp; +} diff -Nru gfire-0.8.3/src/gf_server_detection.h gfire-0.9.4/src/gf_server_detection.h --- gfire-0.8.3/src/gf_server_detection.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_detection.h 2011-03-14 20:21:04.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_SERVER_DETECTION_H +#define _GF_SERVER_DETECTION_H + +#include "gf_base.h" + +typedef struct _gfire_server_detector gfire_server_detector; +typedef struct _gfire_server gfire_server; + +struct _gfire_server_detector +{ + gboolean running; + gboolean finished; + gboolean quit; + + guint32 gameid; + guint32 pid; + + GList *tcp_servers; + GList *local_udp_connections; + GList *udp_servers; + + GList *excluded_ports; + + GCallback server_callback; + + GMutex *mutex; + + void *os_data; +}; + +struct _gfire_server +{ + guint32 ip; + guint16 port; + guint8 priority; +}; + +// Creation/freeing +gfire_server_detector *gfire_server_detector_create(GCallback p_server_callback); +void gfire_server_detector_free(gfire_server_detector *p_detector); + +// Starting/stopping (OS dependent) +void gfire_server_detector_start(gfire_server_detector *p_detector, guint32 p_gameid, guint32 p_pid); +void gfire_server_detector_stop(gfire_server_detector *p_detector); + +// Server handling +void gfire_server_detection_remove_invalid_servers(gfire_server_detector *p_detection, const GList *p_local_ips); +const gfire_server *gfire_server_detection_guess_server(gfire_server_detector *p_detection); + +// Status checks +gboolean gfire_server_detector_running(const gfire_server_detector *p_detector); +gboolean gfire_server_detector_finished(const gfire_server_detector *p_detector); + +#endif // _GF_SERVER_DETECTION_H diff -Nru gfire-0.8.3/src/gf_server_detection_linux.c gfire-0.9.4/src/gf_server_detection_linux.c --- gfire-0.8.3/src/gf_server_detection_linux.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_detection_linux.c 2011-03-14 20:20:59.000000000 +0000 @@ -0,0 +1,455 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_games.h" +#include "gf_server_detection.h" +#include "gf_game_detection.h" +#include +#include + +static void gfire_server_detection_netstat(gfire_server_detector *p_detection) +{ + gchar *fd_dir_path = g_strdup_printf("/proc/%u/fd", p_detection->pid); + DIR *fd_dir = opendir(fd_dir_path); + + // No such dir, netstat won't work + if(!fd_dir) + { + g_free(fd_dir_path); + return; + } + + GList *inodes = NULL; + + struct dirent *fd; + while((fd = readdir(fd_dir))) + { + gchar *fd_path = g_strdup_printf("%s/%s", fd_dir_path, fd->d_name); + + gchar real_path[PATH_MAX]; + int len = readlink(fd_path, real_path, PATH_MAX - 1); + g_free(fd_path); + + // Skip on error + if(len == -1) + continue; + + real_path[len] = 0; + + if(strlen(real_path) > 9 && !strncmp(real_path, "socket:", 7)) + { + if(real_path[7] == '[' && real_path[strlen(real_path) - 1] == ']') + { + gchar *inode_str = real_path + 8; + real_path[strlen(real_path) - 1] = 0; + + unsigned long *inode = g_malloc(sizeof(unsigned long)); + if(!sscanf(inode_str, "%lu", inode)) + { + g_free(inode); + } + else + inodes = g_list_append(inodes, inode); + } + } + else if(strlen(real_path) > 7 && !strncmp(real_path, "[0000]:", 7)) + { + unsigned long *inode = g_malloc(sizeof(unsigned long)); + if(!sscanf(real_path + 7, "%lu", inode)) + { + g_free(inode); + } + else + inodes = g_list_append(inodes, inode); + } + } + + closedir(fd_dir); + g_free(fd_dir_path); + + // Get the socket data for each inode + gchar buffer[8192]; + // TCP + FILE *file = fopen("/proc/net/tcp", "r"); + if(file) + { + gboolean first = TRUE; + do + { + if(fgets(buffer, 8192, file)) + { + // Skip the header + if(first) + { + first = FALSE; + continue; + } + + guint32 ip; + guint16 port; + unsigned long inode; + guint16 state; + if(sscanf(buffer, "%*d: %*X:%*X %8X:%4hX %hX %*X:%*X %*X:%*X %*X %*d %*d %lu" + "%*s\n", &ip, &port, &state, &inode) < 4) + continue; + + if(state != 0x01) // ESTABLISHED + continue; + + GList *cur = inodes; + while(cur) + { + if(*((guint32*)cur->data) == inode) + { + gfire_server *server = g_malloc0(sizeof(gfire_server)); + server->ip = g_ntohl(ip); + server->port = port; + + p_detection->tcp_servers = g_list_append(p_detection->tcp_servers, server); + + break; + } + cur = g_list_next(cur); + } + } + } while(!feof(file)); + + fclose(file); + } + + // UDP + file = fopen("/proc/net/udp", "r"); + if(file) + { + gboolean first = TRUE; + do + { + if(fgets(buffer, 8192, file)) + { + // Skip the header + if(first) + { + first = FALSE; + continue; + } + + guint32 ip; + guint16 port; + unsigned long inode; + guint16 state; + if(sscanf(buffer, "%*d: %8X:%4hX %*X:%*X %hX %*X:%*X %*X:%*X %*X %*d %*d %lu " + "%*s\n", &ip, &port, &state, &inode) < 4) + continue; + + if(state != 0x07) // LISTENING + continue; + + GList *cur = inodes; + while(cur) + { + if(*((guint32*)cur->data) == inode) + { + gfire_server *server = g_malloc0(sizeof(gfire_server)); + server->ip = g_ntohl(ip); + server->port = port; + + p_detection->local_udp_connections = g_list_append(p_detection->local_udp_connections, server); + + break; + } + cur = g_list_next(cur); + } + } + } while(!feof(file)); + + fclose(file); + } + + gfire_list_clear(inodes); +} + +static void gfire_server_detection_tcpdump(gfire_server_detector *p_detection, const GList *p_local_ips) +{ + gchar tcp_output[8192]; + + // Detect network connections using tcpdump + gchar *command = g_strdup("/usr/sbin/tcpdump -i any -ftnc 20 2>/dev/null"); + FILE *command_pipe = popen(command, "r"); + g_free(command); + + if(!command_pipe) + return; + + do + { + if(fgets(tcp_output, 8192, command_pipe)) + { + // Check if we should abort + g_mutex_lock(p_detection->mutex); + if(p_detection->quit) + { + g_mutex_unlock(p_detection->mutex); + pclose(command_pipe); + return; + } + else + g_mutex_unlock(p_detection->mutex); + + guint16 sip1[4]; + guint16 port1; + guint16 sip2[4]; + guint16 port2; + + if(sscanf(tcp_output, "IP %3hu.%3hu.%3hu.%3hu.%5hu > %3hu.%3hu.%3hu.%3hu.%5hu:", + &sip1[0], &sip1[1], &sip1[2], &sip1[3], &port1, + &sip2[0], &sip2[1], &sip2[2], &sip2[3], &port2) < 10) + continue; + + guint32 ip1 = sip1[0] << 24 | sip1[1] << 16 | sip1[2] << 8 | sip1[3]; + guint32 ip2 = sip2[0] << 24 | sip2[1] << 16 | sip2[2] << 8 | sip2[3]; + + guint32 local_ip = 0, remote_ip = 0; + guint16 local_port = 0, remote_port = 0; + const GList *lip = p_local_ips; + while(lip) + { + if(ip1 == *((guint32*)lip->data)) + { + local_ip = ip1; + local_port = port1; + remote_ip = ip2; + remote_port = port2; + + break; + } + else if(ip2 == *((guint32*)lip->data)) + { + local_ip = ip2; + local_port = port2; + remote_ip = ip1; + remote_port = ip1; + + break; + } + lip = g_list_next(lip); + } + + // No such IP found + if(local_ip == 0) + { + printf("no local found\n"); + continue; + } + + // Check TCP servers + GList *tcp = p_detection->tcp_servers; + while(tcp) + { + gfire_server *server = (gfire_server*)tcp->data; + // If we got that server, increase its priority + if(server->ip == remote_ip && server->port == remote_port) + { + server->priority++; + break; + } + tcp = g_list_next(tcp); + } + + // Check UPD servers + GList *udp = p_detection->udp_servers; + while(udp) + { + gfire_server *server = (gfire_server*)udp->data; + // If we got that server, increase its priority + if(server->ip == remote_ip && server->port == remote_port) + { + server->priority++; + break; + } + udp = g_list_next(udp); + } + + // Check UDP connections + if(!udp) + { + udp = p_detection->local_udp_connections; + while(udp) + { + gfire_server *con = (gfire_server*)udp->data; + // If the connection listens on that IP & Port, add the server + if((con->ip == 0 || con->ip == local_ip) && con->port == local_port) + { + gfire_server *server = g_malloc(sizeof(gfire_server)); + server->ip = remote_ip; + server->port = remote_port; + server->priority = 1; + + p_detection->udp_servers = g_list_append(p_detection->udp_servers, server); + break; + } + udp = g_list_next(udp); + } + } + } + } while(!feof(command_pipe)); + + pclose(command_pipe); +} + +static GList *gfire_server_detection_get_local_ips() +{ + struct ifaddrs *if_addresses, *if_addresses_tmp; + GList *ret = NULL; + + // Fetch IP addresses + if(getifaddrs(&if_addresses) == -1) + return NULL; + + for (if_addresses_tmp = if_addresses; if_addresses_tmp; if_addresses_tmp = if_addresses_tmp->ifa_next) + { + // Store all IPv4 addresses of all local devices (there's no remote info available) + if(if_addresses_tmp->ifa_addr->sa_family == AF_INET) + { + struct sockaddr_in *addr = (struct sockaddr_in*)if_addresses_tmp->ifa_addr; + + guint32 *ip = g_malloc(sizeof(guint32)); + *ip = ntohl(addr->sin_addr.s_addr); + + ret = g_list_append(ret, ip); + } + } + + freeifaddrs(if_addresses); + + return ret; +} + +static void gfire_server_detection_thread(gfire_server_detector *p_detection) +{ + GList *local_ips = gfire_server_detection_get_local_ips(); + const gfire_server *server = NULL; + + // Get all TCP servers and local UDP connections + gfire_server_detection_netstat(p_detection); + + // Check if we've been requested to stop already + g_mutex_lock(p_detection->mutex); + if(p_detection->quit) + goto abort; + else + g_mutex_unlock(p_detection->mutex); + + // Filter all found TCP servers + gfire_server_detection_remove_invalid_servers(p_detection, local_ips); + + // Check their occurrence and the remote data for local UPD sockets + gfire_server_detection_tcpdump(p_detection, local_ips); + + // Check if we've been requested to stop already + g_mutex_lock(p_detection->mutex); + if(p_detection->quit) + goto abort; + else + g_mutex_unlock(p_detection->mutex); + + // Filter all found TCP & UDP servers + gfire_server_detection_remove_invalid_servers(p_detection, local_ips); + + // Get the best IP + server = gfire_server_detection_guess_server(p_detection); + // Tell the games detection about the server if there is one and it's priority isn't 0 + if(server /*&& server->priority*/) + ((void(*)(guint32,guint16))p_detection->server_callback)(server->ip, server->port); + else + // Tell the games detection there is no server + ((void(*)(guint32,guint16))p_detection->server_callback)(0, 0); + + // Finalize the thread + g_mutex_lock(p_detection->mutex); + p_detection->running = FALSE; + p_detection->finished = TRUE; + + goto cleanup; + +abort: + p_detection->running = FALSE; + +cleanup: + gfire_list_clear(local_ips); + gfire_list_clear(p_detection->excluded_ports); + p_detection->excluded_ports = NULL; + gfire_list_clear(p_detection->local_udp_connections); + p_detection->local_udp_connections = NULL; + gfire_list_clear(p_detection->tcp_servers); + p_detection->tcp_servers = NULL; + gfire_list_clear(p_detection->udp_servers); + p_detection->udp_servers = NULL; + + g_mutex_unlock(p_detection->mutex); +} + +void gfire_server_detector_start(gfire_server_detector *p_detector, guint32 p_gameid, guint32 p_pid) +{ + if(!p_detector || p_gameid == 0 || p_pid == 0) + return; + + g_mutex_lock(p_detector->mutex); + if(p_detector->running) + { + g_mutex_unlock(p_detector->mutex); + return; + } + g_mutex_unlock(p_detector->mutex); + + // Get all infos needed for detection + const gfire_game *game = gfire_game_by_id(p_gameid); + p_detector->excluded_ports = gfire_game_excluded_ports_copy(game); + + p_detector->pid = p_pid; + + p_detector->finished = FALSE; + p_detector->quit = FALSE; + p_detector->running = TRUE; + + // Create server detection thread + p_detector->os_data = g_thread_create((GThreadFunc)gfire_server_detection_thread, p_detector, TRUE, NULL); +} + +void gfire_server_detector_stop(gfire_server_detector *p_detector) +{ + if(!p_detector) + return; + + g_mutex_lock(p_detector->mutex); + // Check if the thread is running + if(!p_detector->running || !p_detector->os_data) + { + g_mutex_unlock(p_detector->mutex); + return; + } + + // Tell the thread to terminate + p_detector->quit = TRUE; + g_mutex_unlock(p_detector->mutex); + + // Wait until the thread terminates + g_thread_join((GThread*)p_detector->os_data); +} diff -Nru gfire-0.8.3/src/gf_server_detection_win.c gfire-0.9.4/src/gf_server_detection_win.c --- gfire-0.8.3/src/gf_server_detection_win.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_detection_win.c 2011-03-14 20:20:55.000000000 +0000 @@ -0,0 +1,418 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifdef _WIN32 + +#include "gf_server_detection.h" +#include +#include + +#define SIO_RCVALL _WSAIOW(IOC_VENDOR,1) +#define RCVALL_IPLEVEL 3 + +// Declare some required data types +#ifndef UDP_TABLE_CLASS +typedef enum { + UDP_TABLE_BASIC, + UDP_TABLE_OWNER_PID, + UDP_TABLE_OWNER_MODULE +} UDP_TABLE_CLASS, *PUDP_TABLE_CLASS; +#endif // UDP_TABLE_CLASS + +#ifndef MIB_UDPROW_OWNER_PID +typedef struct _MIB_UDPROW_OWNER_PID { + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwOwningPid; +} MIB_UDPROW_OWNER_PID, *PMIB_UDPROW_OWNER_PID; +#endif // MIB_UDPROW_OWNER_PID + +#ifndef MIB_UDPTABLE_OWNER_PID +typedef struct _MIB_UDPTABLE_OWNER_PID { + DWORD dwNumEntries; + MIB_UDPROW_OWNER_PID table[ANY_SIZE]; +} MIB_UDPTABLE_OWNER_PID, *PMIB_UDPTABLE_OWNER_PID; +#endif // MIB_UDPTABLE_OWNER_PID + +typedef struct _gfire_server_detection_windows +{ + SOCKET sock; + guint prpl_input; + GList *local_ips; + GTimeVal timeout; +} gfire_server_detection_windows; + +static DWORD WINAPI (*ptrGetIpAddrTable)(PMIB_IPADDRTABLE,PULONG,BOOL) = NULL; +static DWORD WINAPI (*ptrGetExtendedTcpTable)(PVOID,PDWORD,BOOL,ULONG,TCP_TABLE_CLASS,ULONG) = NULL; +static DWORD WINAPI (*ptrGetExtendedUdpTable)(PVOID,PDWORD,BOOL,ULONG,UDP_TABLE_CLASS,ULONG) = NULL; + +static GList *get_local_ips() +{ + if(!ptrGetIpAddrTable) + return NULL; + + PMIB_IPADDRTABLE iptable = NULL; + ULONG size = 0; + + DWORD ret = ptrGetIpAddrTable(NULL, &size, FALSE); + if(ret != ERROR_INSUFFICIENT_BUFFER) + return NULL; + + iptable = (PMIB_IPADDRTABLE)g_malloc(size); + + ret = ptrGetIpAddrTable(iptable, &size, FALSE); + if(ret != NO_ERROR) + return NULL; + + GList *ips = NULL; + int i = 0; + for(; i < iptable->dwNumEntries; i++) + { + // Only connected devices + if(!(iptable->table[i].wType & 0x0008)) + { + guint32 *ip = g_malloc(sizeof(guint32)); + *ip = ntohl(iptable->table[i].dwAddr); + ips = g_list_append(ips, ip); + } + } + + return ips; +} + +static void get_tcp_connections(gfire_server_detector *p_detector) +{ + if(!ptrGetExtendedTcpTable) + return; + + PMIB_TCPTABLE_OWNER_PID tcptable = NULL; + DWORD size = 0; + + DWORD ret = ptrGetExtendedTcpTable(NULL, &size, FALSE, AF_INET, TCP_TABLE_OWNER_PID_CONNECTIONS, 0); + if(ret != ERROR_INSUFFICIENT_BUFFER) + return; + + tcptable = (PMIB_TCPTABLE_OWNER_PID)g_malloc(size); + ret = ptrGetExtendedTcpTable(tcptable, &size, FALSE, AF_INET, TCP_TABLE_OWNER_PID_CONNECTIONS, 0); + if(ret != NO_ERROR) + { + g_free(tcptable); + return; + } + + int i = 0; + for(; i < tcptable->dwNumEntries; i++) + { + // Only store active connections which belong to the requested PID + if(tcptable->table[i].dwState == MIB_TCP_STATE_ESTAB && tcptable->table[i].dwOwningPid == p_detector->pid) + { + // Store the IPs + gfire_server *server = (gfire_server*)g_malloc0(sizeof(gfire_server)); + server->ip = ntohl(tcptable->table[i].dwRemoteAddr); + server->port = ntohs(tcptable->table[i].dwRemotePort); + p_detector->tcp_servers = g_list_append(p_detector->tcp_servers, server); + } + } + + g_free(tcptable); +} + +static void get_udp_connections(gfire_server_detector *p_detector) +{ + if(!ptrGetExtendedUdpTable) + return; + + PMIB_UDPTABLE_OWNER_PID udptable = NULL; + DWORD size = 0; + + DWORD ret = ptrGetExtendedUdpTable(NULL, &size, FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0); + if(ret != ERROR_INSUFFICIENT_BUFFER) + return; + + udptable = (PMIB_UDPTABLE_OWNER_PID)g_malloc(size); + ret = ptrGetExtendedUdpTable(udptable, &size, FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0); + if(ret != NO_ERROR) + { + g_free(udptable); + return; + } + + int i = 0; + for(; i < udptable->dwNumEntries; i++) + { + // Only store connections which belong to the requested PID + if(udptable->table[i].dwOwningPid == p_detector->pid) + { + // Store the ports + guint16 *port = (guint16*)g_malloc(sizeof(guint16)); + *port = ntohs(udptable->table[i].dwLocalPort); + + p_detector->local_udp_connections = g_list_append(p_detector->local_udp_connections, port); + } + } + + g_free(udptable); +} + +static void cleanup(gfire_server_detector *p_detector) +{ + gfire_server_detection_windows *data = (gfire_server_detection_windows*)p_detector->os_data; + + if(data->sock != INVALID_SOCKET) + closesocket(data->sock); + + if(data->prpl_input) + purple_input_remove(data->prpl_input); + + gfire_list_clear(data->local_ips); + g_free(data); + + gfire_list_clear(p_detector->excluded_ports); + p_detector->excluded_ports = NULL; + gfire_list_clear(p_detector->local_udp_connections); + p_detector->local_udp_connections = NULL; + gfire_list_clear(p_detector->tcp_servers); + p_detector->tcp_servers = NULL; + gfire_list_clear(p_detector->udp_servers); + p_detector->udp_servers = NULL; + + p_detector->running = FALSE; +} + +static void read_sniffed_packet(gfire_server_detector *p_detector, gint p_fd, PurpleInputCondition p_cond) +{ + if(p_cond != PURPLE_INPUT_READ) + return; + + gfire_server_detection_windows *data = (gfire_server_detection_windows*)p_detector->os_data; + + GTimeVal cur_time; + g_get_current_time(&cur_time); + + if((cur_time.tv_sec - data->timeout.tv_sec) >= 5) + { + gfire_server_detection_remove_invalid_servers(p_detector, data->local_ips); + const gfire_server *server = gfire_server_detection_guess_server(p_detector); + + if(server) + ((void(*)(guint32,guint16))p_detector->server_callback)(server->ip, server->port); + else + ((void(*)(guint32,guint16))p_detector->server_callback)(0, 0); + + p_detector->finished = TRUE; + cleanup(p_detector); + return; + } + + static guint8 buffer[8192]; + + int len = recv(data->sock, (char*)buffer, 8192, 0); + if(len <= 0) + { + cleanup(p_detector); + return; + } + else if(len >= 24) + { + guint8 len = (buffer[0] & 0x7F) * 4; + guint8 proto = buffer[9]; + + if(proto == 6 /*TCP*/ || proto == 17 /*UDP*/) + { + guint16 source_port = *((guint16*)(buffer + len)); + guint16 dest_port = *((guint16*)(buffer + len + 2)); + + guint32 source_ip = ntohl(*((guint32*)(buffer + 12))); + guint32 dest_ip = ntohl(*((guint32*)(buffer + 16))); + + guint32 local_ip = 0, remote_ip = 0; + guint16 local_port = 0, remote_port = 0; + + GList *lip = data->local_ips; + while(lip) + { + if(source_ip == *((guint32*)lip->data)) + { + local_ip = source_ip; + local_port = source_port; + remote_ip = dest_ip; + remote_port = dest_port; + break; + } + else if(dest_ip == *((guint32*)lip->data)) + { + local_ip = dest_ip; + local_port = dest_port; + remote_ip = source_ip; + remote_port = source_port; + break; + } + lip = g_list_next(lip); + } + + if(local_ip != 0) + { + if(proto == 6) + { + GList *tcp = p_detector->tcp_servers; + while(tcp) + { + gfire_server *server = tcp->data; + if(server->ip == remote_ip && server->port == dest_port) + { + server->priority++; + break; + } + tcp = g_list_next(tcp); + } + } + else if(proto == 17) + { + GList *udp = p_detector->udp_servers; + while(udp) + { + gfire_server *server = udp->data; + if(server->ip == remote_ip && server->port == dest_port) + { + server->priority++; + break; + } + udp = g_list_next(udp); + } + + if(!udp) + { + GList *udpcon = p_detector->local_udp_connections; + while(udpcon) + { + if(local_port == *((guint16*)udpcon->data)) + { + gfire_server *server = g_malloc(sizeof(gfire_server)); + server->ip = remote_ip; + server->port = remote_port; + server->priority = 1; + p_detector->udp_servers = g_list_append(p_detector->udp_servers, server); + break; + } + + udpcon = g_list_next(udpcon); + } + } + } + } + } + } +} + +static gboolean start_sniffing_connections(gfire_server_detector *p_detector) +{ + gfire_server_detection_windows *data = (gfire_server_detection_windows*)p_detector->os_data; + data->sock = socket(AF_INET, SOCK_RAW, IPPROTO_IP); + if(data->sock == INVALID_SOCKET) + return FALSE; + + char host[255]; + gethostname(host, 255); + struct hostent *dns = gethostbyname(host); + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.S_un.S_addr = *((u_long*)dns->h_addr_list[0]); + addr.sin_port = 0; + + if(bind(data->sock, (struct sockaddr*)&addr, sizeof(struct sockaddr_in)) != 0) + { + closesocket(data->sock); + return FALSE; + } + + DWORD outlen, val = RCVALL_IPLEVEL; + if(WSAIoctl(data->sock, SIO_RCVALL, &val, sizeof(DWORD), NULL, 0, &outlen, NULL, NULL) != 0) + { + if(WSAGetLastError() == WSAEACCES) + purple_debug_error("gfire", "server detection: No permission to listen on device, " + "please make sure you launch Pidgin with enough permissions"); + + closesocket(data->sock); + return FALSE; + } + + g_get_current_time(&data->timeout); + + data->prpl_input = purple_input_add(data->sock, PURPLE_INPUT_READ, (PurpleInputFunction)read_sniffed_packet, + p_detector); + + return TRUE; +} + +void gfire_server_detector_start(gfire_server_detector *p_detector, guint32 p_gameid, guint32 p_pid) +{ + if(!p_detector || p_gameid == 0 || p_pid == 0 || p_detector->running) + return; + + if(!ptrGetExtendedTcpTable || !ptrGetExtendedUdpTable) + { + // Load the "netstat" functions dynamically + HINSTANCE lib = LoadLibrary("iphlpapi.dll"); + if(!lib) + { + purple_debug_error("gfire", "server detection: couldn't load library\n"); + return; + } + + ptrGetIpAddrTable = (DWORD WINAPI(*)(PMIB_IPADDRTABLE,PULONG,BOOL))GetProcAddress(lib, "GetIpAddrTable"); + ptrGetExtendedTcpTable = (DWORD WINAPI(*)(PVOID,PDWORD,BOOL,ULONG,TCP_TABLE_CLASS,ULONG)) + GetProcAddress(lib, "GetExtendedTcpTable"); + ptrGetExtendedUdpTable = (DWORD WINAPI(*)(PVOID,PDWORD,BOOL,ULONG,UDP_TABLE_CLASS,ULONG)) + GetProcAddress(lib, "GetExtendedUdpTable"); + } + + p_detector->gameid = p_gameid; + p_detector->pid = p_pid; + p_detector->quit = FALSE; + p_detector->finished = FALSE; + p_detector->running = TRUE; + + gfire_server_detection_windows *data = g_malloc0(sizeof(gfire_server_detection_windows)); + data->sock = INVALID_SOCKET; + data->local_ips = get_local_ips(); + p_detector->os_data = data; + + get_tcp_connections(p_detector); + gfire_server_detection_remove_invalid_servers(p_detector, data->local_ips); + + get_udp_connections(p_detector); + if(!start_sniffing_connections(p_detector)) + { + ((void(*)(guint32,guint16))p_detector->server_callback)(0, 0); + cleanup(p_detector); + } +} + +void gfire_server_detector_stop(gfire_server_detector *p_detector) +{ + if(p_detector->running && p_detector->os_data) + { + cleanup(p_detector); + } +} + +#endif // _WIN32 diff -Nru gfire-0.8.3/src/gf_server_query_ase.c gfire-0.9.4/src/gf_server_query_ase.c --- gfire-0.8.3/src/gf_server_query_ase.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_ase.c 2011-03-14 20:20:35.000000000 +0000 @@ -0,0 +1,470 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +typedef struct _gfire_sq_ase_player +{ + gchar *name; + gchar *team; + gchar *skin; + gchar *score; + gchar *ping; + gchar *time; +} gfire_sq_ase_player; + +typedef struct _gfire_sq_ase_data +{ + gchar *game_name; + guint16 game_port; + gchar *server_name; + gchar *game_type; + gchar *map; + gchar *version; + gboolean password; + guint num_players; + guint max_players; + GData *rules; + GSList *players; +} gfire_sq_ase_data; + +// Prototypes +static void gfire_sq_ase_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_ase_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_ase_details(gfire_game_server *p_server); +static void gfire_sq_ase_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_ase_driver = +{ + gfire_sq_ase_query, + gfire_sq_ase_parse, + gfire_sq_ase_details, + gfire_sq_ase_free_server, + 3 +}; + +static const struct { gchar ch; const gchar *hex; } aseCodes[] = +{ + { '0', "000000" }, { '1', "FFFFFF" }, { '2', "0000FF" }, + { '3', "00FF00" }, { '4', "FF0000" }, { '5', "00FFFF" }, + { '6', "FFFF00" }, { '7', "FF00FF" }, { '8', "FF9900" }, + { '9', "808080" }, { 0, NULL } +}; + +static gchar *gfire_sq_ase_strip_color_codes(const gchar *p_str) +{ + GString *str = g_string_new(NULL); + + while(*p_str) + { + const gchar *next = strchr(p_str + 1, '$'); + if(!next) + next = strchr(p_str + 1, 0); + + if(*p_str == '$') + { + int i = 0; + while(aseCodes[i].ch) + { + if(*(p_str + 1) == aseCodes[i].ch) + { + g_string_append_len(str, p_str + 2, next - p_str - 2); + break; + } + i++; + } + + if(!aseCodes[i].ch) + g_string_append_len(str, p_str, next - p_str); + } + else + g_string_append_len(str, p_str, next - p_str); + + p_str = next; + } + + return g_string_free(str, FALSE); +} + +static gchar *gfire_sq_ase_color_codes_to_html(const gchar *p_str) +{ + GString *str = g_string_new(NULL); + gboolean first = TRUE; + + while(*p_str) + { + const gchar *next = strchr(p_str + 1, '$'); + if(!next) + next = strchr(p_str + 1, 0); + + if(*p_str == '$') + { + int i = 0; + while(aseCodes[i].ch) + { + if(*(p_str + 1) == aseCodes[i].ch) + { + if(first) + { + g_string_append_printf(str, "", aseCodes[i].hex); + first = FALSE; + } + else + g_string_append_printf(str, "", aseCodes[i].hex); + + g_string_append_len(str, p_str + 2, next - p_str - 2); + break; + } + i++; + } + + if(!aseCodes[i].ch) + g_string_append_len(str, p_str, next - p_str); + } + else + g_string_append_len(str, p_str, next - p_str); + + p_str = next; + } + + if(!first) + g_string_append(str, ""); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_ase_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + static const gchar query = 's'; + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, &query, sizeof(query), 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static gchar *parse_string(const unsigned char *p_data, guint p_len, guint *p_offset, gboolean p_retEmpty) +{ + if(p_len < (*p_offset + 1)) + return NULL; + + guint8 slen = *(p_data + (*p_offset)++); + if((!p_retEmpty && (slen <= 1)) || p_len < (*p_offset + slen - 1)) + return NULL; + + gchar *str = g_strndup((const gchar*)p_data + *p_offset, slen - 1); + (*p_offset) += slen - 1; + return str; +} + +static void free_ase_player(gfire_sq_ase_player *p_player) +{ + g_free(p_player->name); + g_free(p_player->team); + g_free(p_player->skin); + g_free(p_player->score); + g_free(p_player->ping); + g_free(p_player->time); + g_free(p_player); +} + +static void free_ase_data(gfire_sq_ase_data *p_data) +{ + g_free(p_data->game_name); + g_free(p_data->server_name); + g_free(p_data->game_type); + g_free(p_data->map); + g_free(p_data->version); + + if(p_data->rules) + g_datalist_clear(&p_data->rules); + + while(p_data->players) + { + free_ase_player(p_data->players->data); + p_data->players = g_slist_delete_link(p_data->players, p_data->players); + } + + g_free(p_data); +} + +static gboolean gfire_sq_ase_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + if(memcmp(p_data, "EYE1", 4) != 0) + return FALSE; + + gfire_sq_ase_data *data = g_new0(gfire_sq_ase_data, 1); + guint offset = 4; + gchar *tempstr; + + // General server data + data->game_name = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!data->game_name) + goto error; + + tempstr = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!tempstr) + goto error; + data->game_port = atoi(tempstr); + g_free(tempstr); + + data->server_name = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!data->server_name) + goto error; + + data->game_type = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!data->game_type) + goto error; + + data->map = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!data->map) + goto error; + + data->version = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!data->version) + goto error; + + tempstr = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!tempstr) + goto error; + data->password = (*tempstr == '1'); + g_free(tempstr); + + tempstr = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!tempstr) + goto error; + data->num_players = atoi(tempstr); + g_free(tempstr); + + tempstr = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!tempstr) + goto error; + data->max_players = atoi(tempstr); + g_free(tempstr); + + // Server rules + g_datalist_init(&data->rules); + while(1) + { + gchar *key = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!key) + break; + gchar *value = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, FALSE)); + if(!value) + { + g_free(key); + goto error; + } + g_datalist_set_data_full(&data->rules, key, value, g_free); + g_free(key); + } + + // Players + while(p_len > offset) + { + gfire_sq_ase_player *player = g_new0(gfire_sq_ase_player, 1); + guint8 flags = *(p_data + offset++); + + if(flags & 1) + { + player->name = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, TRUE)); + if(!player->name) + { + free_ase_player(player); + break; + } + } + + if(flags & 2) + { + player->team = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, TRUE)); + if(!player->team) + { + free_ase_player(player); + break; + } + } + + if(flags & 4) + { + player->skin = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, TRUE)); + if(!player->skin) + { + free_ase_player(player); + break; + } + } + + if(flags & 8) + { + player->score = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, TRUE)); + if(!player->score) + { + free_ase_player(player); + break; + } + } + + if(flags & 16) + { + player->ping = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, TRUE)); + if(!player->ping) + { + free_ase_player(player); + break; + } + } + + if(flags & 32) + { + player->time = gfire_strip_invalid_utf8(parse_string(p_data, p_len, &offset, TRUE)); + if(!player->time) + { + free_ase_player(player); + break; + } + } + + data->players = g_slist_append(data->players, player); + } + + // Hack for some servers... + if(g_datalist_get_data(&data->rules, "numplayers")) + data->num_players = atoi(g_datalist_get_data(&data->rules, "numplayers")); + + // Copy values into the standard container + p_server->data = g_new0(gfire_game_server_data, 1); + p_server->data->driver = &gf_sq_ase_driver; + p_server->data->proto_data = data; + p_server->data->name = gfire_sq_ase_strip_color_codes(data->server_name); + p_server->data->map = g_strdup(data->map); + p_server->data->players = data->num_players; + p_server->data->max_players = data->max_players; + p_server->data->ping = p_ping; + + // No more packets to request! + return FALSE; + +error: + free_ase_data(data); + return FALSE; +} + +static gchar *gfire_sq_ase_fixed_len_string(const gchar *p_str, guint p_len) +{ + if(!p_str) + return NULL; + + // Pad the string with spaces if necessary + if(g_utf8_strlen(p_str, -1) < p_len) + { + gchar *str = g_strnfill(p_len + strlen(p_str) - g_utf8_strlen(p_str, -1), ' '); + memcpy(str, p_str, strlen(p_str)); + return str; + } + // Copy max p_len bytes + else if(g_utf8_strlen(p_str, -1) > p_len) + { + const gchar *end = g_utf8_offset_to_pointer(p_str, p_len - 3); + gchar *str = g_strnfill(end - p_str + 3, '.'); + memcpy(str, p_str, end - p_str); + return str; + } + else + return g_strdup(p_str); +} + +static void gfire_sq_ase_details_vars(GQuark p_key, gpointer p_data, gpointer p_udata) +{ + g_string_append_printf((GString*)p_udata, "%s: %s
", g_quark_to_string(p_key), (gchar*)p_data); +} + +static gchar *gfire_sq_ase_details(gfire_game_server *p_server) +{ + GString *str = g_string_new(NULL); + + gfire_sq_ase_data *data = (gfire_sq_ase_data*)p_server->data->proto_data; + + // General server infos + g_string_append(str, _("General Server Details:
")); + // Server Name + gchar *escaped = gfire_escape_html(data->server_name); + gchar *name = gfire_sq_ase_color_codes_to_html(escaped); + g_free(escaped); + g_string_append_printf(str, _("Server Name: %s
"), name); + g_free(name); + // Players + g_string_append_printf(str, _("Players: %u/%u
"), p_server->data->players, p_server->data->max_players); + // Map + escaped = gfire_escape_html(data->map); + g_string_append_printf(str, _("Map: %s
"), escaped); + g_free(escaped); + // Password secured + g_string_append_printf(str, _("Password secured: %s
"), data->password ? _("Yes") : _("No")); + // Game Type + g_string_append_printf(str, _("Game Type: %s
"), data->game_type); + // Version + g_string_append_printf(str, _("Version: %s"), data->version); + + // Players + g_string_append(str, _("

Players:
Name Score Ping
")); + GSList *cur = data->players; + while(cur) + { + gfire_sq_ase_player *player = (gfire_sq_ase_player*)cur->data; + + gchar *stripped = gfire_sq_ase_strip_color_codes(player->name ? player->name : _("N/A")); + gchar *unescaped = gfire_sq_ase_fixed_len_string(stripped, 16); + g_free(stripped); + gchar *name = gfire_escape_html(unescaped); + g_free(unescaped); + + unescaped = gfire_sq_ase_fixed_len_string(player->score ? player->score : _("N/A"), 10); + gchar *score = gfire_escape_html(unescaped); + g_free(unescaped); + + gchar *ping = gfire_escape_html(player->ping ? player->ping : _("N/A")); + + g_string_append_printf(str, "%s %s %s
", name, score, ping); + + g_free(ping); + g_free(score); + g_free(name); + + cur = g_slist_next(cur); + } + + // Other server rules + g_string_append(str, _("
All Server Rules:
")); + g_datalist_foreach(&data->rules, gfire_sq_ase_details_vars, str); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_ase_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + free_ase_data((gfire_sq_ase_data*)p_server->data->proto_data); +} diff -Nru gfire-0.8.3/src/gf_server_query.c gfire-0.9.4/src/gf_server_query.c --- gfire-0.8.3/src/gf_server_query.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query.c 2011-03-14 20:20:48.000000000 +0000 @@ -0,0 +1,364 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +// Available server query drivers +extern gfire_server_query_driver gf_sq_quake_driver; +extern gfire_server_query_driver gf_sq_source_driver; +extern gfire_server_query_driver gf_sq_gamespy_driver; +extern gfire_server_query_driver gf_sq_gamespy2_driver; +extern gfire_server_query_driver gf_sq_gamespy3_driver; +extern gfire_server_query_driver gf_sq_ase_driver; +extern gfire_server_query_driver gf_sq_savage_driver; + +static const struct +{ + const gchar *proto; + const gfire_server_query_driver *driver; + const guint16 query_port; + const gint16 port_offset; +} registeredDrivers[] = +{ + { "WOLFET", &gf_sq_quake_driver, 0, 0 }, + { "HALO", &gf_sq_quake_driver, 0, 0 }, + { "Q2", &gf_sq_quake_driver, 0, 0 }, + { "Q3A", &gf_sq_quake_driver, 0, 0 }, + { "COD", &gf_sq_quake_driver, 0, 0 }, + { "CODUO", &gf_sq_quake_driver, 0, 0 }, + { "COD2", &gf_sq_quake_driver, 0, 0 }, + { "COD4MW", &gf_sq_quake_driver, 0, 0 }, + { "COD5", &gf_sq_quake_driver, 0, 0 }, + { "SOF", &gf_sq_quake_driver, 0, 0 }, + + { "SOURCE", &gf_sq_source_driver, 0, 0 }, + + { "GS", &gf_sq_gamespy_driver, 0, 1 }, + { "VCG", &gf_sq_gamespy_driver, 15425, 0 }, + { "IL2", &gf_sq_gamespy_driver, 21000, 0 }, + { "THPS3", &gf_sq_gamespy_driver, 6500, 0 }, + { "GORE", &gf_sq_gamespy_driver, 27778, 0 }, + { "RNG", &gf_sq_gamespy_driver, 25300, 0 }, + { "MOHAA", &gf_sq_gamespy_driver, 12300, 0 }, + { "UT", &gf_sq_gamespy_driver, 0, 1 }, + { "UT2K3", &gf_sq_gamespy_driver, 0, 10 }, + { "SWRC", &gf_sq_gamespy_driver, 11138, 0 }, + { "NWN", &gf_sq_gamespy_driver, 5121, 0 }, + { "OPFLASH",&gf_sq_gamespy_driver, 0, 1 }, + { "SWAT4", &gf_sq_gamespy_driver, 10481, 0 }, + { "JBNF", &gf_sq_gamespy_driver, 6550, 0 }, + + { "GS2", &gf_sq_gamespy2_driver, 3658, 0 }, // PORT (maybe 29900?) + { "AA", &gf_sq_gamespy2_driver, 1717, 0 }, + { "DEUSEX", &gf_sq_gamespy2_driver, 7791, 0 }, + { "PAINKILLER", &gf_sq_gamespy2_driver, 3455, 0 }, + + { "BF2", &gf_sq_gamespy3_driver, 29900, 0 }, + { "BF2142", &gf_sq_gamespy3_driver, 29900, 0 }, + + { "ASE", &gf_sq_ase_driver, 0, 123 }, + { "FARCRY", &gf_sq_ase_driver, 0, 123 }, + { "BF1942", &gf_sq_ase_driver, 0, 123 }, + { "BFVIETNAM", &gf_sq_ase_driver, 0, 123 }, + + { "SAVAGE", &gf_sq_savage_driver, 0, 0 }, + + { NULL, NULL, 0, 0 } +}; + +gfire_server_query *gfire_server_query_create() +{ + gfire_server_query *ret = g_malloc0(sizeof(gfire_server_query)); + ret->servers = g_queue_new(); + ret->socket = -1; + return ret; +} + +void gfire_server_query_free(gfire_server_query *p_query) +{ + if(!p_query) + return; + + if(p_query->prpl_data) + purple_network_listen_cancel(p_query->prpl_data); + + if(p_query->prpl_inpa) + purple_input_remove(p_query->prpl_inpa); + + if(p_query->socket >= 0) + close(p_query->socket); + + if(p_query->timeout) + g_source_remove(p_query->timeout); + + while(p_query->cur_servers) + { + gfire_game_query_server *server = p_query->cur_servers->data; + p_query->cur_servers = g_list_delete_link(p_query->cur_servers, p_query->cur_servers); + gfire_game_server_free(server->server); + g_free(server); + } + + while(!g_queue_is_empty(p_query->servers)) + { + gfire_game_query_server *server = g_queue_pop_head(p_query->servers); + gfire_game_server_free(server->server); + g_free(server); + } + g_queue_free(p_query->servers); + + g_free(p_query); +} + +static gfire_game_server *gfire_game_server_apply_query_port(const gfire_server_query *p_query, + gfire_game_server *p_server) +{ + p_server->query_port = p_query->query_port ? p_query->query_port : (p_server->port + p_query->port_offset); + return p_server; +} + +gchar *gfire_game_server_details(gfire_game_server *p_server) +{ + if(!p_server || !p_server->data || !p_server->data->driver) + return NULL; + + return p_server->data->driver->details(p_server); +} + +void gfire_game_server_free(gfire_game_server *p_server) +{ + if(!p_server) + return; + + if(p_server->data) + { + if(p_server->data->driver) + p_server->data->driver->free_server(p_server); + + g_free(p_server->data->name); + g_free(p_server->data->map); + g_free(p_server->data); + } + + g_free(p_server); +} + +void gfire_server_query_add_server(gfire_server_query *p_query, guint32 p_ip, guint16 p_port, gpointer p_data) +{ + if(!p_query || p_ip == 0 || p_port == 0) + return; + + gfire_game_query_server *server = g_malloc0(sizeof(gfire_game_query_server)); + server->server = g_malloc0(sizeof(gfire_game_server)); + server->p_data = p_data; + server->server->ip = p_ip; + server->server->port = p_port; + + // Query the server immediately if there is space and we're running + if(p_query->socket >= 0 && g_list_length(p_query->cur_servers) < 10) + { + p_query->cur_servers = g_list_append(p_query->cur_servers, server); + p_query->driver->query(gfire_game_server_apply_query_port(p_query, server->server), p_query->full_query, + p_query->socket); + + // Timeout value + GTimeVal gtv; + g_get_current_time(>v); + server->timeout = (gtv.tv_sec * 1000) + (gtv.tv_usec / 1000); + } + // Otherwise just add it to the queue + else + g_queue_push_tail(p_query->servers, server); +} + +static void gfire_server_query_read(gpointer p_data, gint p_fd, PurpleInputCondition p_condition) +{ + static unsigned char buffer[65535]; + + gfire_server_query *query = (gfire_server_query*)p_data; + + // Take the time now + GTimeVal gtv; + g_get_current_time(>v); + + struct sockaddr_in addr; + guint addr_len = sizeof(addr); + guint len = recvfrom(p_fd, buffer, 65534, 0, (struct sockaddr*)&addr, &addr_len); + + if(len <= 0) + return; + buffer[len] = 0; + + // Get the responding server + GList *cur = query->cur_servers; + gfire_game_query_server *server = NULL; + while(cur) + { + gfire_game_query_server *scur = cur->data; + if(scur->server->ip == g_ntohl(addr.sin_addr.s_addr) && scur->server->query_port == g_ntohs(addr.sin_port)) + { + server = scur; + break; + } + cur = g_list_next(cur); + } + + if(!server) + { + purple_debug_warning("gfire", "Server Query: Got packet from unknown server\n"); + return; + } + + // Let the driver do its work + if(query->driver->parse(server->server, (gtv.tv_sec * 1000) + (gtv.tv_usec / 1000) - server->timeout, + query->full_query, buffer, len)) + { + query->driver->query(server->server, query->full_query, p_fd); + // Reset timeout + server->timeout = (gtv.tv_sec * 1000) + (gtv.tv_usec / 1000); + } + else + { + // Server is done + query->callback(server->server, server->p_data, query->callback_data); + query->cur_servers = g_list_delete_link(query->cur_servers, cur); + g_free(server); + + // Fill the list with new ones + while(!g_queue_is_empty(query->servers) && g_list_length(query->cur_servers) != GFSQ_MAX_QUERIES) + { + server = g_queue_pop_tail(query->servers); + query->cur_servers = g_list_append(query->cur_servers, server); + query->driver->query(gfire_game_server_apply_query_port(query, server->server), query->full_query, p_fd); + + server->timeout = (gtv.tv_sec * 1000) + (gtv.tv_usec / 1000); + } + } +} + +static gboolean gfire_server_query_check_timeout(gpointer p_data) +{ + gfire_server_query *query = (gfire_server_query*)p_data; + + GTimeVal gtv; + g_get_current_time(>v); + + GList *cur = query->cur_servers; + while(cur) + { + gfire_game_query_server *server = cur->data; + + if((gtv.tv_sec - (server->timeout / 1000)) > query->driver->timeout) + { + query->callback(server->server, server->p_data, query->callback_data); + g_free(server); + + server = g_queue_pop_tail(query->servers); + if(server) + { + cur->data = server; + query->driver->query(gfire_game_server_apply_query_port(query, server->server), query->full_query, + query->socket); + server->timeout = (gtv.tv_sec * 1000) + (gtv.tv_usec / 1000); + } + else + { + GList *next = g_list_next(cur); + query->cur_servers = g_list_delete_link(query->cur_servers, cur); + cur = next; + continue; + } + } + + cur = g_list_next(cur); + } + + return TRUE; +} + +static void gfire_server_query_listen(int p_socket, gpointer p_data) +{ + gfire_server_query *query = (gfire_server_query*)p_data; + query->prpl_data = NULL; + query->socket = p_socket; + + query->timeout = g_timeout_add_seconds(1, gfire_server_query_check_timeout, query); + + // Populate the current server list and query them + int i = 0; + for(; (i < GFSQ_MAX_QUERIES) && !g_queue_is_empty(query->servers); i++) + { + gfire_game_query_server *server = g_queue_pop_tail(query->servers); + query->cur_servers = g_list_append(query->cur_servers, server); + query->driver->query(gfire_game_server_apply_query_port(query, server->server), query->full_query, p_socket); + + // Timeout value + GTimeVal gtv; + g_get_current_time(>v); + server->timeout = (gtv.tv_sec * 1000) + (gtv.tv_usec / 1000); + } + + // Start reading on the socket + query->prpl_inpa = purple_input_add(p_socket, PURPLE_INPUT_READ, gfire_server_query_read, query); +} + +gboolean gfire_server_query_start(gfire_server_query *p_query, const gchar *p_type, gboolean p_full, + gfire_server_query_callback p_callback, gpointer p_data) +{ + if(!p_query || !p_type || !p_callback || p_query->prpl_data || p_query->prpl_inpa) + return FALSE; + + int i = 0; + for(; registeredDrivers[i].proto; i++) + { + if(g_strcmp0(registeredDrivers[i].proto, p_type) == 0) + { + p_query->driver = registeredDrivers[i].driver; + p_query->query_port = registeredDrivers[i].query_port; + p_query->port_offset = registeredDrivers[i].port_offset; + break; + } + } + if(!p_query->driver) + return FALSE; + + p_query->full_query = p_full; + + p_query->callback = p_callback; + p_query->callback_data = p_data; + + p_query->prpl_data = purple_network_listen_range(0, 0, SOCK_DGRAM, gfire_server_query_listen, p_query); + return TRUE; +} + +gboolean gfire_server_query_supports(const gchar *p_type) +{ + if(!p_type) + return FALSE; + + int i = 0; + for(; registeredDrivers[i].proto; i++) + { + if(g_strcmp0(registeredDrivers[i].proto, p_type) == 0) + return TRUE; + } + return FALSE; +} diff -Nru gfire-0.8.3/src/gf_server_query_gamespy2.c gfire-0.9.4/src/gf_server_query_gamespy2.c --- gfire-0.8.3/src/gf_server_query_gamespy2.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_gamespy2.c 2011-03-14 20:20:24.000000000 +0000 @@ -0,0 +1,300 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +typedef struct _gfire_sq_gamespy2_player +{ + gchar *name; + gint score; + gint ping; + gint deaths; + gint kills; + gint team; +} gfire_sq_gamespy2_player; + +typedef struct _gfire_sq_gamespy2_data +{ + GData *info; + GSList *players; +} gfire_sq_gamespy2_data; + +// Prototypes +static void gfire_sq_gamespy2_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_gamespy2_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_gamespy2_details(gfire_game_server *p_server); +static void gfire_sq_gamespy2_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_gamespy2_driver = +{ + gfire_sq_gamespy2_query, + gfire_sq_gamespy2_parse, + gfire_sq_gamespy2_details, + gfire_sq_gamespy2_free_server, + 3 +}; + +static void gfire_sq_gamespy2_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + static guint8 query[] = { 0xfe, 0xfd, 0x00, 'G', 'F', 'S', 'Q', 0xff, 0x00, 0x00 }; + if(p_full) + { + query[8] = 0xff; + query[9] = 0xff; + } + else + { + query[8] = 0x00; + query[9] = 0x00; + } + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, query, 10, 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static guint gfire_sq_gamespy2_parseInfo(gfire_sq_gamespy2_data *p_gsdata, const unsigned char *p_data, guint p_len) +{ + guint pos = 0; + + g_datalist_init(&p_gsdata->info); + + while(pos < p_len) + { + int keylen = strlen((const char*)p_data + pos); + if(!keylen) + break; + + const char *key = (const char*)p_data + pos; + + pos += keylen + 1; + const char *value = (const char*)p_data + pos; + + pos += strlen((const char*)p_data + pos) + 1; + + g_datalist_set_data_full(&p_gsdata->info, key, g_strdup(value), g_free); + } + + return pos + 2; +} + +static guint gfire_sq_gamespy2_parsePlayers(gfire_sq_gamespy2_data *p_gsdata, const unsigned char *p_data, guint p_len) +{ + guint pos = 1; + guchar playercount = *p_data; + + // Read keys + GPtrArray *keys = g_ptr_array_new(); + while(pos < p_len) + { + int keylen = strlen((const char*)p_data + pos); + if(!keylen) + break; + + g_ptr_array_add(keys, (unsigned char*)p_data + pos); + + pos += keylen + 1; + } + pos++; + + // Read players + gfire_sq_gamespy2_player *player = NULL; + int cur = 0; + for(; (pos < p_len) && (cur < playercount); cur++) + { + player = g_new0(gfire_sq_gamespy2_player, 1); + + int key = 0; + while(pos < p_len) + { + const char *value = (const char*)p_data + pos; + pos += strlen(value) + 1; + + if(g_strcmp0(g_ptr_array_index(keys, key), "player_") == 0) + player->name = g_strdup(value); + else if(g_strcmp0(g_ptr_array_index(keys, key), "score_") == 0) + sscanf(value, "%d", &player->score); + else if(g_strcmp0(g_ptr_array_index(keys, key), "deaths_") == 0) + sscanf(value, "%d", &player->deaths); + else if(g_strcmp0(g_ptr_array_index(keys, key), "ping_") == 0) + sscanf(value, "%d", &player->ping); + else if(g_strcmp0(g_ptr_array_index(keys, key), "team_") == 0) + sscanf(value, "%d", &player->team); + else if(g_strcmp0(g_ptr_array_index(keys, key), "kills_") == 0) + sscanf(value, "%d", &player->kills); + + key = (key + 1) % keys->len; + if(key == 0) + break; + } + + p_gsdata->players = g_slist_append(p_gsdata->players, player); + } + + g_ptr_array_free(keys, TRUE); + + return pos + 2; +} + +static gboolean gfire_sq_gamespy2_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + // Check header + if(p_data[0] != 0 || memcmp(p_data + 1, "GFSQ", 4) != 0) + return FALSE; + + p_server->data = g_new0(gfire_game_server_data, 1); + p_server->data->driver = &gf_sq_gamespy2_driver; + p_server->data->ping = p_ping; + + gfire_sq_gamespy2_data *gsdata = p_server->data->proto_data = g_new0(gfire_sq_gamespy2_data, 1); + + // Parse info + guint offset = 5; + offset += gfire_sq_gamespy2_parseInfo(gsdata, p_data + offset, p_len - offset); + + if(g_datalist_get_data(&gsdata->info, "hostname")) + p_server->data->name = g_strdup(g_datalist_get_data(&gsdata->info, "hostname")); + if(g_datalist_get_data(&gsdata->info, "mapname")) + p_server->data->map = g_strdup(g_datalist_get_data(&gsdata->info, "mapname")); + if(g_datalist_get_data(&gsdata->info, "numplayers")) + sscanf(g_datalist_get_data(&gsdata->info, "numplayers"), "%u", &p_server->data->players); + if(g_datalist_get_data(&gsdata->info, "maxplayers")) + sscanf(g_datalist_get_data(&gsdata->info, "maxplayers"), "%u", &p_server->data->max_players); + + if(p_full) + { + // Parse players + offset += gfire_sq_gamespy2_parsePlayers(gsdata, p_data + offset, p_len - offset); + } + + return FALSE; +} + +static gchar *gfire_sq_gamespy2_fixed_len_string(const gchar *p_str, guint p_len) +{ + if(!p_str) + return NULL; + + // Pad the string with spaces if necessary + if(g_utf8_strlen(p_str, -1) < p_len) + { + gchar *str = g_strnfill(p_len + strlen(p_str) - g_utf8_strlen(p_str, -1), ' '); + memcpy(str, p_str, strlen(p_str)); + return str; + } + // Copy max p_len bytes + else if(g_utf8_strlen(p_str, -1) > p_len) + { + const gchar *end = g_utf8_offset_to_pointer(p_str, p_len - 3); + gchar *str = g_strnfill(end - p_str + 3, '.'); + memcpy(str, p_str, end - p_str); + return str; + } + else + return g_strdup(p_str); +} + +static void gfire_sq_gamespy2_details_vars(GQuark p_key, gpointer p_data, gpointer p_udata) +{ + gchar *escaped = gfire_escape_html((gchar*)p_data); + g_string_append_printf((GString*)p_udata, "%s: %s
", g_quark_to_string(p_key), escaped); + g_free(escaped); +} + +static gchar *gfire_sq_gamespy2_details(gfire_game_server *p_server) +{ + GString *str = g_string_new(NULL); + + gfire_sq_gamespy2_data *data = (gfire_sq_gamespy2_data*)p_server->data->proto_data; + + // General server infos + g_string_append(str, _("General Server Details:
")); + // Server Name + gchar *escaped = gfire_escape_html(p_server->data->name); + g_string_append_printf(str, _("Server Name: %s
"), escaped); + g_free(escaped); + // Players + g_string_append_printf(str, _("Players: %u/%u
"), p_server->data->players, p_server->data->max_players); + // Map + escaped = gfire_escape_html(p_server->data->map); + g_string_append_printf(str, _("Map: %s
"), escaped); + g_free(escaped); + // Password secured + g_string_append_printf(str, _("Password secured: %s
"), (g_strcmp0("True", g_datalist_get_data(&data->info, "password")) == 0) || + (g_strcmp0("1", g_datalist_get_data(&data->info, "password")) == 0) + ? _("Yes") : _("No")); + // Game Type + g_string_append_printf(str, _("Game Type: %s
"), g_datalist_get_data(&data->info, "gametype") ? + (gchar*)g_datalist_get_data(&data->info, "gametype") : _("N/A")); + // Version + g_string_append_printf(str, _("Version: %s"), g_datalist_get_data(&data->info, "gamever") ? + (gchar*)g_datalist_get_data(&data->info, "gamever") : _("N/A")); + + // Players + g_string_append(str, _("

Players:
Name Score Ping
")); + GSList *cur = data->players; + while(cur) + { + gfire_sq_gamespy2_player *player = (gfire_sq_gamespy2_player*)cur->data; + + gchar *unescaped = gfire_sq_gamespy2_fixed_len_string(player->name, 16); + gchar *name = gfire_escape_html(unescaped); + g_free(unescaped); + + g_string_append_printf(str, "%s %-10d %d
", name, player->score, player->ping); + + g_free(name); + + cur = g_slist_next(cur); + } + + // Other server rules + g_string_append(str, _("
All Server Info:
")); + g_datalist_foreach(&data->info, gfire_sq_gamespy2_details_vars, str); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_gamespy2_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + { + gfire_sq_gamespy2_data *data = (gfire_sq_gamespy2_data*)p_server->data->proto_data; + + g_datalist_clear(&data->info); + + while(data->players) + { + gfire_sq_gamespy2_player *player = (gfire_sq_gamespy2_player*)data->players->data; + g_free(player->name); + g_free(player); + + data->players = g_slist_delete_link(data->players, data->players); + } + + g_free(data); + } +} diff -Nru gfire-0.8.3/src/gf_server_query_gamespy3.c gfire-0.9.4/src/gf_server_query_gamespy3.c --- gfire-0.8.3/src/gf_server_query_gamespy3.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_gamespy3.c 2011-03-14 20:20:17.000000000 +0000 @@ -0,0 +1,143 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +typedef struct _gfire_sq_gamespy3_player +{ + gchar *name; + gint score; + gint ping; + gint deaths; + gint kills; + gint team; +} gfire_sq_gamespy3_player; + +typedef struct _gfire_sq_gamespy3_data +{ + // Query handling + gint32 challenge; + + // Extended data + GData *info; + GSList *players; +} gfire_sq_gamespy3_data; + +// Prototypes +static void gfire_sq_gamespy3_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_gamespy3_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_gamespy3_details(gfire_game_server *p_server); +static void gfire_sq_gamespy3_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_gamespy3_driver = +{ + gfire_sq_gamespy3_query, + gfire_sq_gamespy3_parse, + gfire_sq_gamespy3_details, + gfire_sq_gamespy3_free_server, + 3 +}; + +static void gfire_sq_gamespy3_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + static const guint8 challengeQuery[] = { 0xfe, 0xfd, 0x09, 'G', 'F', 'S', 'Q' }; + static guint8 dataQuery[] = { 0xfe, 0xfd, 0x00, 'G', 'F', 'S', 'Q', + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, + 0x01}; + + int len; + const guint8 *query; + if(!p_server->data) + { + len = sizeof(challengeQuery); + query = challengeQuery; + } + else + { + gfire_sq_gamespy3_data *data = (gfire_sq_gamespy3_data*)p_server->data->proto_data; + memcpy(dataQuery + 7, &data->challenge, 4); + + dataQuery[12] = p_full ? 0xff : 0x00; + dataQuery[13] = p_full ? 0xff : 0x00; + + len = sizeof(dataQuery); + query = dataQuery; + } + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, query, len, 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static gboolean gfire_sq_gamespy3_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + if(p_len < 12) + return FALSE; + + if(!p_server->data) + { + if(*p_data != 0x09 || memcmp(p_data + 1, "GFSQ", 4) != 0) + return FALSE; + + p_server->data = g_new0(gfire_game_server_data, 1); + p_server->data->driver = &gf_sq_gamespy3_driver; + p_server->data->ping = p_ping; + + gfire_sq_gamespy3_data *gsdata = p_server->data->proto_data = g_new0(gfire_sq_gamespy3_data, 1); + + sscanf((const char*)p_data + 5, "%d", &gsdata->challenge); + gsdata->challenge = GINT32_TO_BE(gsdata->challenge); + + return TRUE; + } + + if(*p_data != 0x00 || memcmp(p_data + 1, "GFSQsplitnum\0", 13) != 0) + return FALSE; + + guint offset = 14; + + guint8 index = *(p_data + offset) & 0x7f; + guint8 final = *(p_data + offset) & 0x80; + offset += 2; + // TODO: Handle split packets + + return FALSE; +} + +static gchar *gfire_sq_gamespy3_details(gfire_game_server *p_server) +{ + return NULL; +} + +static void gfire_sq_gamespy3_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + { + gfire_sq_gamespy3_data *data = (gfire_sq_gamespy3_data*)p_server->data->proto_data; + + g_free(data); + } +} diff -Nru gfire-0.8.3/src/gf_server_query_gamespy.c gfire-0.9.4/src/gf_server_query_gamespy.c --- gfire-0.8.3/src/gf_server_query_gamespy.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_gamespy.c 2011-03-14 20:18:36.000000000 +0000 @@ -0,0 +1,407 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +#define GFSQ_GAMESPY_STAGE_INFO 1 +#define GFSQ_GAMESPY_STAGE_RULES 2 +#define GFSQ_GAMESPY_STAGE_PLAYERS 3 + +typedef struct _gfire_sq_gamespy_player +{ + gchar *name; + gint frags; + gint ping; + gint16 team; + gchar *mesh; + gchar *skin; + gchar *face; + gboolean ngsecret; +} gfire_sq_gamespy_player; + +typedef struct _gfire_sq_gamespy_data +{ + // Query handling + guint8 query_stage; + guint query_id; + guint cur_fragments; + guint fragments; + + // Extended data + GData *info; + GData *rules; + GData *player_data; + GSList *players; +} gfire_sq_gamespy_data; + +// Prototypes +static void gfire_sq_gamespy_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_gamespy_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_gamespy_details(gfire_game_server *p_server); +static void gfire_sq_gamespy_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_gamespy_driver = +{ + gfire_sq_gamespy_query, + gfire_sq_gamespy_parse, + gfire_sq_gamespy_details, + gfire_sq_gamespy_free_server, + 3 +}; + +static void gfire_sq_gamespy_data_free(gfire_sq_gamespy_data *p_data) +{ + g_datalist_clear(&p_data->info); + g_datalist_clear(&p_data->rules); + g_datalist_clear(&p_data->player_data); + + while(p_data->players) + { + gfire_sq_gamespy_player *player = (gfire_sq_gamespy_player*)p_data->players->data; + g_free(player->name); + g_free(player->mesh); + g_free(player->skin); + g_free(player->face); + g_free(player); + p_data->players = g_slist_delete_link(p_data->players, p_data->players); + } + g_free(p_data); +} + +static void gfire_sq_gamespy_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + static const gchar info_query[] = "\\info\\"; + static const gchar rules_query[] = "\\rules\\"; + static const gchar players_query[] = "\\players\\"; + const gchar *query = NULL; + + if(!p_server->data) + query = info_query; + else + { + gfire_sq_gamespy_data *data = (gfire_sq_gamespy_data*)p_server->data->proto_data; + if(data->query_stage == GFSQ_GAMESPY_STAGE_RULES && !data->query_id) + query = rules_query; + else if(data->query_stage == GFSQ_GAMESPY_STAGE_PLAYERS && !data->query_id) + query = players_query; + else + return; + } + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, query, strlen(query), 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static gboolean gfire_sq_gamespy_parse_chunk(gfire_sq_gamespy_data *p_sq_data, GData **p_datalist, + const unsigned char *p_data, guint p_len, gboolean *p_done) +{ + if(*p_data != '\\') + return FALSE; + + // Make sure the data is zero-terminated + gchar *strdata = g_strndup((const gchar*)p_data, p_len); + + // Parse all key/value pairs + gboolean final = FALSE; + gchar **chunks = g_strsplit(strdata + 1, "\\", -1); + g_free(strdata); + gchar **cur = chunks; + while(*cur) + { + gchar *key = *cur++; + if(g_strcmp0(key, "final") == 0) + final = TRUE; + else if(!strlen(key)) + break; + + gchar *value = *cur++; + if(!value) + break; + + g_datalist_set_data_full(p_datalist, key, g_strdup(gfire_strip_invalid_utf8(value)), g_free); + } + g_strfreev(chunks); + + // Get query id and fragment number + gchar *queryid = g_datalist_get_data(p_datalist, "queryid"); + if(!queryid) + return FALSE; + + guint id, fragment; + if(sscanf(queryid, "%u.%u", &id, &fragment) != 2) + return FALSE; + + if(p_sq_data->query_id && p_sq_data->query_id != id) + return FALSE; + else + p_sq_data->query_id = id; + + p_sq_data->cur_fragments++; + if(final) + p_sq_data->fragments = fragment; + + if(p_sq_data->cur_fragments == p_sq_data->fragments) + *p_done = TRUE; + + return TRUE; +} + +static gboolean gfire_sq_gamespy_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + if(!p_server->data) + { + gfire_sq_gamespy_data *data = g_new0(gfire_sq_gamespy_data, 1); + data->query_stage = GFSQ_GAMESPY_STAGE_INFO; + g_datalist_init(&data->info); + g_datalist_init(&data->rules); + g_datalist_init(&data->player_data); + + p_server->data = g_new0(gfire_game_server_data, 1); + p_server->data->driver = &gf_sq_gamespy_driver; + p_server->data->proto_data = data; + p_server->data->ping = p_ping; + } + + gfire_sq_gamespy_data *data = (gfire_sq_gamespy_data*)p_server->data->proto_data; + + gboolean done = FALSE; + if(data->query_stage == GFSQ_GAMESPY_STAGE_INFO) + { + if(!gfire_sq_gamespy_parse_chunk(data, &data->info, p_data, p_len, &done)) + { + gfire_sq_gamespy_data_free(data); + g_free(p_server->data); + p_server->data = NULL; + return FALSE; + } + + if(done) + { + p_server->data->name = gfire_strip_character_range(g_strdup(g_datalist_get_data(&data->info, "hostname")), 0x01, 0x1f); + p_server->data->map = g_strdup(g_datalist_get_data(&data->info, "mapname")); + p_server->data->ping = p_ping; + if(g_datalist_get_data(&data->info, "numplayers")) + sscanf(g_datalist_get_data(&data->info, "numplayers"), "%u", &p_server->data->players); + if(g_datalist_get_data(&data->info, "maxplayers")) + sscanf(g_datalist_get_data(&data->info, "maxplayers"), "%u", &p_server->data->max_players); + + // Go on with requesting if desired + if(p_full) + { + data->query_stage = GFSQ_GAMESPY_STAGE_RULES; + data->query_id = 0; + data->cur_fragments = 0; + data->fragments = 0; + return TRUE; + } + } + else + return TRUE; + } + else if(data->query_stage == GFSQ_GAMESPY_STAGE_RULES) + { + if(!gfire_sq_gamespy_parse_chunk(data, &data->rules, p_data, p_len, &done)) + { + gfire_sq_gamespy_data_free(data); + g_free(p_server->data->name); + g_free(p_server->data->map); + g_free(p_server->data); + p_server->data = NULL; + return FALSE; + } + + if(done) + { + g_datalist_set_data_full(&data->rules, "queryid", NULL, NULL); + g_datalist_set_data_full(&data->rules, "final", NULL, NULL); + + data->query_stage = GFSQ_GAMESPY_STAGE_PLAYERS; + data->query_id = 0; + data->cur_fragments = 0; + data->fragments = 0; + return TRUE; + } + else + return TRUE; + } + else if(data->query_stage == GFSQ_GAMESPY_STAGE_PLAYERS) + { + if(!gfire_sq_gamespy_parse_chunk(data, &data->player_data, p_data, p_len, &done)) + { + gfire_sq_gamespy_data_free(data); + g_free(p_server->data->name); + g_free(p_server->data->map); + g_free(p_server->data); + p_server->data = NULL; + return FALSE; + } + + if(!done) + return TRUE; + else + { + int i; + for(i = 0; i < p_server->data->players; i++) + { + gfire_sq_gamespy_player *player = g_new0(gfire_sq_gamespy_player, 1); + + gchar tmp[30]; + const gchar *value; + snprintf(tmp, 30, "player_%d", i); + player->name = gfire_strip_character_range(g_strdup(g_datalist_get_data(&data->player_data, tmp) ? + g_datalist_get_data(&data->player_data, tmp) : _("N/A")), 0x01, 0x1f); + + snprintf(tmp, 30, "frags_%d", i); + value = g_datalist_get_data(&data->player_data, tmp); + if(value) + sscanf(value, "%d", &player->frags); + + snprintf(tmp, 30, "ping_%d", i); + value = g_datalist_get_data(&data->player_data, tmp); + if(value) + sscanf(value, "%d", &player->ping); + + snprintf(tmp, 30, "team_%d", i); + value = g_datalist_get_data(&data->player_data, tmp); + if(value) + sscanf(value, "%hd", &player->team); + + snprintf(tmp, 30, "mesh_%d", i); + player->mesh = g_strdup(g_datalist_get_data(&data->player_data, tmp) ? + g_datalist_get_data(&data->player_data, tmp) : _("N/A")); + + snprintf(tmp, 30, "skin_%d", i); + player->skin = g_strdup(g_datalist_get_data(&data->player_data, tmp) ? + g_datalist_get_data(&data->player_data, tmp) : _("N/A")); + + snprintf(tmp, 30, "face_%d", i); + player->face = g_strdup(g_datalist_get_data(&data->player_data, tmp) ? + g_datalist_get_data(&data->player_data, tmp) : _("N/A")); + + snprintf(tmp, 30, "ngsecret_%d", i); + value = g_datalist_get_data(&data->player_data, tmp); + if(value && g_strcmp0(value, "true") == 0) + player->ngsecret = TRUE; + + data->players = g_slist_append(data->players, player); + } + } + } + + return FALSE; +} + +static gchar *gfire_sq_gamespy_fixed_len_string(const gchar *p_str, guint p_len) +{ + if(!p_str) + return NULL; + + // Pad the string with spaces if necessary + if(g_utf8_strlen(p_str, -1) < p_len) + { + gchar *str = g_strnfill(p_len + strlen(p_str) - g_utf8_strlen(p_str, -1), ' '); + memcpy(str, p_str, strlen(p_str)); + return str; + } + // Copy max p_len bytes + else if(g_utf8_strlen(p_str, -1) > p_len) + { + const gchar *end = g_utf8_offset_to_pointer(p_str, p_len - 3); + gchar *str = g_strnfill(end - p_str + 3, '.'); + memcpy(str, p_str, end - p_str); + return str; + } + else + return g_strdup(p_str); +} + +static void gfire_sq_gamespy_details_vars(GQuark p_key, gpointer p_data, gpointer p_udata) +{ + gchar *escaped = gfire_escape_html((gchar*)p_data); + g_string_append_printf((GString*)p_udata, "%s: %s
", g_quark_to_string(p_key), escaped); + g_free(escaped); +} + +static gchar *gfire_sq_gamespy_details(gfire_game_server *p_server) +{ + GString *str = g_string_new(NULL); + + gfire_sq_gamespy_data *data = (gfire_sq_gamespy_data*)p_server->data->proto_data; + + // General server infos + g_string_append(str, _("General Server Details:
")); + // Server Name + gchar *escaped = gfire_escape_html(p_server->data->name); + g_string_append_printf(str, _("Server Name: %s
"), escaped); + g_free(escaped); + // Players + g_string_append_printf(str, _("Players: %u/%u
"), p_server->data->players, p_server->data->max_players); + // Map + escaped = gfire_escape_html(p_server->data->map); + g_string_append_printf(str, _("Map: %s
"), escaped); + g_free(escaped); + // Password secured + g_string_append_printf(str, _("Password secured: %s
"), (g_strcmp0("True", g_datalist_get_data(&data->rules, "password")) == 0) || + (g_strcmp0("1", g_datalist_get_data(&data->rules, "password")) == 0) + ? _("Yes") : _("No")); + // Game Type + g_string_append_printf(str, _("Game Type: %s
"), g_datalist_get_data(&data->info, "gametype") ? + (gchar*)g_datalist_get_data(&data->info, "gametype") : _("N/A")); + // Version + g_string_append_printf(str, _("Version: %s"), g_datalist_get_data(&data->info, "gamever") ? + (gchar*)g_datalist_get_data(&data->info, "gamever") : _("N/A")); + + // Players + g_string_append(str, _("

Players:
Name Frags Ping
")); + GSList *cur = data->players; + while(cur) + { + gfire_sq_gamespy_player *player = (gfire_sq_gamespy_player*)cur->data; + + gchar *unescaped = gfire_sq_gamespy_fixed_len_string(player->name, 16); + gchar *name = gfire_escape_html(unescaped); + g_free(unescaped); + + g_string_append_printf(str, "%s %-10d %d
", name, player->frags, player->ping); + + g_free(name); + + cur = g_slist_next(cur); + } + + // Other server rules + g_string_append(str, _("
All Server Rules:
")); + g_datalist_foreach(&data->rules, gfire_sq_gamespy_details_vars, str); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_gamespy_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + gfire_sq_gamespy_data_free((gfire_sq_gamespy_data*)p_server->data->proto_data); +} diff -Nru gfire-0.8.3/src/gf_server_query.h gfire-0.9.4/src/gf_server_query.h --- gfire-0.8.3/src/gf_server_query.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query.h 2011-03-14 20:20:42.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_SERVER_QUERY_H +#define _GF_SERVER_QUERY_H + +#include "gf_base.h" + +#define GFSQ_MAX_QUERIES 20 + +typedef struct _gfire_server_query_driver gfire_server_query_driver; + +typedef struct _gfire_game_server_data +{ + guint32 players; + guint32 max_players; + + guint16 ping; + + gchar *name; + gchar *map; + + // Storage for additional data like player stats, rules etc. (depending on the protocol) + const gfire_server_query_driver *driver; + gpointer proto_data; +} gfire_game_server_data; + +typedef struct _gfire_game_server +{ + //guint32 game; + + guint32 ip; + guint16 port; + guint16 query_port; + + gfire_game_server_data *data; +} gfire_game_server; + +typedef struct _gfire_game_query_server +{ + gfire_game_server *server; + gulong timeout; + gpointer p_data; +} gfire_game_query_server; + +typedef void (*gfire_sq_driver_query)(gfire_game_server *p_server, gboolean p_full, int p_socket); +typedef gboolean (*gfire_sq_driver_parse)(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, const unsigned char *p_data, guint p_len); +typedef gchar* (*gfire_sq_driver_server_details)(gfire_game_server *p_server); +typedef void (*gfire_sq_driver_free_server)(gfire_game_server *p_server); + +struct _gfire_server_query_driver +{ + gfire_sq_driver_query query; + gfire_sq_driver_parse parse; + gfire_sq_driver_server_details details; + gfire_sq_driver_free_server free_server; + guint16 timeout; +}; + +typedef void (*gfire_server_query_callback)(gfire_game_server *p_server, gpointer p_server_data, gpointer p_data); + +typedef struct _gfire_server_query +{ + // Socket + PurpleNetworkListenData *prpl_data; + int socket; + guint prpl_inpa; + + // Servers + gboolean full_query; + GQueue *servers; + GList *cur_servers; + guint timeout; + + // Driver + const gfire_server_query_driver *driver; + guint16 query_port; + guint16 port_offset; + + // Callback + gfire_server_query_callback callback; + gpointer callback_data; +} gfire_server_query; + +// Creation/freeing +gfire_server_query *gfire_server_query_create(); +void gfire_server_query_free(gfire_server_query *p_query); + +// Game server management +gchar *gfire_game_server_details(gfire_game_server *p_server); +void gfire_game_server_free(gfire_game_server *p_server); + +// Queries +void gfire_server_query_add_server(gfire_server_query *p_query, guint32 p_ip, guint16 p_port, gpointer p_data); +gboolean gfire_server_query_start(gfire_server_query *p_query, const gchar *p_type, gboolean p_full, + gfire_server_query_callback p_callback, gpointer p_data); + +// Capabilities +gboolean gfire_server_query_supports(const gchar *p_type); + +#endif // _GF_SERVER_QUERY_H diff -Nru gfire-0.8.3/src/gf_server_query_quake.c gfire-0.9.4/src/gf_server_query_quake.c --- gfire-0.8.3/src/gf_server_query_quake.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_quake.c 2011-03-14 20:20:09.000000000 +0000 @@ -0,0 +1,459 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +typedef struct _gfire_sq_quake_player +{ + gint score, ping; + gchar *name; +} gfire_sq_quake_player; + +typedef struct _gfire_sq_quake_data +{ + GData *info; + GSList *players; +} gfire_sq_quake_data; + +static const struct { gchar ch; const gchar *hex; } q3codes[] = +{ + { '0', "000000" }, { '1', "DA0120" }, { '2', "00B906" }, { '3', "E8FF19" }, + { '4', "170BDB" }, { '5', "23C2C6" }, { '6', "E201DB" }, { '7', "FFFFFF" }, + { '8', "CA7C27" }, { '9', "757575" }, { 'a', "EB9F53" }, { 'b', "106F59" }, + { 'c', "5A134F" }, { 'd', "035AFF" }, { 'e', "681EA7" }, { 'f', "5097C1" }, + { 'g', "BEDAC4" }, { 'h', "024D2C" }, { 'i', "7D081B" }, { 'j', "90243E" }, + { 'k', "743313" }, { 'l', "A7905E" }, { 'm', "555C26" }, { 'n', "AEAC97" }, + { 'o', "C0BF7F" }, { 'p', "000000" }, { 'q', "DA0120" }, { 'r', "00B906" }, + { 's', "E8FF19" }, { 't', "170BDB" }, { 'u', "23C2C6" }, { 'v', "E201DB" }, + { 'w', "FFFFFF" }, { 'x', "CA7C27" }, { 'y', "757575" }, { 'z', "CC8034" }, + { '/', "DBDF70" }, { '*', "BBBBBB" }, { '-', "747228" }, { '+', "993400" }, + { '?', "670504" }, { '@', "623307" }, { 0, NULL } +}; + +// Prototypes +static void gfire_sq_quake_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_quake_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_quake_details(gfire_game_server *p_server); +static void gfire_sq_quake_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_quake_driver = +{ + gfire_sq_quake_query, + gfire_sq_quake_parse, + gfire_sq_quake_details, + gfire_sq_quake_free_server, + 3 +}; + +static void gfire_sq_quake_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + if(p_server->data) + return; + + static const unsigned char query[] = + { 0xff, 0xff, 0xff, 0xff, 'g', 'e', 't', 's', 't', 'a', 't', 'u', 's', 0x0a }; + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, query, 14, 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static gchar *gfire_sq_quake_read_info_chunk(const unsigned char *p_data, guint p_len, guint *p_offset) +{ + if(*(p_data + *p_offset) != '\\') + return NULL; + (*p_offset)++; + + const unsigned char *start = p_data + *p_offset; + while(*p_offset < p_len && *(p_data + *p_offset) != '\\' && *(p_data + *p_offset) != '\n') + (*p_offset)++; + + return g_strndup((gchar*)start, (p_data + *p_offset) - start); +} + +static gboolean gfire_sq_quake_parse_info(gfire_sq_quake_data *p_qdata, const unsigned char *p_data, guint p_len, guint *p_offset) +{ + gchar *key = NULL; + while((key = gfire_sq_quake_read_info_chunk(p_data, p_len, p_offset))) + { + gchar *value = gfire_sq_quake_read_info_chunk(p_data, p_len, p_offset); + if(!value) + return FALSE; + + g_datalist_set_data_full(&p_qdata->info, key, value, g_free); + g_free(key); + } + + if(*(p_data + *p_offset) == '\n') + return TRUE; + else + return FALSE; +} + +static gchar *gfire_sq_quake_read_player_chunk(const unsigned char *p_data, guint p_len, guint *p_offset) +{ + if(*(p_data + *p_offset) != '\n') + return NULL; + (*p_offset)++; + + const unsigned char *start = p_data + *p_offset; + while(*p_offset < p_len && *(p_data + *p_offset) != '\n') + (*p_offset)++; + + return g_strndup((gchar*)start, (p_data + *p_offset) - start); +} + +static gchar **gfire_sq_quake_split_player_chunk(const gchar *p_chunk) +{ + gchar **ret = g_malloc0(sizeof(gchar*)); + + guint values = 0; + guint pos = 0; + gchar delim; + + GString *value = NULL; + while(p_chunk[pos] != 0) + { + value = g_string_new(NULL); + + if(p_chunk[pos] == '"') + { + pos++; + delim = '"'; + } + else + delim = ' '; + + while(p_chunk[pos] != 0 && p_chunk[pos] != delim) + { + g_string_append_c(value, p_chunk[pos]); + pos++; + } + + values++; + ret = g_realloc(ret, (values + 1) * sizeof(gchar*)); + ret[values - 1] = g_string_free(value, FALSE); + ret[values] = NULL; + + if(p_chunk[pos] == 0) + { + if(delim == '"') + { + g_strfreev(ret); + return NULL; + } + else + return ret; + } + + pos++; + } + + return ret; +} + +static gboolean gfire_sq_quake_parse_players(gfire_sq_quake_data *p_qdata, const unsigned char *p_data, guint p_len, guint *p_offset) +{ + gchar *chunk = NULL; + while(*p_offset < p_len && (chunk = gfire_sq_quake_read_player_chunk(p_data, p_len, p_offset))) + { + gchar **player_chunks = gfire_sq_quake_split_player_chunk(chunk); + g_free(chunk); + + if(!player_chunks) + { + while(p_qdata->players) + { + gfire_sq_quake_player *player = (gfire_sq_quake_player*)p_qdata->players->data; + g_free(player->name); + g_free(player); + p_qdata->players = g_slist_delete_link(p_qdata->players, p_qdata->players); + } + return FALSE; + } + + if(g_strv_length(player_chunks) >= 3) + { + gfire_sq_quake_player *player = g_malloc0(sizeof(gfire_sq_quake_player)); + p_qdata->players = g_slist_append(p_qdata->players, player); + + player->score = g_ascii_strtoll(player_chunks[0], NULL, 10); + player->ping = g_ascii_strtoll(player_chunks[1], NULL, 10); + player->name = g_strdup(player_chunks[2]); + } + + g_strfreev(player_chunks); + } + + return TRUE; +} + +static gboolean gfire_sq_quake_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + guint offset = 19; + + static const unsigned char respMagic[] = + { 0xff, 0xff, 0xff, 0xff, 's', 't', 'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 0x0a }; + if(memcmp(p_data, respMagic, 19) != 0) + return FALSE; + + gfire_sq_quake_data *data = g_malloc0(sizeof(gfire_sq_quake_data)); + + // Parse general server infos + g_datalist_init(&data->info); + if(!gfire_sq_quake_parse_info(data, p_data, p_len, &offset)) + { + g_datalist_clear(&data->info); + g_free(data); + return FALSE; + } + + // Parse players + if(!gfire_sq_quake_parse_players(data, p_data, p_len, &offset)) + { + g_datalist_clear(&data->info); + g_free(data); + return FALSE; + } + + // Parsing done, store default values + p_server->data = g_malloc0(sizeof(gfire_game_server_data)); + + p_server->data->driver = &gf_sq_quake_driver; + p_server->data->proto_data = data; + + p_server->data->name = gfire_remove_quake3_color_codes(g_datalist_get_data(&data->info, "sv_hostname")); + p_server->data->map = g_strdup(g_datalist_get_data(&data->info, "mapname")); + const gchar *max_players = g_datalist_get_data(&data->info, "sv_maxclients"); + p_server->data->max_players = max_players ? g_ascii_strtoll(max_players, NULL, 10) : 0; + p_server->data->players = g_slist_length(data->players); + p_server->data->ping = p_ping; + + // No further queries + return FALSE; +} + +static gchar *gfire_sq_quake_color_codes_to_html(const gchar *p_str) +{ + if(!p_str) + return NULL; + + gchar **chunks = g_strsplit(p_str, "^", -1); + + GString *str = g_string_new(NULL); + int i = 0; + for(; i < g_strv_length(chunks); i++) + { + if(i > 0) + { + int j = 0; + while(q3codes[j].ch) + { + if(g_ascii_tolower(chunks[i][0]) == q3codes[j].ch) + { + g_string_append_printf(str, "%s", q3codes[j].hex, chunks[i] + 1); + break; + } + j++; + } + if(!q3codes[j].ch) + g_string_append(g_string_append_c(str, '^'), chunks[i]); + } + else + g_string_append(str, chunks[i]); + } + + g_strfreev(chunks); + return g_string_free(str, FALSE); +} + +static void gfire_sq_quake_details_vars(GQuark p_key, gpointer p_data, gpointer p_udata) +{ + GString *str = (GString*)p_udata; + gchar *value = gfire_sq_quake_color_codes_to_html((gchar*)p_data); + + g_string_append_printf(str, "%s: %s
", g_quark_to_string(p_key), value); + + g_free(value); +} + +static gchar *gfire_sq_quake_fixed_len_string(const gchar *p_str, guint p_len) +{ + if(!p_str) + return NULL; + + // Get the length without Quake 3 color codes + guint len = 0; + guint pos = 0; + while(p_str[pos] != 0) + { + if(p_str[pos] == '^') + { + guint i = 0; + while(q3codes[i].ch) + { + if(q3codes[i].ch == g_ascii_tolower(p_str[pos + 1])) + break; + i++; + } + if(q3codes[i].ch) + { + pos += 2; + continue; + } + } + pos++; + len++; + } + + // Pad the string with spaces if necessary + if(len < p_len) + { + gchar *str = g_strnfill(p_len + strlen(p_str) - len, ' '); + memcpy(str, p_str, strlen(p_str)); + return str; + } + // Copy max p_len (uncolored) bytes + else if(len > p_len) + { + GString *str = g_string_sized_new(p_len); + + pos = 0; + guint copied = 0; + while(p_str[pos] != 0 && copied < (p_len - 3)) + { + if(p_str[pos] == '^') + { + guint i = 0; + while(q3codes[i].ch) + { + if(q3codes[i].ch == g_ascii_tolower(p_str[pos + 1])) + break; + i++; + } + if(q3codes[i].ch) + { + pos += 2; + continue; + } + } + + g_string_append_c(str, p_str[pos]); + copied++; + pos++; + } + g_string_append(str, "..."); + + return g_string_free(str, FALSE); + } + else + return g_strdup(p_str); +} + +static gchar *gfire_sq_quake_details(gfire_game_server *p_server) +{ + GString *str = g_string_new(NULL); + + gfire_sq_quake_data *data = (gfire_sq_quake_data*)p_server->data->proto_data; + + // General server infos + g_string_append(str, _("General Server Details:
")); + // Server Name + if(g_datalist_get_data(&data->info, "sv_hostname")) + { + gchar *escaped = gfire_escape_html((gchar*)g_datalist_get_data(&data->info, "sv_hostname")); + gchar *name = gfire_sq_quake_color_codes_to_html(escaped); + g_free(escaped); + g_string_append_printf(str, _("Server Name: %s
"), name); + g_free(name); + } + // Players + g_string_append_printf(str, _("Players: %u/%u
"), p_server->data->players, p_server->data->max_players); + // Map + if(g_datalist_get_data(&data->info, "mapname")) + { + gchar *escaped = gfire_escape_html(g_datalist_get_data(&data->info, "mapname")); + g_string_append_printf(str, _("Map: %s
"), escaped); + g_free(escaped); + } + // Password secured + g_string_append_printf(str, _("Password secured: %s
"), + g_datalist_get_data(&data->info, "g_needpass") ? + ((((gchar*)g_datalist_get_data(&data->info, "g_needpass"))[0] != '0') ? _("Yes") : _("No")) : + _("No")); + // Game name + if(g_datalist_get_data(&data->info, "gamename")) + g_string_append_printf(str, _("Game Name: %s"), (gchar*)g_datalist_get_data(&data->info, "gamename")); + + // Players + g_string_append(str, _("

Players:
Name Score Ping
")); + GSList *cur = data->players; + while(cur) + { + gfire_sq_quake_player *player = (gfire_sq_quake_player*)cur->data; + + gchar *name = gfire_sq_quake_fixed_len_string(player->name, 16); + gchar *escaped = gfire_escape_html(name); + g_free(name); + gchar *name_html = gfire_sq_quake_color_codes_to_html(escaped); + g_free(escaped); + + gchar *score = g_strdup_printf("%u", player->score); + gchar *score_fixed = gfire_sq_quake_fixed_len_string(score, 10); + g_free(score); + + g_string_append_printf(str, "%s %s %u
", name_html, score_fixed, player->ping); + + g_free(score_fixed); + g_free(name_html); + + cur = g_slist_next(cur); + } + + // Other server rules + g_string_append(str, _("
All Server Rules:
")); + g_datalist_foreach(&data->info, gfire_sq_quake_details_vars, str); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_quake_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + { + gfire_sq_quake_data *data = (gfire_sq_quake_data*)p_server->data->proto_data; + g_datalist_clear(&data->info); + + while(data->players) + { + gfire_sq_quake_player *player = (gfire_sq_quake_player*)data->players->data; + g_free(player->name); + g_free(player); + data->players = g_slist_delete_link(data->players, data->players); + } + g_free(data); + } +} diff -Nru gfire-0.8.3/src/gf_server_query_savage.c gfire-0.9.4/src/gf_server_query_savage.c --- gfire-0.8.3/src/gf_server_query_savage.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_savage.c 2011-03-14 20:20:02.000000000 +0000 @@ -0,0 +1,347 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +typedef struct _gfire_sq_savage_data +{ + GData *info; + gchar **players; +} gfire_sq_savage_data; + +// Savage character based color code +static const struct { gchar ch; const gchar *hex; } savagecodes[] = +{ + // w would actually be FFFFFF, but that's not readable and commonly used by Savage + { 'w', "CCCCCC" }, { 'r', "FF4C4C" }, { 'y', "FFFF19" }, { 'g', "008000" }, + { 'k', "000000" }, { 'c', "00FFFF" }, { 'b', "4C4CFF" }, { 'm', "FF00FF" }, + { 0, NULL } +}; + +static const struct { gchar ch; const gchar *hex; } savagenumcodes[] = +{ + { '0', "00" }, { '1', "1C" }, { '2', "38" }, { '3', "54" }, + { '4', "70" }, { '5', "8C" }, { '6', "A8" }, { '7', "C4" }, + { '8', "E0" }, { '9', "FF" }, { 0, NULL } +}; + +// Prototypes +static void gfire_sq_savage_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_savage_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_savage_details(gfire_game_server *p_server); +static void gfire_sq_savage_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_savage_driver = +{ + gfire_sq_savage_query, + gfire_sq_savage_parse, + gfire_sq_savage_details, + gfire_sq_savage_free_server, + 3 +}; + +static void gfire_sq_savage_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + static guint8 query[] = { 0x9e, 0x4c, 0x23, 0x00, 0x00, 0xce, 'G', 'F', 'S', 'Q' }; + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, query, 10, 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static gchar *gfire_sq_savage_strip_color_codes(const gchar *p_string) +{ + GString *ret = g_string_new(NULL); + + int pos = 0; + while(p_string[pos]) + { + if(p_string[pos] == '^') + { + if(p_string[pos + 1]) + { + switch(p_string[pos + 1]) + { + case 'w': + case 'r': + case 'y': + case 'g': + case 'k': + case 'c': + case 'b': + case 'm': + pos += 2; + continue; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if(p_string[pos + 2] && g_ascii_isdigit(p_string[pos + 2]) && + p_string[pos + 3] && g_ascii_isdigit(p_string[pos + 3])) + { + pos += 4; + continue; + } + default: + g_string_append_c(ret, '^'); + break; + } + + pos++; + continue; + } + } + + g_string_append_c(ret, p_string[pos]); + pos++; + } + + return g_string_free(ret, FALSE); +} + +static gboolean gfire_sq_savage_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + static guint8 check[] = { 0x9e, 0x4c, 0x23, 0x00, 0x00, 0xcf }; + + if(p_len < 12 || memcmp(p_data, check, 6) != 0 || memcmp(p_data + 7, "GFSQ", 4) != 0) + return FALSE; + + p_server->data = g_new0(gfire_game_server_data, 1); + p_server->data->driver = &gf_sq_savage_driver; + p_server->data->ping = p_ping; + + gfire_sq_savage_data *gsdata = p_server->data->proto_data = g_new0(gfire_sq_savage_data, 1); + g_datalist_init(&gsdata->info); + + // Parse + const gchar *section = (const gchar*)p_data + 12; + guint offset = 0; + + while(offset < p_len) + { + gchar **chunks = g_strsplit(section, "\xff", -1); + gchar **pos = chunks; + while(*pos) + { + char **pieces = g_strsplit(*pos, "\xfe", -1); + if(g_strv_length(pieces) != 2) + { + g_strfreev(pieces); + pos++; + continue; + } + + if(g_strcmp0(pieces[0], "players") == 0) + gsdata->players = g_strsplit(pieces[1], "\n", -1); + else + g_datalist_set_data_full(&gsdata->info, pieces[0], g_strdup(pieces[1]), g_free); + + g_strfreev(pieces); + pos++; + } + g_strfreev(chunks); + + offset += strlen(section) + 1; + section = (const gchar*)p_data + offset + 2; // skip 0x00 and 0xff + } + + if(g_datalist_get_data(&gsdata->info, "name")) + p_server->data->name = gfire_sq_savage_strip_color_codes(g_datalist_get_data(&gsdata->info, "name")); + if(g_datalist_get_data(&gsdata->info, "world")) + p_server->data->map = g_strdup(g_datalist_get_data(&gsdata->info, "world")); + if(g_datalist_get_data(&gsdata->info, "cnum")) + sscanf(g_datalist_get_data(&gsdata->info, "cnum"), "%u", &p_server->data->players); + if(g_datalist_get_data(&gsdata->info, "cmax")) + sscanf(g_datalist_get_data(&gsdata->info, "cmax"), "%u", &p_server->data->max_players); + + return FALSE; +} + +static const gchar *gfire_sq_savage_color_hex_for_digit(gchar p_ch) +{ + int i = 0; + while(savagenumcodes[i].ch) + { + if(savagenumcodes[i].ch == p_ch) + return savagenumcodes[i].hex; + i++; + } + return NULL; +} + +static gchar *gfire_sq_savage_color_codes_to_html(const gchar *p_str) +{ + if(!p_str) + return NULL; + + gchar **chunks = g_strsplit(p_str, "^", -1); + + GString *str = g_string_new(NULL); + int i = 0; + for(; i < g_strv_length(chunks); i++) + { + if(i > 0) + { + int j = 0; + while(savagecodes[j].ch) + { + if(chunks[i][0] == savagecodes[j].ch) + { + g_string_append_printf(str, "%s", savagecodes[j].hex, chunks[i] + 1); + break; + } + j++; + } + if(!savagecodes[j].ch) + { + if(g_ascii_isdigit(chunks[i][0]) && + chunks[i][1] && g_ascii_isdigit(chunks[i][1]) && + chunks[i][2] && g_ascii_isdigit(chunks[i][2])) + { + g_string_append_printf(str, "%s", + gfire_sq_savage_color_hex_for_digit(chunks[i][0]), + gfire_sq_savage_color_hex_for_digit(chunks[i][1]), + gfire_sq_savage_color_hex_for_digit(chunks[i][2]), + chunks[i] + 3); + } + else + g_string_append(g_string_append_c(str, '^'), chunks[i]); + } + } + else + g_string_append(str, chunks[i]); + } + + g_strfreev(chunks); + return g_string_free(str, FALSE); +} + +static void gfire_sq_savage_details_vars(GQuark p_key, gpointer p_data, gpointer p_udata) +{ + if(g_strcmp0(g_quark_to_string(p_key), "players") != 0) + { + gchar *escaped = gfire_escape_html((gchar*)p_data); + gchar *html = gfire_sq_savage_color_codes_to_html(escaped); + g_free(escaped); + g_string_append_printf((GString*)p_udata, "%s: %s
", g_quark_to_string(p_key), html); + g_free(html); + } +} + +static gchar *gfire_sq_savage_details(gfire_game_server *p_server) +{ + GString *str = g_string_new(NULL); + gchar *escaped; + gchar *html; + + gfire_sq_savage_data *data = (gfire_sq_savage_data*)p_server->data->proto_data; + + // General server infos + g_string_append(str, _("General Server Details:
")); + + // Server Name + if(g_datalist_get_data(&data->info, "name")) + { + escaped = gfire_escape_html(g_datalist_get_data(&data->info, "name")); + html = gfire_sq_savage_color_codes_to_html(escaped); + g_free(escaped); + g_string_append_printf(str, _("Server Name: %s
"), html); + g_free(html); + } + else + g_string_append_printf(str, _("Server Name: %s
"), _("N/A")); + // Players + g_string_append_printf(str, _("Players: %u/%u
"), p_server->data->players, p_server->data->max_players); + // Map + escaped = gfire_escape_html(p_server->data->map); + g_string_append_printf(str, _("Map: %s
"), escaped); + g_free(escaped); + // Password secured + g_string_append_printf(str, _("Password secured: %s
"), (g_strcmp0("1", g_datalist_get_data(&data->info, "pass")) == 0) + ? _("Yes") : _("No")); + // Game Type + if(g_datalist_get_data(&data->info, "gametype")) + { + escaped = gfire_escape_html(g_datalist_get_data(&data->info, "gametype")); + html = gfire_sq_savage_color_codes_to_html(escaped); + g_free(escaped); + g_string_append_printf(str, _("Game Type: %s
"), html); + g_free(html); + } + else + g_string_append_printf(str, _("Game Type: %s
"), _("N/A")); + // Version + if(g_datalist_get_data(&data->info, "ver")) + { + escaped = gfire_escape_html(g_datalist_get_data(&data->info, "ver")); + html = gfire_sq_savage_color_codes_to_html(escaped); + g_free(escaped); + g_string_append_printf(str, _("Version: %s"), html); + g_free(html); + } + else + g_string_append_printf(str, _("Version: %s"), _("N/A")); + + // Players + g_string_append(str, _("

Players:
")); + gchar **cur = data->players; + while(cur && *cur) + { + escaped = gfire_escape_html(*cur); + html = gfire_sq_savage_color_codes_to_html(escaped); + g_free(escaped); + + g_string_append_printf(str, "%s
", html); + g_free(html); + + cur++; + } + + // Other server rules + g_string_append(str, _("
All Server Info:
")); + g_datalist_foreach(&data->info, gfire_sq_savage_details_vars, str); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_savage_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + { + gfire_sq_savage_data *data = (gfire_sq_savage_data*)p_server->data->proto_data; + + g_datalist_clear(&data->info); + g_strfreev(data->players); + + g_free(data); + } +} diff -Nru gfire-0.8.3/src/gf_server_query_source.c gfire-0.9.4/src/gf_server_query_source.c --- gfire-0.8.3/src/gf_server_query_source.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_server_query_source.c 2011-03-14 20:19:54.000000000 +0000 @@ -0,0 +1,502 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_server_query.h" + +typedef struct _gfire_sq_source_player +{ + gchar *name; + gint32 score; + gfloat time; +} gfire_sq_source_player; + +#define GFSQ_SOURCE_STAGE_CHALLENGE 1 +#define GFSQ_SOURCE_STAGE_PLAYERS 2 +#define GFSQ_SOURCE_STAGE_RULES 3 + +typedef struct _gfire_sq_source_data +{ + // Query handling + guint8 query_stage; + guint32 challenge; + + // General data + guint8 proto_ver; + gchar *name; + gchar *map; + gchar *game_dir; + gchar *game_desc; + guint16 steam_id; + guint8 num_players; + guint8 max_players; + guint8 bots; + guint8 type; + guint8 os; + guint8 password; + guint8 secure; + gchar *version; + + // Extended data + GData *rules; + GSList *players; +} gfire_sq_source_data; + +// Prototypes +static void gfire_sq_source_query(gfire_game_server *p_server, gboolean p_full, int p_socket); +static gboolean gfire_sq_source_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len); +static gchar *gfire_sq_source_details(gfire_game_server *p_server); +static void gfire_sq_source_free_server(gfire_game_server *p_server); + +gfire_server_query_driver gf_sq_source_driver = +{ + gfire_sq_source_query, + gfire_sq_source_parse, + gfire_sq_source_details, + gfire_sq_source_free_server, + 5 +}; + +static void gfire_sq_source_query(gfire_game_server *p_server, gboolean p_full, int p_socket) +{ + static const guint8 challengeQuery[] = { 0xff, 0xff, 0xff, 0xff, 0x55, + 0xff, 0xff, 0xff, 0xff }; + static const guint8 detailsQuery[] = { 0xff, 0xff, 0xff, 0xff, 0x54, + 'S', 'o', 'u', 'r', 'c', 'e', ' ', + 'E', 'n', 'g', 'i', 'n', 'e', ' ', + 'Q', 'u', 'e', 'r', 'y', 0x00 }; + static guint8 rulesQuery[] = { 0xff, 0xff, 0xff, 0xff, 0x56, + 0x00, 0x00, 0x00, 0x00 }; + static guint8 playersQuery[] = { 0xff, 0xff, 0xff, 0xff, 0x55, + 0x00, 0x00, 0x00, 0x00 }; + + const guint8 *query = NULL; + guint8 len; + if(!p_server->data) + { + len = sizeof(detailsQuery); + query = detailsQuery; + } + else if(p_full) + { + gfire_sq_source_data *data = (gfire_sq_source_data*)p_server->data->proto_data; + switch(data->query_stage) + { + case GFSQ_SOURCE_STAGE_CHALLENGE: + len = sizeof(challengeQuery); + query = challengeQuery; + break; + case GFSQ_SOURCE_STAGE_PLAYERS: + len = sizeof(playersQuery); + query = playersQuery; + memcpy(playersQuery + 5, &data->challenge, 4); + break; + case GFSQ_SOURCE_STAGE_RULES: + len = sizeof(rulesQuery); + query = rulesQuery; + memcpy(rulesQuery + 5, &data->challenge, 4); + break; + default: + return; + } + } + else + return; + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = g_htonl(p_server->ip); + addr.sin_port = g_htons(p_server->query_port); + + sendto(p_socket, query, len, 0, (struct sockaddr*)&addr, sizeof(addr)); +} + +static gchar *gfire_sq_source_get_string(const unsigned char *p_data, guint p_len, guint16 *p_offset) +{ + GString *str = g_string_new(NULL); + while(p_data[*p_offset] && *p_offset < p_len) + { + g_string_append_c(str, p_data[*p_offset]); + (*p_offset)++; + } + (*p_offset)++; + return g_string_free(str, FALSE); +} + +static gboolean gfire_sq_source_parse_details(gfire_sq_source_data *p_sdata, const unsigned char *p_data, guint p_len) +{ + if(p_len < 20) + return FALSE; + + static const guint8 detailsReply[] = { 0xff, 0xff, 0xff, 0xff, 0x49 }; + if(memcmp(detailsReply, p_data, 5) != 0) + return FALSE; + + p_sdata->proto_ver = p_data[5]; + guint16 offset = 6; + + // Name + p_sdata->name = gfire_sq_source_get_string(p_data, p_len, &offset); + if(offset == p_len) + goto parse_error; + + // Map + p_sdata->map = gfire_sq_source_get_string(p_data, p_len, &offset); + if(offset == p_len) + goto parse_error; + + // Game directory + p_sdata->game_dir = gfire_sq_source_get_string(p_data, p_len, &offset); + if(offset == p_len) + goto parse_error; + + // Game description + p_sdata->game_desc = gfire_sq_source_get_string(p_data, p_len, &offset); + if(offset == p_len || (p_len - offset) < 10) + goto parse_error; + + // Steam Application ID + p_sdata->steam_id = GUINT16_FROM_LE(*(guint16*)(p_data + offset)); + offset += 2; + + // Current players + p_sdata->num_players = *(p_data + offset); + offset++; + + // Maximum players + p_sdata->max_players = *(p_data + offset); + offset++; + + // Bots + p_sdata->bots = *(p_data + offset); + offset++; + + // Dedicated server? + p_sdata->type = *(p_data + offset); + offset++; + + // OS + p_sdata->os = *(p_data + offset); + offset++; + + // Password secured + p_sdata->password = *(p_data + offset); + offset++; + + // Secure (VAC) + p_sdata->secure = *(p_data + offset); + offset++; + + // Game version + p_sdata->version = gfire_sq_source_get_string(p_data, p_len, &offset); + + return TRUE; + +parse_error: + g_free(p_sdata->name); + g_free(p_sdata->map); + g_free(p_sdata->game_dir); + g_free(p_sdata->game_desc); + g_free(p_sdata->version); + + return FALSE; +} + +static gboolean gfire_sq_source_parse_challenge(gfire_sq_source_data *p_sdata, const unsigned char *p_data, guint p_len) +{ + if(p_len != 9) + return FALSE; + + static const guint8 challengeReply[] = { 0xff, 0xff, 0xff, 0xff, 0x41 }; + if(memcmp(challengeReply, p_data, 5) != 0) + return FALSE; + + // No byte order conversation since we only use it for sending back + p_sdata->challenge = *(guint32*)(p_data + 5); + return TRUE; +} + +static gboolean gfire_sq_source_parse_players(gfire_sq_source_data *p_sdata, const unsigned char *p_data, guint p_len) +{ + if(p_len < 6) + return FALSE; + + static const guint8 playersReply[] = { 0xff, 0xff, 0xff, 0xff, 0x44 }; + if(memcmp(playersReply, p_data, 5) != 0) + return FALSE; + + guint8 numPlayers = *(p_data + 5); + + guint16 offset = 6; + while(offset < (p_len - 10) && g_slist_length(p_sdata->players) < numPlayers) + { + // Not used + //guint8 index = *(p_data + offset); + offset++; + + gchar *name = gfire_sq_source_get_string(p_data, p_len, &offset); + if(offset >= (p_len - 8)) // Error + { + g_free(name); + return FALSE; + } + + gfire_sq_source_player *player = g_malloc0(sizeof(gfire_sq_source_player)); + player->name = name; + + player->score = GINT32_FROM_LE(*(gint32*)(p_data + offset)); + offset += 4; + + player->time = *(gfloat*)(p_data + offset); + offset += 4; + + p_sdata->players = g_slist_append(p_sdata->players, player); + } + + return TRUE; +} + +static gboolean gfire_sq_source_parse_rules(gfire_sq_source_data *p_sdata, const unsigned char *p_data, guint p_len) +{ + if(p_len < 7) + return FALSE; + + static const guint8 rulesReply[] = { 0xff, 0xff, 0xff, 0xff, 0x45 }; + if(memcmp(rulesReply, p_data, 5) != 0) + return FALSE; + + guint16 numRules = GUINT16_FROM_LE(*(guint16*)(p_data + 5)); + + g_datalist_init(&p_sdata->rules); + + guint16 offset = 7; + guint16 rules = 0; + gchar *key = NULL; + while(offset != p_len && rules < numRules) + { + if(!key) + key = gfire_sq_source_get_string(p_data, p_len, &offset); + else + { + g_datalist_set_data_full(&p_sdata->rules, key, gfire_sq_source_get_string(p_data, p_len, &offset), g_free); + g_free(key); + key = NULL; + rules++; + } + } + if(key) + g_free(key); + + return TRUE; +} + +static gboolean gfire_sq_source_parse(gfire_game_server *p_server, guint16 p_ping, gboolean p_full, + const unsigned char *p_data, guint p_len) +{ + if(!p_server->data) + { + gfire_sq_source_data *data = g_malloc0(sizeof(gfire_sq_source_data)); + + // Parse the details data + if(!gfire_sq_source_parse_details(data, p_data, p_len)) + { + g_free(data); + return FALSE; + } + + // Store it for the server + p_server->data = g_malloc0(sizeof(gfire_game_server_data)); + p_server->data->proto_data = data; + + // Set the default values + p_server->data->driver = &gf_sq_source_driver; + p_server->data->name = g_strdup(data->name); + p_server->data->map = g_strdup(data->map); + p_server->data->players = data->num_players; + p_server->data->max_players = data->max_players; + p_server->data->ping = p_ping; + + + // Next stage + data->query_stage = GFSQ_SOURCE_STAGE_CHALLENGE; + } + else + { + gfire_sq_source_data *data = (gfire_sq_source_data*)p_server->data->proto_data; + if(data->query_stage == GFSQ_SOURCE_STAGE_CHALLENGE && gfire_sq_source_parse_challenge(data, p_data, p_len)) + data->query_stage = GFSQ_SOURCE_STAGE_PLAYERS; + else if(data->query_stage == GFSQ_SOURCE_STAGE_CHALLENGE && gfire_sq_source_parse_players(data, p_data, p_len)) + data->query_stage = GFSQ_SOURCE_STAGE_RULES; + else if(data->query_stage == GFSQ_SOURCE_STAGE_PLAYERS && gfire_sq_source_parse_players(data, p_data, p_len)) + data->query_stage = GFSQ_SOURCE_STAGE_RULES; + else if(data->query_stage == GFSQ_SOURCE_STAGE_RULES && gfire_sq_source_parse_rules(data, p_data, p_len)) + return FALSE; + else + { + // Querying failed, remove all data and abort + gfire_sq_source_free_server(p_server); + g_free(p_server->data->name); + g_free(p_server->data->map); + g_free(p_server->data); + p_server->data = NULL; + return FALSE; + } + } + + // Go to the next stage, if requested + return p_full; +} + +static gchar *gfire_sq_source_fixed_len_string(const gchar *p_str, guint p_len) +{ + if(!p_str) + return NULL; + + // Pad the string with spaces if necessary + if(g_utf8_strlen(p_str, -1) < p_len) + { + gchar *str = g_strnfill(p_len + strlen(p_str) - g_utf8_strlen(p_str, -1), ' '); + memcpy(str, p_str, strlen(p_str)); + return str; + } + // Copy max p_len bytes + else if(g_utf8_strlen(p_str, -1) > p_len) + { + const gchar *end = g_utf8_offset_to_pointer(p_str, p_len - 3); + gchar *str = g_strnfill(end - p_str + 3, '.'); + memcpy(str, p_str, end - p_str); + return str; + } + else + return g_strdup(p_str); +} + +static void gfire_sq_source_details_vars(GQuark p_key, gpointer p_data, gpointer p_udata) +{ + g_string_append_printf((GString*)p_udata, "%s: %s
", g_quark_to_string(p_key), (gchar*)p_data); +} + +static gchar *gfire_sq_source_details(gfire_game_server *p_server) +{ + GString *str = g_string_new(NULL); + + gfire_sq_source_data *data = (gfire_sq_source_data*)p_server->data->proto_data; + + // General server infos + g_string_append(str, _("General Server Details:
")); + // Server Name + if(data->name) + { + gchar *escaped = gfire_escape_html(data->name); + g_string_append_printf(str, _("Server Name: %s
"), escaped); + g_free(escaped); + } + // Players + g_string_append_printf(str, _("Players: %u/%u
"), data->num_players, data->max_players); + // Map + if(data->map) + { + gchar *escaped = gfire_escape_html(data->map); + g_string_append_printf(str, _("Map: %s
"), escaped); + g_free(escaped); + } + // Password secured + g_string_append_printf(str, _("Password secured: %s
"), data->password ? _("Yes") : _("No")); + // VAC Secured + g_string_append_printf(str, _("VAC secured: %s
"), data->secure ? _("Yes") : _("No")); + // Server Type + g_string_append_printf(str, _("Server Type: %s
"), + data->type == 'l' ? _("Listen") : + (data->type == 'd' ? _("Dedicated") : + (data->type == 'p' ? "SourceTV" : _("Unknown")))); + // OS + g_string_append_printf(str, _("Operating system: %s
"), + data->os == 'l' ? "GNU/Linux" : + (data->os == 'w' ? "Windows" : _("Unknown"))); + // Version + if(data->version) + { + gchar *escaped = gfire_escape_html(data->version); + g_string_append_printf(str, _("Version: %s"), escaped); + g_free(escaped); + } + + // Players + g_string_append(str, _("

Players:
Name Kills Playtime
")); + GSList *cur = data->players; + while(cur) + { + gfire_sq_source_player *player = (gfire_sq_source_player*)cur->data; + + // Name + gchar *name = gfire_sq_source_fixed_len_string(player->name, 16); + gchar *escaped = gfire_escape_html(name); + g_free(name); + + // Score + gchar *score = g_strdup_printf("%d", player->score); + gchar *score_fixed = gfire_sq_source_fixed_len_string(score, 10); + g_free(score); + + // Time + guint hours = (guint)player->time / 3600; + guint min = ((guint)player->time % 3600) / 60; + guint sec = (guint)player->time % 60; + + g_string_append_printf(str, "%s %s %uh %um %us
", escaped, score_fixed, hours, min, sec); + + g_free(score_fixed); + g_free(escaped); + + cur = g_slist_next(cur); + } + + // Other server rules + g_string_append(str, _("
All Server Rules:
")); + g_datalist_foreach(&data->rules, gfire_sq_source_details_vars, str); + + return g_string_free(str, FALSE); +} + +static void gfire_sq_source_free_server(gfire_game_server *p_server) +{ + if(p_server->data && p_server->data->proto_data) + { + gfire_sq_source_data *data = (gfire_sq_source_data*)p_server->data->proto_data; + + g_free(data->name); + g_free(data->map); + g_free(data->game_dir); + g_free(data->game_desc); + g_free(data->version); + + g_datalist_clear(&data->rules); + + while(data->players) + { + gfire_sq_source_player *player = (gfire_sq_source_player*)data->players->data; + g_free(player->name); + g_free(player); + data->players = g_slist_delete_link(data->players, data->players); + } + g_free(data); + } +} diff -Nru gfire-0.8.3/src/gf_util.c gfire-0.9.4/src/gf_util.c --- gfire-0.8.3/src/gf_util.c 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_util.c 2011-03-14 20:19:46.000000000 +0000 @@ -0,0 +1,677 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#include "gf_util.h" + +#ifdef USE_NOTIFICATIONS +#include +#endif // USE_NOTIFICATIONS + +gchar *gfire_remove_quake3_color_codes(const gchar *p_string) +{ + if(!p_string) + return NULL; + + const gchar color_codes[] = + { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', + 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', + 'U', 'V', 'W', 'X', 'Y', 'Z', + '?', '+', '@', '-', '_', '/', '&', '(', '>', '.' + }; + + gchar *escaped = g_strdup(p_string); + + int i; + gchar code[3]; + gchar *tmp = NULL; + + for (i = 0; i < sizeof(color_codes); i++) + { + g_snprintf(code, 3, "^%c", color_codes[i]); + tmp = purple_strcasereplace(escaped, code, ""); + g_free(escaped); + escaped = tmp; + } + + return escaped; +} + +gchar *gfire_escape_html(const gchar *p_html) +{ + if(p_html != NULL) + { + gchar *tmp = NULL; + gchar *tmp2 = NULL; + + tmp = purple_strreplace(p_html, "&", "&"); + + tmp2 = purple_strreplace(tmp, "<", "<"); + if(tmp) g_free(tmp); + + tmp = purple_strreplace(tmp2, ">", ">"); + if(tmp2) g_free(tmp2); + + tmp2 = purple_strreplace(tmp, "\"", """); + if(tmp) g_free(tmp); + + tmp = purple_strreplace(tmp2, "\n", "
"); + if(tmp2) g_free(tmp2); + + return tmp; + } + else + return NULL; +} + +static gchar *gfire_filetype_get(const gchar *p_path) +{ + if(!p_path) + return NULL; + + gchar output[8192]; + *output = 0; + + gchar *command = g_strdup_printf("file \"%s\"", p_path); + FILE *fp = popen(command, "r"); + g_free(command); + + if(!fp) + return NULL; + + if(!fgets(output, sizeof(output), fp) && !feof(fp)) + { + pclose(fp); + return NULL; + } + pclose(fp); + + return g_strdup(output); +} + +gboolean gfire_filetype_use_wine(const gchar *p_path) +{ + gchar *match, *filetype; + + filetype = gfire_filetype_get(p_path); + if(!filetype) + return FALSE; + + match = strstr(filetype, "PE32 executable for MS Windows"); + g_free(filetype); + + if(match) + return TRUE; + else + return FALSE; +} + +void gfire_list_clear(GList *p_list) +{ + if(!p_list) + return; + + GList *cur = g_list_first(p_list); + for(; cur; cur = g_list_next(cur)) + if(cur->data) g_free(cur->data); + + g_list_free(p_list); +} + +gchar *gfire_strip_character_range(gchar *p_string, gchar p_start, gchar p_end) +{ + if(!p_string) + return NULL; + + int i; + int len = strlen(p_string); + + for(i = 0; i < len; i++) + { + if((p_string[i] >= p_start) && (p_string[i] <= p_end)) + { + int j = i; + while(p_string[j] != 0) + { + p_string[j] = p_string[j + 1]; + j++; + } + i--; + len--; + } + } + + return p_string; +} + +gchar *gfire_strip_invalid_utf8(gchar *p_utf8) +{ + if(!p_utf8) + return NULL; + + const gchar *end = NULL; + while(!g_utf8_validate(p_utf8, -1, &end)) + memmove((gchar*)end, end + 1, strlen(end)); + + return p_utf8; +} + +void hashSha1(const gchar *p_input, gchar *p_digest) +//based on code from purple_util_get_image_filename in the pidgin 2.2.0 source +{ + if(!p_digest) + return; + + PurpleCipherContext *context; + + context = purple_cipher_context_new_by_name("sha1", NULL); + if (context == NULL) + { + purple_debug_error("gfire", "Could not find sha1 cipher\n"); + return; + } + + purple_cipher_context_append(context, (guchar*)p_input, strlen(p_input)); + if (!purple_cipher_context_digest_to_str(context, 41, p_digest, NULL)) + { + purple_debug_error("gfire", "Failed to get SHA-1 digest.\n"); + return; + } + purple_cipher_context_destroy(context); + p_digest[40]=0; +} + +void hashSha1_bin(const guchar *p_input, int p_len, guchar *p_digest) +{ + if(!p_digest) + return; + + PurpleCipherContext *context; + + context = purple_cipher_context_new_by_name("sha1", NULL); + if (context == NULL) + { + purple_debug_error("gfire", "Could not find sha1 cipher\n"); + return; + } + + purple_cipher_context_append(context, (guchar*)p_input, p_len); + if(!purple_cipher_context_digest(context, 20, p_digest, NULL)) + { + purple_debug_error("gfire", "Failed to get SHA-1 digest.\n"); + return; + } + purple_cipher_context_destroy(context); +} + +void hashSha1_bin_to_str(const guchar *p_input, int p_len, gchar *p_digest) +{ + if(!p_digest) + return; + + PurpleCipherContext *context; + + context = purple_cipher_context_new_by_name("sha1", NULL); + if (context == NULL) + { + purple_debug_error("gfire", "Could not find sha1 cipher\n"); + return; + } + + purple_cipher_context_append(context, (guchar*)p_input, p_len); + if(!purple_cipher_context_digest_to_str(context, 41, p_digest, NULL)) + { + purple_debug_error("gfire", "Failed to get SHA-1 digest.\n"); + return; + } + purple_cipher_context_destroy(context); +} + +void hashSha1_file_to_str(FILE *p_file, gchar *p_digest) +{ + if(!p_file || !p_digest) + return; + + PurpleCipherContext *context; + + context = purple_cipher_context_new_by_name("sha1", NULL); + if (context == NULL) + { + purple_debug_error("gfire", "Could not find sha1 cipher\n"); + return; + } + + guchar *buf = g_malloc0(256 * 1024); // 256KB + fseek(p_file, 0, SEEK_SET); + while(!feof(p_file)) + { + size_t bytes_read = fread(buf, 1, 256 * 1024, p_file); + purple_cipher_context_append(context, buf, bytes_read); + } + g_free(buf); + + if(!purple_cipher_context_digest_to_str(context, 41, p_digest, NULL)) + { + purple_debug_error("gfire", "Failed to get SHA-1 digest of file.\n"); + return; + } + purple_cipher_context_destroy(context); +} + +void hashSha1_to_bin(const gchar *p_input, guint8 *p_digest) +{ + if(!p_digest) + return; + + PurpleCipherContext *context; + + context = purple_cipher_context_new_by_name("sha1", NULL); + if (context == NULL) + { + purple_debug_error("gfire", "Could not find sha1 cipher\n"); + return; + } + + purple_cipher_context_append(context, (guchar*)p_input, strlen(p_input)); + if (!purple_cipher_context_digest(context, 20, p_digest, NULL)) + { + purple_debug_error("gfire", "Failed to get SHA-1 digest.\n"); + return; + } + purple_cipher_context_destroy(context); +} + + +gchar *gfire_hex_bin_to_str(guint8 *p_data, guint32 p_len) +{ + if(!p_data || !p_len) + return NULL; + + gchar *ret = g_malloc0(p_len * 2 + 1); + guint32 i; + for(i = 0; i < p_len; i++) + g_sprintf(ret + (i * 2), "%02x", p_data[i]); + + return ret; +} + +guint8 *gfire_hex_str_to_bin(const gchar *p_str) +{ + if(!p_str) + return NULL; + + guint8 *ret = g_malloc0(strlen(p_str) / 2); + if(!ret) + return NULL; + + int bin_pos = 0; + int i = 0; + for(; i < strlen(p_str); i++) + { + int value = 0; + switch(p_str[i]) + { + case '0': + value += 0x00; + break; + case '1': + value += 0x01; + break; + case '2': + value += 0x02; + break; + case '3': + value += 0x03; + break; + case '4': + value += 0x04; + break; + case '5': + value += 0x05; + break; + case '6': + value += 0x06; + break; + case '7': + value += 0x07; + break; + case '8': + value += 0x08; + break; + case '9': + value += 0x09; + break; + case 'a': + value += 0x0A; + break; + case 'b': + value += 0x0B; + break; + case 'c': + value += 0x0C; + break; + case 'd': + value += 0x0D; + break; + case 'e': + value += 0x0E; + break; + case 'f': + value += 0x0F; + break; + } + if((i % 2) == 0) + { + ret[bin_pos] = value << 4; + } + else + { + ret[bin_pos] += value; + bin_pos++; + } + } + + return ret; +} + +static const guint32 _gfire_crc32_table[256] = +{ + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, +}; + +guint32 gfire_crc32(const void *p_data, guint32 p_len) +{ + if(!p_data || !p_len) + return 0; + + guint32 crc32 = 0xFFFFFFFF; + + guint32 i; + for(i = 0; i < p_len; i++) + { + crc32 = (crc32 >> 8) ^ _gfire_crc32_table[((guint8*)p_data)[i] ^ (crc32 & 0x000000FF)]; + } + + return ~crc32; +} + +gfire_bitlist *gfire_bitlist_new() +{ + gfire_bitlist *ret = g_malloc0(sizeof(gfire_bitlist)); + ret->data = g_malloc0(10); + ret->size = 10; + + return ret; +} + +void gfire_bitlist_free(gfire_bitlist *p_list) +{ + if(!p_list) + return; + + g_free(p_list->data); + g_free(p_list); +} + +gboolean gfire_bitlist_get(const gfire_bitlist *p_list, guint32 p_index) +{ + if(!p_list) + return FALSE; + + if((p_index >> 3) >= p_list->size) + return FALSE; + + return (*(p_list->data + (p_index >> 3)) & (1 << (p_index & 7))); +} + +void gfire_bitlist_set(gfire_bitlist *p_list, guint32 p_index, gboolean p_isset) +{ + if(!p_list) + return; + + if((p_index >> 3) >= p_list->size) + { + guint32 oldsize = p_list->size; + p_list->size = (p_index >> 3) + 10; + p_list->data = g_realloc(p_list->data, p_list->size); + memset(p_list->data + oldsize, 0, p_list->size - oldsize); + } + + if(p_isset) + { + if(!(*(p_list->data + (p_index >> 3)) & (1 << (p_index & 7)))) + p_list->bits_set++; + + *(p_list->data + (p_index >> 3)) |= (1 << (p_index & 7)); + } + else + { + if(*(p_list->data + (p_index >> 3)) & (1 << (p_index & 7))) + { + p_list->bits_set--; + *(p_list->data + (p_index >> 3)) &= ~(1 << (p_index & 7)); + } + } +} + +guint32 gfire_bitlist_bits_set(const gfire_bitlist *p_list) +{ + if(!p_list) + return 0; + + return p_list->bits_set; +} + +guint32 gfire_bitlist_bits_unset(const gfire_bitlist *p_list) +{ + if(!p_list) + return 0; + + return ((p_list->size * 8) - p_list->bits_set); +} + +void gfire_bitlist_clear(gfire_bitlist *p_list) +{ + if(!p_list) + return; + + p_list->data = g_realloc(p_list->data, 10); + p_list->size = 10; + memset(p_list->data, 0, 10); + + p_list->bits_set = 0; +} + +#ifdef USE_NOTIFICATIONS +// Only initialize and deinitialize if we need to (other plugins use it etc.) +static gboolean gfire_notify_initted = FALSE; +static GHashTable *gfire_notify_buddies = NULL; + +static gboolean gfire_notify_init() +{ + if(!gfire_notify_buddies) + gfire_notify_buddies = g_hash_table_new(NULL, NULL); + + if(!notify_is_initted()) + { + if(!notify_init("Purple")) + return FALSE; + + gfire_notify_initted = TRUE; + } + + return TRUE; +} + +void gfire_notify_uninit() +{ + if(gfire_notify_initted) + notify_uninit(); + + g_hash_table_destroy(gfire_notify_buddies); + gfire_notify_buddies = NULL; +} + +static gboolean gfire_notify_closed_cb(NotifyNotification *p_notification) +{ + PurpleBuddy *buddy = PURPLE_BUDDY(g_object_get_data(G_OBJECT(p_notification), "buddy")); + if(buddy) + g_hash_table_remove(gfire_notify_buddies, buddy); + + g_object_unref(G_OBJECT(p_notification)); + return FALSE; +} + +void gfire_notify_system(const gchar *p_title, const gchar *p_msg) +{ + if(!gfire_notify_init() || !p_title) + return; + + NotifyNotification *notification = notify_notification_new(p_title, p_msg, NULL, NULL); + notify_notification_set_urgency(notification, NOTIFY_URGENCY_NORMAL); + notify_notification_set_timeout(notification, NOTIFY_EXPIRES_DEFAULT); + g_signal_connect(notification, "closed", G_CALLBACK(gfire_notify_closed_cb), NULL); + + if(!notify_notification_show(notification, NULL)) + { + purple_debug_error("gfire", "gfire_notify: failed to send notification\n"); + g_object_unref(G_OBJECT(notification)); + } +} + +void gfire_notify_buddy(PurpleBuddy *p_buddy, const gchar *p_title, const gchar *p_msg) +{ + if(!gfire_notify_init() || !p_buddy || !p_title) + return; + + NotifyNotification *notification = g_hash_table_lookup(gfire_notify_buddies, p_buddy); + if(notification) + { + notify_notification_update(notification, p_title, p_msg, NULL); + notify_notification_show(notification, NULL); + return; + } + + notification = notify_notification_new(p_title, p_msg, NULL, NULL); + + // Get Buddy Icon + PurpleBuddyIcon *icon = purple_buddy_get_icon(p_buddy); + if(icon) + { + GdkPixbuf *pixbuf; + GdkPixbufLoader *loader = gdk_pixbuf_loader_new(); + + size_t len = 0; + const guchar *data = purple_buddy_icon_get_data(icon, &len); + gdk_pixbuf_loader_set_size(loader, 48, 48); + gdk_pixbuf_loader_write(loader, data, len, NULL); + gdk_pixbuf_loader_close(loader, NULL); + + pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); + + if(pixbuf) + notify_notification_set_icon_from_pixbuf(notification, pixbuf); + + g_object_unref(G_OBJECT(loader)); + } + + g_object_set_data(G_OBJECT(notification), "buddy", p_buddy); + g_hash_table_insert(gfire_notify_buddies, p_buddy, notification); + + notify_notification_set_urgency(notification, NOTIFY_URGENCY_NORMAL); + notify_notification_set_timeout(notification, NOTIFY_EXPIRES_DEFAULT); + g_signal_connect(notification, "closed", G_CALLBACK(gfire_notify_closed_cb), NULL); + + if(!notify_notification_show(notification, NULL)) + { + purple_debug_error("gfire", "gfire_notify: failed to send notification\n"); + g_hash_table_remove(gfire_notify_buddies, p_buddy); + g_object_unref(G_OBJECT(notification)); + } +} +#endif // USE_NOTIFICATIONS diff -Nru gfire-0.8.3/src/gf_util.h gfire-0.9.4/src/gf_util.h --- gfire-0.8.3/src/gf_util.h 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/gf_util.h 2011-03-14 20:19:39.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * purple - Xfire Protocol Plugin + * + * This file is part of Gfire. + * + * See the AUTHORS file distributed with Gfire for a full list of + * all contributors and this files copyright holders. + * + * Gfire is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 Gfire. If not, see . +*/ + +#ifndef _GF_UTIL_H +#define _GF_UTIL_H + +typedef struct _gfire_bitlist gfire_bitlist; + +#include "gf_base.h" + +// Utils for the server browser +gchar *gfire_remove_quake3_color_codes(const gchar *p_string); + +// Utils for filetype detection +gboolean gfire_filetype_use_wine(const gchar *p_path); + +// Utils for handling HTML +gchar *gfire_escape_html(const gchar *p_html); + +// Utils for handling lists +void gfire_list_clear(GList *p_list); + +// Utils for handling strings +gchar *gfire_strip_character_range(gchar *p_string, gchar p_start, gchar p_end); +gchar *gfire_strip_invalid_utf8(gchar *p_utf8); + +// Utils for SHA-1 hashing +void hashSha1(const gchar *p_input, gchar *p_digest); +void hashSha1_to_bin(const gchar *p_input, guint8 *p_digest); +void hashSha1_bin(const guchar *p_input, int p_len, guchar *p_digest); +void hashSha1_bin_to_str(const guchar *p_input, int p_len, gchar *p_digest); +void hashSha1_file_to_str(FILE *p_file, gchar *p_digest); + +// Utils for Hex<->String conversion +gchar *gfire_hex_bin_to_str(guint8 *p_data, guint32 p_len); +guint8 *gfire_hex_str_to_bin(const gchar *p_str); + +// Utils for checksums +guint32 gfire_crc32(const void *p_data, guint32 p_len); + +// Dynamic Bitlist +struct _gfire_bitlist +{ + guint8 *data; + guint32 size; + guint32 bits_set; +}; + +gfire_bitlist *gfire_bitlist_new(); +void gfire_bitlist_free(gfire_bitlist *p_list); +gboolean gfire_bitlist_get(const gfire_bitlist *p_list, guint32 p_index); +void gfire_bitlist_set(gfire_bitlist *p_list, guint32 p_index, gboolean p_isset); +guint32 gfire_bitlist_bits_set(const gfire_bitlist *p_list); +guint32 gfire_bitlist_bits_unset(const gfire_bitlist *p_list); +void gfire_bitlist_clear(gfire_bitlist *p_list); + +// Notification system +#if defined(HAVE_GTK) && defined(HAVE_LIBNOTIFY) +# define USE_NOTIFICATIONS 1 +void gfire_notify_uninit(); +void gfire_notify_system(const gchar *p_title, const gchar *p_msg); +void gfire_notify_buddy(PurpleBuddy *p_buddy, const gchar *p_title, const gchar *p_msg); +#else +#undef USE_NOTIFICATIONS +#endif // HAVE_GTK && HAVE_LIBNOTIFY + +#endif // _GF_UTIL_H diff -Nru gfire-0.8.3/src/Makefile.am gfire-0.9.4/src/Makefile.am --- gfire-0.8.3/src/Makefile.am 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/Makefile.am 2011-03-14 18:19:38.000000000 +0000 @@ -1,10 +1,44 @@ EXTRA_DIST = \ gfire.h \ + gfire_proto.h \ debug.h \ gf_network.h \ - gf_packet.h \ gf_games.h \ - gf_chat.h + gf_chat.h \ + gf_chat_proto.h \ + gf_friend_search.h \ + gf_friend_search_proto.h \ + gf_protocol.h \ + gf_purple.h \ + gf_menus.h \ + gf_util.h \ + gf_server_detection.h \ + gf_server_detection_win.c \ + gf_game_detection.h \ + gf_game_detection_linux.h \ + gf_game_detection_win.h \ + gf_game_detection_win.c \ + gf_server_browser.h \ + gf_server_browser_proto.h \ + gf_server_query.h \ + gf_buddies.h \ + gf_buddies_proto.h \ + gf_p2p.h \ + gf_p2p_natcheck.h \ + gf_p2p_session.h \ + gf_p2p_im_handler.h \ + gf_p2p_dl_handler.h \ + gf_p2p_dl_proto.h \ + gf_filetransfer.h \ + gf_file_chunk.h \ + gf_groups.h \ + gf_groups_proto.h \ + gf_preferences.h \ + gf_preferences_proto.h + +INCLUDES = \ + -I$(top_srcdir) \ + -DLOCALEDIR=\""$(localedir)"\" plugindir = $(libdir)/purple-2 libxfire_la_LDFLAGS = -module -avoid-version @@ -13,22 +47,71 @@ plugin_LTLIBRARIES = libxfire.la libxfire_la_SOURCES = \ - gfire.c \ - gf_network.c \ - gf_packet.c \ + gf_buddies.c \ + gf_buddies_proto.c \ + gf_chat.c \ + gf_chat_proto.c \ + gf_friend_search.c \ + gf_friend_search_proto.c \ gf_games.c \ - gf_chat.c + gf_network.c \ + gf_protocol.c \ + gf_purple.c \ + gfire.c \ + gfire_proto.c \ + gf_menus.c \ + gf_util.c \ + gf_p2p.c \ + gf_p2p_natcheck.c \ + gf_p2p_session.c \ + gf_p2p_im_handler.c \ + gf_p2p_dl_handler.c \ + gf_p2p_dl_proto.c \ + gf_filetransfer.c \ + gf_file_chunk.c \ + gf_groups.c \ + gf_groups_proto.c \ + gf_preferences.c \ + gf_preferences_proto.c + +if GTK + +libxfire_la_SOURCES += \ + gf_server_browser.c \ + gf_server_browser_proto.c \ + gf_server_query.c \ + gf_server_query_quake.c \ + gf_server_query_source.c \ + gf_server_query_gamespy.c \ + gf_server_query_gamespy2.c \ + gf_server_query_gamespy3.c \ + gf_server_query_ase.c \ + gf_server_query_savage.c + +endif + +if GAME_DETECTION + +libxfire_la_SOURCES += \ + gf_server_detection_linux.c \ + gf_game_detection.c \ + gf_server_detection.c \ + gf_game_detection_linux.c + +endif libxfire_la_LIBADD = \ - $(GLIB_LIBS) $(SSL_LIBS) + $(PURPLE_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBNOTIFY_LIBS) $(DBUS_GLIB_LIBS) endif AM_CPPFLAGS = \ -DLIBDIR=\"$(libdir)/purple-2/\" \ -DDATADIR=\"$(datadir)\" \ $(GLIB_CFLAGS) \ - $(PIDGIN_CFLAGS) \ - $(SSL_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBNOTIFY_CFLAGS) \ + $(DBUS_GLIB_CFLAGS) \ + $(PURPLE_CFLAGS) \ $(DEBUG_CFLAGS) AM_CFLAGS = -DPURPLE_PLUGINS diff -Nru gfire-0.8.3/src/Makefile.in gfire-0.9.4/src/Makefile.in --- gfire-0.8.3/src/Makefile.in 2009-05-30 19:37:14.000000000 +0000 +++ gfire-0.9.4/src/Makefile.in 2011-03-23 19:57:04.000000000 +0000 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.2 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@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 @@ -32,65 +34,161 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@GTK_TRUE@@PLUGINS_TRUE@am__append_1 = \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_browser.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_browser_proto.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_quake.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_source.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_gamespy.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_gamespy2.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_gamespy3.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_ase.c \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_savage.c + +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@am__append_2 = \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_server_detection_linux.c \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_game_detection.c \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_server_detection.c \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_game_detection_linux.c + subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/VERSION $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/pre_config.h +CONFIG_HEADER = $(top_builddir)/gfire_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 = `echo $$p | sed -e 's|^.*/||'`; +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__installdirs = "$(DESTDIR)$(plugindir)" -pluginLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = -@PLUGINS_TRUE@libxfire_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__libxfire_la_SOURCES_DIST = gfire.c gf_network.c gf_packet.c \ - gf_games.c gf_chat.c -@PLUGINS_TRUE@am_libxfire_la_OBJECTS = gfire.lo gf_network.lo \ -@PLUGINS_TRUE@ gf_packet.lo gf_games.lo gf_chat.lo +@PLUGINS_TRUE@libxfire_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +@PLUGINS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +@PLUGINS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__libxfire_la_SOURCES_DIST = gf_buddies.c gf_buddies_proto.c \ + gf_chat.c gf_chat_proto.c gf_friend_search.c \ + gf_friend_search_proto.c gf_games.c gf_network.c gf_protocol.c \ + gf_purple.c gfire.c gfire_proto.c gf_menus.c gf_util.c \ + gf_p2p.c gf_p2p_natcheck.c gf_p2p_session.c \ + gf_p2p_im_handler.c gf_p2p_dl_handler.c gf_p2p_dl_proto.c \ + gf_filetransfer.c gf_file_chunk.c gf_groups.c \ + gf_groups_proto.c gf_preferences.c gf_preferences_proto.c \ + gf_server_browser.c gf_server_browser_proto.c \ + gf_server_query.c gf_server_query_quake.c \ + gf_server_query_source.c gf_server_query_gamespy.c \ + gf_server_query_gamespy2.c gf_server_query_gamespy3.c \ + gf_server_query_ase.c gf_server_query_savage.c \ + gf_server_detection_linux.c gf_game_detection.c \ + gf_server_detection.c gf_game_detection_linux.c +@GTK_TRUE@@PLUGINS_TRUE@am__objects_1 = gf_server_browser.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_browser_proto.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_quake.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_source.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_gamespy.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_gamespy2.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_gamespy3.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_ase.lo \ +@GTK_TRUE@@PLUGINS_TRUE@ gf_server_query_savage.lo +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@am__objects_2 = gf_server_detection_linux.lo \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_game_detection.lo \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_server_detection.lo \ +@GAME_DETECTION_TRUE@@PLUGINS_TRUE@ gf_game_detection_linux.lo +@PLUGINS_TRUE@am_libxfire_la_OBJECTS = gf_buddies.lo \ +@PLUGINS_TRUE@ gf_buddies_proto.lo gf_chat.lo gf_chat_proto.lo \ +@PLUGINS_TRUE@ gf_friend_search.lo gf_friend_search_proto.lo \ +@PLUGINS_TRUE@ gf_games.lo gf_network.lo gf_protocol.lo \ +@PLUGINS_TRUE@ gf_purple.lo gfire.lo gfire_proto.lo gf_menus.lo \ +@PLUGINS_TRUE@ gf_util.lo gf_p2p.lo gf_p2p_natcheck.lo \ +@PLUGINS_TRUE@ gf_p2p_session.lo gf_p2p_im_handler.lo \ +@PLUGINS_TRUE@ gf_p2p_dl_handler.lo gf_p2p_dl_proto.lo \ +@PLUGINS_TRUE@ gf_filetransfer.lo gf_file_chunk.lo gf_groups.lo \ +@PLUGINS_TRUE@ gf_groups_proto.lo gf_preferences.lo \ +@PLUGINS_TRUE@ gf_preferences_proto.lo $(am__objects_1) \ +@PLUGINS_TRUE@ $(am__objects_2) libxfire_la_OBJECTS = $(am_libxfire_la_OBJECTS) -libxfire_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libxfire_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libxfire_la_LDFLAGS) $(LDFLAGS) -o $@ @PLUGINS_TRUE@am_libxfire_la_rpath = -rpath $(plugindir) 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=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_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +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_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libxfire_la_SOURCES) DIST_SOURCES = $(am__libxfire_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ +DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -102,19 +200,32 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ +LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -123,6 +234,10 @@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -134,17 +249,26 @@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIDGIN_CFLAGS = @PIDGIN_CFLAGS@ -PIDGIN_LIBS = @PIDGIN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PURPLE_CFLAGS = @PURPLE_CFLAGS@ +PURPLE_LIBS = @PURPLE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -181,7 +305,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -200,31 +323,71 @@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ gfire.h \ + gfire_proto.h \ debug.h \ gf_network.h \ - gf_packet.h \ gf_games.h \ - gf_chat.h + gf_chat.h \ + gf_chat_proto.h \ + gf_friend_search.h \ + gf_friend_search_proto.h \ + gf_protocol.h \ + gf_purple.h \ + gf_menus.h \ + gf_util.h \ + gf_server_detection.h \ + gf_server_detection_win.c \ + gf_game_detection.h \ + gf_game_detection_linux.h \ + gf_game_detection_win.h \ + gf_game_detection_win.c \ + gf_server_browser.h \ + gf_server_browser_proto.h \ + gf_server_query.h \ + gf_buddies.h \ + gf_buddies_proto.h \ + gf_p2p.h \ + gf_p2p_natcheck.h \ + gf_p2p_session.h \ + gf_p2p_im_handler.h \ + gf_p2p_dl_handler.h \ + gf_p2p_dl_proto.h \ + gf_filetransfer.h \ + gf_file_chunk.h \ + gf_groups.h \ + gf_groups_proto.h \ + gf_preferences.h \ + gf_preferences_proto.h + +INCLUDES = \ + -I$(top_srcdir) \ + -DLOCALEDIR=\""$(localedir)"\" plugindir = $(libdir)/purple-2 libxfire_la_LDFLAGS = -module -avoid-version @PLUGINS_TRUE@plugin_LTLIBRARIES = libxfire.la -@PLUGINS_TRUE@libxfire_la_SOURCES = \ -@PLUGINS_TRUE@ gfire.c \ -@PLUGINS_TRUE@ gf_network.c \ -@PLUGINS_TRUE@ gf_packet.c \ -@PLUGINS_TRUE@ gf_games.c \ -@PLUGINS_TRUE@ gf_chat.c - +@PLUGINS_TRUE@libxfire_la_SOURCES = gf_buddies.c gf_buddies_proto.c \ +@PLUGINS_TRUE@ gf_chat.c gf_chat_proto.c gf_friend_search.c \ +@PLUGINS_TRUE@ gf_friend_search_proto.c gf_games.c gf_network.c \ +@PLUGINS_TRUE@ gf_protocol.c gf_purple.c gfire.c gfire_proto.c \ +@PLUGINS_TRUE@ gf_menus.c gf_util.c gf_p2p.c gf_p2p_natcheck.c \ +@PLUGINS_TRUE@ gf_p2p_session.c gf_p2p_im_handler.c \ +@PLUGINS_TRUE@ gf_p2p_dl_handler.c gf_p2p_dl_proto.c \ +@PLUGINS_TRUE@ gf_filetransfer.c gf_file_chunk.c gf_groups.c \ +@PLUGINS_TRUE@ gf_groups_proto.c gf_preferences.c \ +@PLUGINS_TRUE@ gf_preferences_proto.c $(am__append_1) \ +@PLUGINS_TRUE@ $(am__append_2) @PLUGINS_TRUE@libxfire_la_LIBADD = \ -@PLUGINS_TRUE@ $(GLIB_LIBS) $(SSL_LIBS) +@PLUGINS_TRUE@ $(PURPLE_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBNOTIFY_LIBS) $(DBUS_GLIB_LIBS) AM_CPPFLAGS = \ -DLIBDIR=\"$(libdir)/purple-2/\" \ -DDATADIR=\"$(datadir)\" \ $(GLIB_CFLAGS) \ - $(PIDGIN_CFLAGS) \ - $(SSL_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBNOTIFY_CFLAGS) \ + $(DBUS_GLIB_CFLAGS) \ + $(PURPLE_CFLAGS) \ $(DEBUG_CFLAGS) AM_CFLAGS = -DPURPLE_PLUGINS @@ -241,9 +404,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -261,23 +424,28 @@ 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): install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)" - @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(plugindir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(plugindir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ + } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$p'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$p"; \ + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: @@ -289,7 +457,7 @@ rm -f "$${dir}/so_locations"; \ done libxfire.la: $(libxfire_la_OBJECTS) $(libxfire_la_DEPENDENCIES) - $(libxfire_la_LINK) $(am_libxfire_la_rpath) $(libxfire_la_OBJECTS) $(libxfire_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libxfire_la_LINK) $(am_libxfire_la_rpath) $(libxfire_la_OBJECTS) $(libxfire_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -297,29 +465,67 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_buddies.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_buddies_proto.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_chat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_chat_proto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_file_chunk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_filetransfer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_friend_search.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_friend_search_proto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_game_detection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_game_detection_linux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_games.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_groups.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_groups_proto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_menus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_network.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_packet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_p2p.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_p2p_dl_handler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_p2p_dl_proto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_p2p_im_handler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_p2p_natcheck.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_p2p_session.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_preferences.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_preferences_proto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_protocol.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_purple.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_browser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_browser_proto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_detection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_detection_linux.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_ase.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_gamespy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_gamespy2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_gamespy3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_quake.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_savage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_server_query_source.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gf_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfire.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfire_proto.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -342,7 +548,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -350,29 +556,34 @@ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + 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) - tags=; \ 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)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -393,13 +604,17 @@ 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -430,6 +645,7 @@ 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" @@ -451,6 +667,8 @@ html: html-am +html-am: + info: info-am info-am: @@ -459,18 +677,28 @@ 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 @@ -509,6 +737,7 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pluginLTLIBRARIES + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru gfire-0.8.3/src/Makefile.mingw gfire-0.9.4/src/Makefile.mingw --- gfire-0.8.3/src/Makefile.mingw 1970-01-01 00:00:00.000000000 +0000 +++ gfire-0.9.4/src/Makefile.mingw 2011-03-14 18:20:03.000000000 +0000 @@ -0,0 +1,108 @@ +GFIRE_DIR = .. +# All personal changes usually go into this file +include ../mingw.mak + +SUBDIRS = + +LIBPURPLE_CFLAGS = -I${WIN32_PIDGIN_DIR}/libpurple -I${WIN32_PIDGIN_DIR}/libpurple/win32 -DPURPLE_PLUGINS -DNO_ZLIB +WIN32_CFLAGS = \ + -DPSAPI_VERSION=1 \ + -I${WIN32_GTK_DIR}/include/glib-2.0 \ + -I${WIN32_PIDGIN_DIR}/libpurple/win32 \ + -I${WIN32_DEV_DIR}/gtk_2_0/include \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/glib-2.0 \ + -I${WIN32_GTK_DIR}/lib/glib-2.0/include \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/gtk-2.0 \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/pango-1.0 \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/libpng13 \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/fontconfig \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/freetype2 \ + -I${WIN32_DEV_DIR}/gtk_2_0/lib/gtk-2.0/include \ + -I${WIN32_DEV_DIR}/gtk_2_0/lib/glib-2.0/include \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/atk-1.0 \ + -I${WIN32_DEV_DIR}/gtk_2_0/include/cairo +WIN32_LIBS = -L${WIN32_GTK_DIR}/lib -L${WIN32_PIDGIN_DIR}/libpurple -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lws2_32 -lintl -lgdk-win32-2.0 -lgtk-win32-2.0 -lpurple -lpsapi +GFIRE_SRC_DIR = . + +CFLAGS = -O2 -pipe -mno-cygwin -Wall -I. -I${GFIRE_DIR} -I${GFIRE_SRC_DIR} ${WIN32_CFLAGS} ${LIBPURPLE_CFLAGS} ${USER_CFLAGS} +LDFLAGS = -mno-cygwin -shared -Wl,--dll,--strip-debug ${USER_LDFLAGS} + +GFIRE_SOURCES = \ + ${GFIRE_SRC_DIR}/gfire.c \ + ${GFIRE_SRC_DIR}/gf_chat.c \ + ${GFIRE_SRC_DIR}/gf_chat_proto.c \ + ${GFIRE_SRC_DIR}/gf_games.c \ + ${GFIRE_SRC_DIR}/gf_buddies.c \ + ${GFIRE_SRC_DIR}/gf_buddies_proto.c \ + ${GFIRE_SRC_DIR}/gf_friend_search.c \ + ${GFIRE_SRC_DIR}/gf_friend_search_proto.c \ + ${GFIRE_SRC_DIR}/gf_menus.c \ + ${GFIRE_SRC_DIR}/gf_protocol.c \ + ${GFIRE_SRC_DIR}/gf_purple.c \ + ${GFIRE_SRC_DIR}/gf_server_browser.c \ + ${GFIRE_SRC_DIR}/gf_server_browser_proto.c \ + ${GFIRE_SRC_DIR}/gf_server_query.c \ + ${GFIRE_SRC_DIR}/gf_server_query_quake.c \ + ${GFIRE_SRC_DIR}/gf_server_query_source.c \ + ${GFIRE_SRC_DIR}/gf_server_query_gamespy.c \ + ${GFIRE_SRC_DIR}/gf_server_query_gamespy2.c \ + ${GFIRE_SRC_DIR}/gf_server_query_gamespy3.c \ + ${GFIRE_SRC_DIR}/gf_server_query_ase.c \ + ${GFIRE_SRC_DIR}/gf_server_query_savage.c \ + ${GFIRE_SRC_DIR}/gf_server_detection.c \ + ${GFIRE_SRC_DIR}/gf_server_detection_win.c \ + ${GFIRE_SRC_DIR}/gf_util.c \ + ${GFIRE_SRC_DIR}/gfire_proto.c \ + ${GFIRE_SRC_DIR}/gf_network.c \ + ${GFIRE_SRC_DIR}/gf_game_detection.c \ + ${GFIRE_SRC_DIR}/gf_game_detection_win.c \ + ${GFIRE_SRC_DIR}/gf_p2p.c \ + ${GFIRE_SRC_DIR}/gf_p2p_natcheck.c \ + ${GFIRE_SRC_DIR}/gf_p2p_session.c \ + ${GFIRE_SRC_DIR}/gf_p2p_dl_handler.c \ + ${GFIRE_SRC_DIR}/gf_p2p_im_handler.c \ + ${GFIRE_SRC_DIR}/gf_p2p_dl_proto.c \ + ${GFIRE_SRC_DIR}/gf_filetransfer.c \ + ${GFIRE_SRC_DIR}/gf_file_chunk.c \ + ${GFIRE_SRC_DIR}/gf_groups.c \ + ${GFIRE_SRC_DIR}/gf_groups_proto.c \ + ${GFIRE_SRC_DIR}/gf_preferences.c \ + ${GFIRE_SRC_DIR}/gf_preferences_proto.c + +GFIRE_RESOURCES = \ + ${GFIRE_SRC_DIR}/gfirerc.rc + +GFIRE_OBJECTS = ${GFIRE_SOURCES:%.c=%.o} ${GFIRE_RESOURCES:%.rc=%.o} + + +# Standard stuff here +.PHONY: all clean +.SUFFIXES: .rc + +all: libxfire.dll + @list='${SUBDIRS}'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) -f Makefile.mingw all) || exit 1; \ + done; + +clean: + rm -f libxfire.dll + rm -f ${GFIRE_OBJECTS} + @list='${SUBDIRS}'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) -f Makefile.mingw clean) || exit 1; \ + done; + +install: all + mkdir -p ${WIN32_INSTALL_DIR}/plugins + cp libxfire.dll ${WIN32_INSTALL_DIR}/plugins + @list='${SUBDIRS}'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) -f Makefile.mingw install) || exit 1; \ + done; + +.c.o: + @echo " CC " $@;${WIN32_COMPILER} ${CFLAGS} -o $@ -c $^ + +.rc.o: + @echo " WINDRES " $@;${WIN32_WINDRES} -i $^ -o $@ + +libxfire.dll: ${GFIRE_OBJECTS} + @echo " CCLD " $@;${WIN32_COMPILER} $^ ${WIN32_LIBS} ${LDFLAGS} -o libxfire.dll \ No newline at end of file diff -Nru gfire-0.8.3/VERSION gfire-0.9.4/VERSION --- gfire-0.8.3/VERSION 2009-08-19 14:12:47.000000000 +0000 +++ gfire-0.9.4/VERSION 2011-03-23 19:46:49.000000000 +0000 @@ -1 +1 @@ -0.8.3 +0.9.4