Compare commits
15 Commits
wip/rfc345
...
wip/self-m
Author | SHA1 | Date | |
---|---|---|---|
52a685238c | |||
951b7563bf | |||
2ea12bce1d | |||
382908ab6d | |||
e3838a6e67 | |||
c874a9525c | |||
fc20786a5e | |||
d48f31191f | |||
7c078db879 | |||
ebb0fd6905 | |||
ed029357d1 | |||
10fa3b1878 | |||
98b0186feb | |||
35254fa6eb | |||
6706b23a0b |
@ -16,7 +16,7 @@ addons:
|
||||
apt:
|
||||
packages:
|
||||
- automake
|
||||
- autoconf
|
||||
- autoconf-archive
|
||||
- imagemagick
|
||||
- intltool
|
||||
- libcanberra-dev
|
||||
|
19
configure.ac
19
configure.ac
@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([HexChat],[2.11.0])
|
||||
AC_INIT([HexChat],[2.12.0])
|
||||
|
||||
AC_PREREQ([2.64])
|
||||
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
|
||||
@ -13,9 +13,13 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE([1.11.1 dist-xz no-dist-gzip subdir-objects no-define foreign])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AC_DEFUN([HEX_CHECK_MACRO], [m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined. Is ]$2[ installed?])])])
|
||||
|
||||
HEX_CHECK_MACRO([AX_APPEND_COMPILE_FLAGS], [autoconf-archive])
|
||||
HEX_CHECK_MACRO([PKG_PROG_PKG_CONFIG], [pkg-config])
|
||||
|
||||
AX_IS_RELEASE([minor-version])
|
||||
AX_CHECK_ENABLE_DEBUG([yes])
|
||||
AX_REQUIRE_DEFINED([PKG_PROG_PKG_CONFIG])
|
||||
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
@ -576,9 +580,12 @@ dnl *********************************************************************
|
||||
dnl ** CFLAGS ***********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
CC_CHECK_FLAGS_APPEND([CFLAGS], [CFLAGS], [ \
|
||||
AX_APPEND_COMPILE_FLAGS([\
|
||||
-pipe \
|
||||
-funsigned-char \
|
||||
-fstack-protector-strong \
|
||||
-fPIE \
|
||||
-fPIC \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wstrict-prototypes \
|
||||
@ -596,6 +603,12 @@ CC_CHECK_FLAGS_APPEND([CFLAGS], [CFLAGS], [ \
|
||||
-Werror=pointer-arith \
|
||||
])
|
||||
|
||||
AX_APPEND_LINK_FLAGS([ \
|
||||
-pie \
|
||||
-Wl,-z,relro \
|
||||
-Wl,-z,now \
|
||||
])
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
|
||||
dnl *********************************************************************
|
||||
|
@ -1,60 +0,0 @@
|
||||
dnl Macros to check the presence of generic (non-typed) symbols.
|
||||
dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes@gmail.com>
|
||||
dnl Copyright (c) 2006-2008 xine project
|
||||
dnl Copyright (c) 2012 Lucas De Marchi <lucas.de.marchi@gmail.com>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2, or (at your option)
|
||||
dnl any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
dnl 02110-1301, USA.
|
||||
dnl
|
||||
dnl As a special exception, the copyright owners of the
|
||||
dnl macro gives unlimited permission to copy, distribute and modify the
|
||||
dnl configure scripts that are the output of Autoconf when processing the
|
||||
dnl Macro. You need not follow the terms of the GNU General Public
|
||||
dnl License when using or distributing such scripts, even though portions
|
||||
dnl of the text of the Macro appear in them. The GNU General Public
|
||||
dnl License (GPL) does govern all other use of the material that
|
||||
dnl constitutes the Autoconf Macro.
|
||||
dnl
|
||||
dnl This special exception to the GPL applies to versions of the
|
||||
dnl Autoconf Macro released by this project. When you make and
|
||||
dnl distribute a modified version of the Autoconf Macro, you may extend
|
||||
dnl this special exception to the GPL to apply to your modified version as
|
||||
dnl well.
|
||||
|
||||
dnl Check if FLAG in ENV-VAR is supported by compiler and append it
|
||||
dnl to WHERE-TO-APPEND variable
|
||||
dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG])
|
||||
|
||||
AC_DEFUN([CC_CHECK_FLAG_APPEND], [
|
||||
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
|
||||
AS_TR_SH([cc_cv_$2_$3]),
|
||||
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
|
||||
eval "AS_TR_SH([$2])='$3'"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
|
||||
[eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
|
||||
[eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
|
||||
eval "AS_TR_SH([$2])='$cc_save_$2'"])
|
||||
|
||||
AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
|
||||
[eval "$1='${$1} $3'"])
|
||||
])
|
||||
|
||||
dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2])
|
||||
AC_DEFUN([CC_CHECK_FLAGS_APPEND], [
|
||||
for flag in $3; do
|
||||
CC_CHECK_FLAG_APPEND($1, $2, $flag)
|
||||
done
|
||||
])
|
||||
|
@ -1,116 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_perl_ext_flags.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PERL_EXT_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [EXTRA-MODULES])
|
||||
# AX_PERL_EXT_CFLAGS([CFLAGS-VARIABLE])
|
||||
# AX_PERL_EXT_LDFLAGS([LDFLAGS-VARIABLE], [EXTRA-MODULES])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Fetches the linker flags and C compiler flags for compiling and linking
|
||||
# programs that embed a Perl interpreter. If the EXTRA-MODULES argument is
|
||||
# submitted, it is a space separated list of extra modules to link. The
|
||||
# flags will be stored in the provided variables.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# AX_PERL_EXT_FLAGS([PERLXS_CFLAGS], [PERLXS_LDFLAGS])
|
||||
# AC_SUBST([PERLXS_CFLAGS])
|
||||
# AC_SUBST([PERLXS_LDFLAGS])
|
||||
#
|
||||
# AX_PERL_EXT_CFLAGS([PERLXS_CFLAGS])
|
||||
# AC_SUBST([PERLXS_CFLAGS])
|
||||
#
|
||||
# AX_PERL_EXT_LDFLAGS([PERLXS_LDFLAGS], [-std Socket])
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Mats Kindahl of Sun Microsystems <mats@sun.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN([AX_PERL_EXT_CFLAGS],
|
||||
[AC_CHECK_PROG(PERL,perl,perl)
|
||||
_AX_PERL_EXT_MODULE_CHECK([ExtUtils::Embed], [have_embed=yes],
|
||||
[have_embed=no])
|
||||
AS_IF([test $have_embed = no],
|
||||
AC_MSG_ERROR([Require ExtUtils::Embed to proceed]))
|
||||
_AX_PERL_EXT_EMBED_CHECK([$1],[ccopts])
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_PERL_EXT_LDFLAGS],
|
||||
[AC_CHECK_PROG(PERL,perl,perl)
|
||||
_AX_PERL_EXT_MODULE_CHECK([ExtUtils::Embed], [have_embed=yes],
|
||||
[have_embed=no])
|
||||
AS_IF([test $have_embed = no],
|
||||
AC_MSG_ERROR([Require ExtUtils::Embed to proceed]))
|
||||
_AX_PERL_EXT_EMBED_CHECK([$1],[ldopts],[$2])
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AX_PERL_EXT_FLAGS],
|
||||
[AC_CHECK_PROG(PERL,perl,perl)
|
||||
_AX_PERL_EXT_MODULE_CHECK([ExtUtils::Embed], [have_embed=yes],
|
||||
[have_embed=no])
|
||||
AS_IF([test $have_embed = no],
|
||||
AC_MSG_ERROR([Require ExtUtils::Embed to proceed]))
|
||||
_AX_PERL_EXT_EMBED_CHECK([$1],[ccopts])
|
||||
_AX_PERL_EXT_EMBED_CHECK([$2],[ldopts],[$3])
|
||||
])
|
||||
|
||||
|
||||
dnl _AX_PERL_EXT_MODULE_CHECK(MODULE-NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
|
||||
dnl
|
||||
dnl Check for the existance of the perl module given by MODULE-NAME.
|
||||
dnl
|
||||
AC_DEFUN([_AX_PERL_EXT_MODULE_CHECK],
|
||||
[AC_MSG_CHECKING([for perl module $1])
|
||||
$PERL "-M$1" -e exit > /dev/null 2>&1
|
||||
AS_IF([test $? -eq 0],
|
||||
[AC_MSG_RESULT(yes)
|
||||
$2],
|
||||
[AC_MSG_RESULT(no)
|
||||
$3])
|
||||
])
|
||||
|
||||
dnl _AX_PERL_EXT_EMBED_CHECK(VARIABLE, COMMAND, [EXTRA-FLAGS]) Use
|
||||
dnl
|
||||
dnl ExtUtils::Embed fetch flags for embedding Perl in a C/C++
|
||||
dnl application
|
||||
dnl
|
||||
AC_DEFUN([_AX_PERL_EXT_EMBED_CHECK],
|
||||
[AC_MSG_CHECKING([for perl $2 embed flags])
|
||||
ax_c_perlxs_extras="$3"
|
||||
$1=`$PERL -MExtUtils::Embed -e $2 ${ax_c_perlxs_extras:+"-- $3"}`
|
||||
AC_MSG_RESULT($$1)
|
||||
])
|
@ -1,327 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PYTHON_DEVEL([version])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
|
||||
# in your configure.ac.
|
||||
#
|
||||
# This macro checks for Python and tries to get the include path to
|
||||
# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LIBS) output
|
||||
# variables. It also exports $(PYTHON_EXTRA_LIBS) and
|
||||
# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
|
||||
#
|
||||
# You can search for some particular version of Python by passing a
|
||||
# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
|
||||
# note that you *have* to pass also an operator along with the version to
|
||||
# match, and pay special attention to the single quotes surrounding the
|
||||
# version number. Don't use "PYTHON_VERSION" for this: that environment
|
||||
# variable is declared as precious and thus reserved for the end-user.
|
||||
#
|
||||
# This macro should work for all versions of Python >= 2.1.0. As an end
|
||||
# user, you can disable the check for the python version by setting the
|
||||
# PYTHON_NOVERSIONCHECK environment variable to something else than the
|
||||
# empty string.
|
||||
#
|
||||
# If you need to use this macro for an older Python version, please
|
||||
# contact the authors. We're always open for feedback.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
|
||||
# Copyright (c) 2009 Alan W. Irwin
|
||||
# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
|
||||
# Copyright (c) 2009 Andrew Collier
|
||||
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
|
||||
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
|
||||
# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
|
||||
#
|
||||
# This program is free software: you can 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.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 18
|
||||
|
||||
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
|
||||
AC_DEFUN([AX_PYTHON_DEVEL],[
|
||||
#
|
||||
# Allow the use of a (user set) custom python version
|
||||
#
|
||||
AC_ARG_VAR([PYTHON_VERSION],[The installed Python
|
||||
version to use, for example '2.3'. This string
|
||||
will be appended to the Python interpreter
|
||||
canonical name.])
|
||||
|
||||
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
|
||||
if test -z "$PYTHON"; then
|
||||
AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for a version of Python >= 2.1.0
|
||||
#
|
||||
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
||||
ac_supports_python_ver=`$PYTHON -c "import sys; \
|
||||
ver = sys.version.split ()[[0]]; \
|
||||
print (ver >= '2.1.0')"`
|
||||
if test "$ac_supports_python_ver" != "True"; then
|
||||
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_FAILURE([
|
||||
This version of the AC@&t@_PYTHON_DEVEL macro
|
||||
doesn't work properly with versions of Python before
|
||||
2.1.0. You may need to re-run configure, setting the
|
||||
variables PYTHON_CPPFLAGS, PYTHON_LIBS, PYTHON_SITE_PKG,
|
||||
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
|
||||
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
|
||||
to something else than an empty string.
|
||||
])
|
||||
else
|
||||
AC_MSG_RESULT([skip at user request])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
#
|
||||
# if the macro parameter ``version'' is set, honour it
|
||||
#
|
||||
if test -n "$1"; then
|
||||
AC_MSG_CHECKING([for a version of Python $1])
|
||||
ac_supports_python_ver=`$PYTHON -c "import sys; \
|
||||
ver = sys.version.split ()[[0]]; \
|
||||
print (ver $1)"`
|
||||
if test "$ac_supports_python_ver" = "True"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([this package requires Python $1.
|
||||
If you have it installed, but it isn't the default Python
|
||||
interpreter in your system path, please pass the PYTHON_VERSION
|
||||
variable to configure. See ``configure --help'' for reference.
|
||||
])
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Check if you have distutils, else fail
|
||||
#
|
||||
AC_MSG_CHECKING([for the distutils Python package])
|
||||
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
|
||||
if test -z "$ac_distutils_result"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([cannot import Python module "distutils".
|
||||
Please check your Python installation. The error was:
|
||||
$ac_distutils_result])
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for Python include path
|
||||
#
|
||||
AC_MSG_CHECKING([for Python include path])
|
||||
if test -z "$PYTHON_CPPFLAGS"; then
|
||||
python_path=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_inc ());"`
|
||||
plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
|
||||
if test -n "${python_path}"; then
|
||||
if test "${plat_python_path}" != "${python_path}"; then
|
||||
python_path="-I$python_path -I$plat_python_path"
|
||||
else
|
||||
python_path="-I$python_path"
|
||||
fi
|
||||
fi
|
||||
PYTHON_CPPFLAGS=$python_path
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
|
||||
AC_SUBST([PYTHON_CPPFLAGS])
|
||||
|
||||
#
|
||||
# Check for Python library path
|
||||
#
|
||||
AC_MSG_CHECKING([for Python library path])
|
||||
if test -z "$PYTHON_LIBS"; then
|
||||
# (makes two attempts to ensure we've got a version number
|
||||
# from the interpreter)
|
||||
ac_python_version=`cat<<EOD | $PYTHON -
|
||||
|
||||
# join all versioning strings, on some systems
|
||||
# major/minor numbers could be in different list elements
|
||||
from distutils.sysconfig import *
|
||||
e = get_config_var('VERSION')
|
||||
if e is not None:
|
||||
print(e)
|
||||
EOD`
|
||||
|
||||
if test -z "$ac_python_version"; then
|
||||
if test -n "$PYTHON_VERSION"; then
|
||||
ac_python_version=$PYTHON_VERSION
|
||||
else
|
||||
ac_python_version=`$PYTHON -c "import sys; \
|
||||
print (sys.version[[:3]])"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make the versioning information available to the compiler
|
||||
AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"],
|
||||
[If available, contains the Python version number currently in use.])
|
||||
|
||||
# First, the library directory:
|
||||
ac_python_libdir=`cat<<EOD | $PYTHON -
|
||||
|
||||
# There should be only one
|
||||
import distutils.sysconfig
|
||||
e = distutils.sysconfig.get_config_var('LIBDIR')
|
||||
if e is not None:
|
||||
print (e)
|
||||
EOD`
|
||||
|
||||
# Now, for the library:
|
||||
ac_python_library=`cat<<EOD | $PYTHON -
|
||||
|
||||
import distutils.sysconfig
|
||||
c = distutils.sysconfig.get_config_vars()
|
||||
if 'LDVERSION' in c:
|
||||
print ('python'+c[['LDVERSION']])
|
||||
else:
|
||||
print ('python'+c[['VERSION']])
|
||||
EOD`
|
||||
|
||||
# This small piece shamelessly adapted from PostgreSQL python macro;
|
||||
# credits goes to momjian, I think. I'd like to put the right name
|
||||
# in the credits, if someone can point me in the right direction... ?
|
||||
#
|
||||
if test -n "$ac_python_libdir" -a -n "$ac_python_library"
|
||||
then
|
||||
# use the official shared library
|
||||
ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
|
||||
PYTHON_LIBS="-L$ac_python_libdir -l$ac_python_library"
|
||||
else
|
||||
# old way: use libpython from python_configdir
|
||||
ac_python_libdir=`$PYTHON -c \
|
||||
"from distutils.sysconfig import get_python_lib as f; \
|
||||
import os; \
|
||||
print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
|
||||
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
|
||||
fi
|
||||
|
||||
if test -z "PYTHON_LIBS"; then
|
||||
AC_MSG_ERROR([
|
||||
Cannot determine location of your Python DSO. Please check it was installed with
|
||||
dynamic libraries enabled, or try setting PYTHON_LIBS by hand.
|
||||
])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_LIBS])
|
||||
AC_SUBST([PYTHON_LIBS])
|
||||
|
||||
#
|
||||
# Check for site packages
|
||||
#
|
||||
AC_MSG_CHECKING([for Python site-packages path])
|
||||
if test -z "$PYTHON_SITE_PKG"; then
|
||||
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_lib(0,0));"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_SITE_PKG])
|
||||
AC_SUBST([PYTHON_SITE_PKG])
|
||||
|
||||
#
|
||||
# libraries which must be linked in when embedding
|
||||
#
|
||||
AC_MSG_CHECKING(python extra libraries)
|
||||
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
|
||||
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
|
||||
conf = distutils.sysconfig.get_config_var; \
|
||||
print (conf('LIBS') + ' ' + conf('SYSLIBS'))"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
|
||||
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
|
||||
|
||||
#
|
||||
# linking flags needed when embedding
|
||||
#
|
||||
AC_MSG_CHECKING(python extra linking flags)
|
||||
if test -z "$PYTHON_EXTRA_LIBS"; then
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
|
||||
conf = distutils.sysconfig.get_config_var; \
|
||||
print (conf('LINKFORSHARED'))"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
|
||||
AC_SUBST(PYTHON_EXTRA_LIBS)
|
||||
|
||||
#
|
||||
# final check to see if everything compiles alright
|
||||
#
|
||||
AC_MSG_CHECKING([consistency of all components of python development environment])
|
||||
# save current global flags
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS $PYTHON_EXTRA_LIBS"
|
||||
LDFLAGS="$ac_save_LDFLAGS $PYTHON_EXTRA_LDFLAGS"
|
||||
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
|
||||
AC_LANG_PUSH([C])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <Python.h>]],
|
||||
[[Py_Initialize();]])
|
||||
],[pythonexists=yes],[pythonexists=no])
|
||||
AC_LANG_POP([C])
|
||||
# turn back to default flags
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
|
||||
AC_MSG_RESULT([$pythonexists])
|
||||
|
||||
if test ! "x$pythonexists" = "xyes"; then
|
||||
AC_MSG_FAILURE([
|
||||
Could not link test program to Python. Maybe the main Python library has been
|
||||
installed in some non-standard library path. If so, pass it to configure,
|
||||
via the LIBS environment variable.
|
||||
Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
|
||||
============================================================================
|
||||
ERROR!
|
||||
You probably have to install the development version of the Python package
|
||||
for your distribution. The exact name of this package varies among them.
|
||||
============================================================================
|
||||
])
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
|
||||
#
|
||||
# all done!
|
||||
#
|
||||
])
|
@ -1,37 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_REQUIRE_DEFINED(MACRO)
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
|
||||
# been defined and thus are available for use. This avoids random issues
|
||||
# where a macro isn't expanded. Instead the configure script emits a
|
||||
# non-fatal:
|
||||
#
|
||||
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
|
||||
#
|
||||
# It's like AC_REQUIRE except it doesn't expand the required macro.
|
||||
#
|
||||
# Here's an example:
|
||||
#
|
||||
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 1
|
||||
|
||||
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
|
||||
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
|
||||
])dnl AX_REQUIRE_DEFINED
|
@ -40,32 +40,37 @@ int xs_parse_cpu(char *model, char *vendor, double *freq)
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__alpha__) || defined(__ia64__) || defined(__parisc__) || defined(__sparc__)
|
||||
char buffer[bsize];
|
||||
#endif
|
||||
#if defined(__powerpc__)
|
||||
char *pos = NULL;
|
||||
#endif
|
||||
FILE *fp = fopen("/proc/cpuinfo", "r");
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen("/proc/cpuinfo", "r");
|
||||
if(fp == NULL)
|
||||
return 1;
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "model name", model);
|
||||
find_match_char(buffer, "vendor_id", vendor);
|
||||
find_match_double(buffer, "cpu MHz", freq);
|
||||
}
|
||||
#endif
|
||||
#ifdef __powerpc__
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
|
||||
#elif defined(__powerpc__)
|
||||
{
|
||||
find_match_char(buffer, "cpu", model);
|
||||
find_match_char(buffer, "machine", vendor);
|
||||
find_match_double(buffer, "clock", freq);
|
||||
char *pos;
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "cpu", model);
|
||||
find_match_char(buffer, "machine", vendor);
|
||||
find_match_double(buffer, "clock", freq);
|
||||
}
|
||||
pos = strstr(model, ",");
|
||||
if (pos != NULL)
|
||||
*pos = '\0';
|
||||
}
|
||||
pos = strstr(model, ",");
|
||||
if (pos != NULL) *pos = '\0';
|
||||
#endif
|
||||
#ifdef __alpha__
|
||||
#elif defined( __alpha__)
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "cpu model", model);
|
||||
@ -73,37 +78,47 @@ int xs_parse_cpu(char *model, char *vendor, double *freq)
|
||||
find_match_double(buffer, "cycle frequency [Hz]", freq);
|
||||
}
|
||||
*freq = *freq / 1000000;
|
||||
#endif
|
||||
#ifdef __ia64__
|
||||
|
||||
#elif defined(__ia64__)
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "model", model);
|
||||
find_match_char(buffer, "vendor", vendor);
|
||||
find_match_double(buffer, "cpu MHz", freq);
|
||||
}
|
||||
#endif
|
||||
#ifdef __parisc__
|
||||
|
||||
#elif defined(__parisc__)
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "cpu ", model);
|
||||
find_match_char(buffer, "cpu family", vendor);
|
||||
find_match_double(buffer, "cpu MHz", freq);
|
||||
}
|
||||
#endif
|
||||
#ifdef __sparc__
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
FILE *fp2;
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "cpu ", model);
|
||||
find_match_char(buffer, "type ", vendor);
|
||||
find_match_double_hex(buffer, "Cpu0ClkTck", freq);
|
||||
}
|
||||
*freq = *freq / 1000000;
|
||||
#endif
|
||||
|
||||
#elif defined(__sparc__)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
FILE *fp2;
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL)
|
||||
{
|
||||
find_match_char(buffer, "cpu ", model);
|
||||
find_match_char(buffer, "type ", vendor);
|
||||
find_match_double_hex(buffer, "Cpu0ClkTck", freq);
|
||||
}
|
||||
*freq = *freq / 1000000;
|
||||
}
|
||||
#else
|
||||
|
||||
fclose(fp);
|
||||
return 1; /* Unsupported */
|
||||
|
||||
#endif
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
|
||||
server *serv = sess->server;
|
||||
char outbuf[1024];
|
||||
int ctcp_offset = 2;
|
||||
gboolean fromme = FALSE;
|
||||
|
||||
if (serv->have_idmsg && (word[4][1] == '+' || word[4][1] == '-') )
|
||||
ctcp_offset = 3;
|
||||
@ -129,7 +130,10 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
|
||||
if (ctcp_check (sess, nick, word, word_eol, word[4] + ctcp_offset))
|
||||
goto generic;
|
||||
|
||||
inbound_action (sess, to, nick, ip, msg + 7, FALSE, id, tags_data);
|
||||
if (!serv->p_cmp (nick, serv->nick))
|
||||
fromme = TRUE;
|
||||
|
||||
inbound_action (sess, to, nick, ip, msg + 7, fromme, FALSE, id, tags_data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -549,10 +549,10 @@ dcc_chat_line (struct DCC *dcc, char *line)
|
||||
if (po)
|
||||
po[0] = 0;
|
||||
inbound_action (sess, dcc->serv->nick, dcc->nick, "", line + 8, FALSE,
|
||||
FALSE, &no_tags);
|
||||
TRUE, FALSE, &no_tags);
|
||||
} else
|
||||
{
|
||||
inbound_privmsg (dcc->serv, dcc->nick, "", line, FALSE, &no_tags);
|
||||
inbound_privmsg (dcc->serv, dcc->nick, NULL, "", line, FALSE, &no_tags);
|
||||
}
|
||||
g_free (line);
|
||||
return 0;
|
||||
|
@ -145,7 +145,7 @@ inbound_open_dialog (server *serv, char *from,
|
||||
}
|
||||
|
||||
static void
|
||||
inbound_make_idtext (server *serv, char *idtext, int max, int id)
|
||||
inbound_make_idtext (server *serv, char *idtext, int max, gboolean id)
|
||||
{
|
||||
idtext[0] = 0;
|
||||
if (serv->have_idmsg || serv->have_accnotify)
|
||||
@ -163,28 +163,35 @@ inbound_make_idtext (server *serv, char *idtext, int max, int id)
|
||||
}
|
||||
|
||||
void
|
||||
inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
|
||||
inbound_privmsg (server *serv, char *from, char *to, char *ip, char *text, gboolean id,
|
||||
const message_tags_data *tags_data)
|
||||
{
|
||||
session *sess;
|
||||
struct User *user;
|
||||
char idtext[64];
|
||||
gboolean nodiag = FALSE;
|
||||
char *destsess = from;
|
||||
gboolean nodiag = FALSE, fromme = FALSE;
|
||||
|
||||
if (to && !serv->p_cmp (from, serv->nick))
|
||||
{
|
||||
fromme = TRUE;
|
||||
destsess = to;
|
||||
}
|
||||
|
||||
sess = find_dialog (serv, from);
|
||||
|
||||
if (sess || prefs.hex_gui_autoopen_dialog)
|
||||
if (!fromme && (sess || prefs.hex_gui_autoopen_dialog))
|
||||
{
|
||||
/*0=ctcp 1=priv will set hex_gui_autoopen_dialog=0 here is flud detected */
|
||||
/*0=ctcp 1=priv will set hex_gui_autoopen_dialog=0 here if flood is detected */
|
||||
if (!sess)
|
||||
{
|
||||
if (flood_check (from, ip, serv, current_sess, 1))
|
||||
{
|
||||
/* Create a dialog session */
|
||||
sess = inbound_open_dialog (serv, from, tags_data);
|
||||
}
|
||||
else
|
||||
sess = serv->server_session;
|
||||
if (!sess)
|
||||
return; /* ?? */
|
||||
}
|
||||
|
||||
if (ip && ip[0])
|
||||
@ -193,11 +200,18 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
|
||||
return;
|
||||
}
|
||||
|
||||
sess = find_session_from_nick (from, serv);
|
||||
sess = find_dialog (serv, destsess);
|
||||
if (!sess)
|
||||
{
|
||||
sess = serv->front_session;
|
||||
nodiag = TRUE; /* We don't want it to look like a normal message in front sess */
|
||||
if (fromme && prefs.hex_gui_autoopen_dialog)
|
||||
{
|
||||
sess = inbound_open_dialog (serv, destsess, tags_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
sess = serv->front_session;
|
||||
nodiag = TRUE; /* We don't want it to look like a normal message in front sess */
|
||||
}
|
||||
}
|
||||
|
||||
user = userlist_find (sess, from);
|
||||
@ -210,7 +224,16 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
|
||||
|
||||
inbound_make_idtext (serv, idtext, sizeof (idtext), id);
|
||||
|
||||
if (sess->type == SESS_DIALOG && !nodiag)
|
||||
if (fromme)
|
||||
{
|
||||
if (sess->type == SESS_DIALOG)
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_UCHANMSG, sess, from, text, NULL, idtext, 0,
|
||||
tags_data->timestamp);
|
||||
else
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_MSGSEND, sess, to, text, NULL, NULL, 0,
|
||||
tags_data->timestamp);
|
||||
}
|
||||
else if (sess->type == SESS_DIALOG && !nodiag)
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0,
|
||||
tags_data->timestamp);
|
||||
else
|
||||
@ -329,48 +352,50 @@ is_hilight (char *from, char *text, session *sess, server *serv)
|
||||
|
||||
void
|
||||
inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
|
||||
int fromme, int id, const message_tags_data *tags_data)
|
||||
gboolean fromme, gboolean fake, gboolean id, const message_tags_data *tags_data)
|
||||
{
|
||||
session *def = sess;
|
||||
server *serv = sess->server;
|
||||
struct User *user;
|
||||
char nickchar[2] = "\000";
|
||||
char idtext[64];
|
||||
int privaction = FALSE;
|
||||
char *destsess = from;
|
||||
|
||||
if (!fromme)
|
||||
if (fromme)
|
||||
destsess = chan;
|
||||
|
||||
if (!fake) /* Fake events start in the correct sess. */
|
||||
{
|
||||
if (is_channel (serv, chan))
|
||||
{
|
||||
sess = find_channel (serv, chan);
|
||||
if (!sess)
|
||||
{
|
||||
g_warning ("Got channel action for %s but found no channel session\n", chan);
|
||||
return; /* There is no sane place to put this */
|
||||
}
|
||||
} else
|
||||
{
|
||||
/* it's a private action! */
|
||||
privaction = TRUE;
|
||||
/* find a dialog tab for it */
|
||||
sess = find_dialog (serv, from);
|
||||
sess = find_dialog (serv, destsess);
|
||||
/* if non found, open a new one */
|
||||
if (!sess && prefs.hex_gui_autoopen_dialog)
|
||||
{
|
||||
/* but only if it wouldn't flood */
|
||||
if (flood_check (from, ip, serv, current_sess, 1))
|
||||
sess = inbound_open_dialog (serv, from, tags_data);
|
||||
if (flood_check (destsess, ip, serv, current_sess, 1))
|
||||
sess = inbound_open_dialog (serv, destsess, tags_data);
|
||||
else
|
||||
sess = serv->server_session;
|
||||
}
|
||||
if (!sess)
|
||||
{
|
||||
sess = find_session_from_nick (from, serv);
|
||||
/* still not good? */
|
||||
if (!sess)
|
||||
sess = serv->front_session;
|
||||
sess = serv->front_session;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!sess)
|
||||
sess = def;
|
||||
|
||||
if (sess != current_tab)
|
||||
{
|
||||
if (fromme)
|
||||
@ -385,7 +410,7 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
|
||||
lastact_update (sess);
|
||||
}
|
||||
|
||||
user = userlist_find (sess, from);
|
||||
user = userlist_find (sess, destsess);
|
||||
if (user)
|
||||
{
|
||||
nickchar[0] = user->prefix[0];
|
||||
@ -409,8 +434,19 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
|
||||
}
|
||||
|
||||
if (fromme)
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_UACTION, sess, from, text, nickchar, idtext,
|
||||
{
|
||||
if (fake || sess->type == SESS_DIALOG ||
|
||||
!serv->p_cmp (sess->channel, destsess)) /* Show normally if in correct sess */
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_UACTION, sess, from, text, nickchar, idtext,
|
||||
0, tags_data->timestamp);
|
||||
else /* There is no Action Send event, so we will just show it as CTCP.. */
|
||||
{
|
||||
char *new_text = g_strconcat ("ACTION ", text, NULL);
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CTCPSEND, sess, destsess, new_text, NULL, NULL,
|
||||
0, tags_data->timestamp);
|
||||
g_free (new_text);
|
||||
}
|
||||
}
|
||||
else if (!privaction)
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANACTION, sess, from, text, nickchar,
|
||||
idtext, 0, tags_data->timestamp);
|
||||
@ -424,7 +460,7 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
|
||||
|
||||
void
|
||||
inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
|
||||
char *text, char fromme, int id,
|
||||
char *text, gboolean fromme, gboolean id,
|
||||
const message_tags_data *tags_data)
|
||||
{
|
||||
struct User *user;
|
||||
@ -437,8 +473,18 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
|
||||
if (chan)
|
||||
{
|
||||
sess = find_channel (serv, chan);
|
||||
if (!sess && !is_channel (serv, chan))
|
||||
sess = find_dialog (serv, chan);
|
||||
if (!sess)
|
||||
{
|
||||
if (is_channel (serv, chan))
|
||||
{
|
||||
g_warning ("Got channel message to %s but found no channel session\n", chan);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
sess = find_dialog (serv, chan);
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
sess = find_dialog (serv, from);
|
||||
@ -449,8 +495,16 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
|
||||
|
||||
if (sess != current_tab)
|
||||
{
|
||||
sess->msg_said = TRUE;
|
||||
sess->new_data = FALSE;
|
||||
if (fromme)
|
||||
{
|
||||
sess->msg_said = FALSE;
|
||||
sess->new_data = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sess->msg_said = TRUE;
|
||||
sess->new_data = FALSE;
|
||||
}
|
||||
lastact_update (sess);
|
||||
}
|
||||
|
||||
@ -936,7 +990,7 @@ find_session_from_type (int type, server *serv)
|
||||
}
|
||||
|
||||
void
|
||||
inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id,
|
||||
inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, gboolean id,
|
||||
const message_tags_data *tags_data)
|
||||
{
|
||||
char *po,*ptr=to;
|
||||
@ -1724,6 +1778,7 @@ static const char * const supported_caps[] = {
|
||||
/* ZNC */
|
||||
"znc.in/server-time-iso",
|
||||
"znc.in/server-time",
|
||||
"znc.in/self-message",
|
||||
|
||||
/* Twitch */
|
||||
"twitch.tv/membership",
|
||||
|
@ -37,7 +37,7 @@ void inbound_ukick (server *serv, char *chan, char *kicker, char *reason,
|
||||
void inbound_kick (server *serv, char *chan, char *user, char *kicker,
|
||||
char *reason, const message_tags_data *tags_data);
|
||||
void inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip,
|
||||
int id, const message_tags_data *tags_data);
|
||||
gboolean id, const message_tags_data *tags_data);
|
||||
void inbound_quit (server *serv, char *nick, char *ip, char *reason,
|
||||
const message_tags_data *tags_data);
|
||||
void inbound_topicnew (server *serv, char *nick, char *chan, char *topic,
|
||||
@ -76,14 +76,14 @@ void inbound_login_start (session *sess, char *nick, char *servname,
|
||||
void inbound_login_end (session *sess, char *text,
|
||||
const message_tags_data *tags_data);
|
||||
void inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
|
||||
char *text, char fromme, int id,
|
||||
char *text, gboolean fromme, gboolean id,
|
||||
const message_tags_data *tags_data);
|
||||
void clear_channel (session *sess);
|
||||
void set_topic (session *sess, char *topic, char *stripped_topic);
|
||||
void inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
|
||||
void inbound_privmsg (server *serv, char *from, char *to, char *ip, char *text, gboolean id,
|
||||
const message_tags_data *tags_data);
|
||||
void inbound_action (session *sess, char *chan, char *from, char *ip,
|
||||
char *text, int fromme, int id,
|
||||
char *text, gboolean fromme, gboolean fake, gboolean id,
|
||||
const message_tags_data *tags_data);
|
||||
void inbound_newnick (server *serv, char *nick, char *newnick, int quiet,
|
||||
const message_tags_data *tags_data);
|
||||
|
@ -840,9 +840,7 @@ inbound_005 (server * serv, char *word[], const message_tags_data *tags_data)
|
||||
} else if (strncmp (word[w], "CASEMAPPING=", 12) == 0)
|
||||
{
|
||||
if (strcmp (word[w] + 12, "ascii") == 0) /* bahamut */
|
||||
serv->p_cmp = g_ascii_strcasecmp;
|
||||
else if (strcmp (word[w] + 12, "rfc3454") == 0)
|
||||
serv->p_cmp = rfc3454_casecmp;
|
||||
serv->p_cmp = (void *)g_ascii_strcasecmp;
|
||||
} else if (strncmp (word[w], "CHARSET=", 8) == 0)
|
||||
{
|
||||
if (g_ascii_strncasecmp (word[w] + 8, "UTF-8", 5) == 0)
|
||||
|
@ -2642,7 +2642,7 @@ cmd_me (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
if (dcc_write_chat (sess->channel, tbuf))
|
||||
{
|
||||
/* print it to screen */
|
||||
inbound_action (sess, sess->channel, sess->server->nick, "", act, TRUE, FALSE,
|
||||
inbound_action (sess, sess->channel, sess->server->nick, "", act, TRUE, TRUE, FALSE,
|
||||
&no_tags);
|
||||
} else
|
||||
{
|
||||
@ -2654,7 +2654,7 @@ cmd_me (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
sess->server->p_action (sess->server, sess->channel, split_text);
|
||||
/* print it to screen */
|
||||
inbound_action (sess, sess->channel, sess->server->nick, "",
|
||||
split_text, TRUE, FALSE,
|
||||
split_text, TRUE, TRUE, FALSE,
|
||||
&no_tags);
|
||||
|
||||
if (*split_text)
|
||||
@ -2666,7 +2666,7 @@ cmd_me (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
sess->server->p_action (sess->server, sess->channel, act + offset);
|
||||
/* print it to screen */
|
||||
inbound_action (sess, sess->channel, sess->server->nick, "",
|
||||
act + offset, TRUE, FALSE, &no_tags);
|
||||
act + offset, TRUE, TRUE, FALSE, &no_tags);
|
||||
} else
|
||||
{
|
||||
notc_msg (sess);
|
||||
@ -3439,10 +3439,9 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
}
|
||||
|
||||
/* try to associate this connection with a listed network */
|
||||
if (!serv->network)
|
||||
/* search for this hostname in the entire server list */
|
||||
serv->network = servlist_net_find_from_server (server_name);
|
||||
/* may return NULL, but that's OK */
|
||||
/* may return NULL, but that's OK */
|
||||
if ((serv->network = servlist_net_find_from_server (server_name)))
|
||||
server_set_encoding (serv, ((ircnet*)serv->network)->encoding);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -197,6 +197,7 @@ identd_start_server (void)
|
||||
{
|
||||
hexchat_printf (ph, _("*\tError starting identd server: %s"), error->message);
|
||||
|
||||
g_error_free (error);
|
||||
g_clear_object (&service);
|
||||
return;
|
||||
}
|
||||
|
@ -1256,7 +1256,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
{
|
||||
if (ignore_check (word[1], IG_PRIV))
|
||||
return;
|
||||
inbound_privmsg (serv, nick, ip, text, id, tags_data);
|
||||
inbound_privmsg (serv, nick, to, ip, text, id, tags_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1728,7 +1728,8 @@ server_set_defaults (server *serv)
|
||||
serv->nick_modes = g_strdup ("ohv");
|
||||
serv->sasl_mech = MECH_PLAIN;
|
||||
|
||||
server_set_encoding (serv, "UTF-8");
|
||||
if (!serv->encoding)
|
||||
server_set_encoding (serv, "UTF-8");
|
||||
|
||||
serv->nickcount = 1;
|
||||
serv->end_of_motd = FALSE;
|
||||
|
@ -714,8 +714,19 @@ servlist_net_find_from_server (char *server_name)
|
||||
slist = net->servlist;
|
||||
while (slist)
|
||||
{
|
||||
gsize hostname_len;
|
||||
const char *hostname, *p;
|
||||
|
||||
serv = slist->data;
|
||||
if (g_ascii_strcasecmp (serv->hostname, server_name) == 0)
|
||||
hostname = serv->hostname;
|
||||
|
||||
/* Ignore port when comparing */
|
||||
if ((p = strchr (hostname, '/')))
|
||||
hostname_len = p - hostname;
|
||||
else
|
||||
hostname_len = strlen (hostname);
|
||||
|
||||
if (g_ascii_strncasecmp (hostname, server_name, hostname_len) == 0)
|
||||
return net;
|
||||
slist = slist->next;
|
||||
}
|
||||
|
@ -1018,33 +1018,6 @@ make_ping_time (void)
|
||||
return (timev.tv_sec - 50000) * 1000 + timev.tv_usec/1000;
|
||||
}
|
||||
|
||||
/*
|
||||
* https://tools.ietf.org/html/rfc3454
|
||||
*/
|
||||
int
|
||||
rfc3454_casecmp (const char *s1, const char *s2)
|
||||
{
|
||||
char *s1_lower, *s2_lower, *s1_normal, *s2_normal;
|
||||
int ret;
|
||||
|
||||
if (strcmp (s1, s2) == 0)
|
||||
return 0; /* Exact same already */
|
||||
|
||||
s1_lower = g_utf8_casefold(s1, -1);
|
||||
s2_lower = g_utf8_casefold(s2, -1);
|
||||
s1_normal = g_utf8_normalize(s1_lower, -1, G_NORMALIZE_NFKC);
|
||||
s2_normal = g_utf8_normalize(s2_lower, -1, G_NORMALIZE_NFKC);
|
||||
|
||||
ret = strcmp (s1_normal, s2_normal);
|
||||
|
||||
g_free (s1_normal);
|
||||
g_free (s2_normal);
|
||||
g_free (s1_lower);
|
||||
g_free (s2_lower);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* This technique was borrowed in part from the source code to
|
||||
|
@ -44,7 +44,6 @@ char *file_part (char *file);
|
||||
void for_files (char *dirname, char *mask, void callback (char *file));
|
||||
int rfc_casecmp (const char *, const char *);
|
||||
int rfc_ncasecmp (char *, char *, int);
|
||||
int rfc3454_casecmp (const char *s1, const char *s2) G_GNUC_PURE;
|
||||
int buf_get_line (char *, char **, int *, int len);
|
||||
char *nocasestrstr (const char *text, const char *tofind);
|
||||
char *country (char *);
|
||||
|
@ -56,7 +56,7 @@
|
||||
<None Include="changelog.url" />
|
||||
<None Include="readme.url" />
|
||||
|
||||
<Engines Include="$(DepsRoot)\lib\gtk-2.0\i686-pc-vs10\engines\**\*" />
|
||||
<Engines Include="$(DepsRoot)\lib\gtk-2.0\i686-pc-vs14\engines\**\*" />
|
||||
|
||||
<Share Include="share\**\*" />
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<Target Name="Build">
|
||||
<Copy SourceFiles="@(None)" DestinationFolder="$(HexChatRel)" />
|
||||
<Copy SourceFiles="@(Engines)" DestinationFiles="@(Engines->'$(HexChatRel)\lib\gtk-2.0\i686-pc-vs10\engines\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(Engines)" DestinationFiles="@(Engines->'$(HexChatRel)\lib\gtk-2.0\i686-pc-vs14\engines\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(Share)" DestinationFiles="@(Share->'$(HexChatRel)\share\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(DepsRootDocs)" DestinationFiles="@(DepsRootDocs->'$(HexChatRel)\share\doc\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="..\..\COPYING" DestinationFolder="$(HexChatRel)\share\doc\hexchat" />
|
||||
|
@ -9,7 +9,7 @@
|
||||
<YourMsgfmtPath>c:\gtk-build\msgfmt</YourMsgfmtPath>
|
||||
<YourPerlPath>c:\gtk-build\perl-5.20</YourPerlPath>
|
||||
<YourPython2Path>c:\gtk-build\python-2.7</YourPython2Path>
|
||||
<YourPython3Path>c:\gtk-build\python-3.4</YourPython3Path>
|
||||
<YourPython3Path>c:\gtk-build\python-3.5</YourPython3Path>
|
||||
<YourWinSparklePath>c:\gtk-build\WinSparkle</YourWinSparklePath>
|
||||
|
||||
<!-- YOU SHOULDN'T TOUCH ANYTHING BELOW -->
|
||||
@ -27,7 +27,7 @@
|
||||
<Python2Lib>python27</Python2Lib>
|
||||
<Python2Output>hcpython2</Python2Output>
|
||||
<Python3Path>$(YourPython3Path)\$(PlatformName)</Python3Path>
|
||||
<Python3Lib>python34</Python3Lib>
|
||||
<Python3Lib>python35</Python3Lib>
|
||||
<Python3Output>hcpython3</Python3Output>
|
||||
<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include;$(DepsRoot)\include\libxml2</Glib>
|
||||
<Gtk>$(DepsRoot)\include\gtk-2.0;$(DepsRoot)\lib\gtk-2.0\include;$(DepsRoot)\include\atk-1.0;$(DepsRoot)\include\cairo;$(DepsRoot)\include\pango-1.0;$(DepsRoot)\include\gdk-pixbuf-2.0</Gtk>
|
||||
|
@ -75,7 +75,7 @@ Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disable
|
||||
Name: "langs\perl"; Description: "Perl (requires Perl 5.20)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\python"; Description: "Python Interface"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\python\python2"; Description: "Python (requires Python 2.7)"; Types: custom; Flags: disablenouninstallwarning exclusive
|
||||
Name: "langs\python\python3"; Description: "Python (requires Python 3.4)"; Types: custom; Flags: disablenouninstallwarning exclusive
|
||||
Name: "langs\python\python3"; Description: "Python (requires Python 3.5)"; Types: custom; Flags: disablenouninstallwarning exclusive
|
||||
|
||||
[Tasks]
|
||||
Name: portable; Description: "Yes"; GroupDescription: "Portable Mode: Stores configuration files within install directory for portable drives."; Flags: unchecked
|
||||
@ -102,6 +102,7 @@ Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; Status
|
||||
Filename: "{tmp}\dotnet4.exe"; Parameters: "/q /norestart"; StatusMsg: "Installing .NET"; Components: xtm; Flags: skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\spelling-dicts.exe"; Parameters: "/verysilent"; StatusMsg: "Installing Spelling Dictionaries"; Components: spell; Flags: skipifdoesntexist; Tasks: not portable
|
||||
|
||||
[Files]
|
||||
@ -152,7 +153,7 @@ Source: "plugins\hcnotifications-winrt.dll"; DestDir: "{app}\plugins"; Flags: ig
|
||||
|
||||
Source: "lib\enchant\*"; DestDir: "{app}\lib\enchant"; Flags: ignoreversion; Components: libs
|
||||
|
||||
Source: "lib\gtk-2.0\i686-pc-vs10\engines\*"; DestDir: "{app}\lib\gtk-2.0\i686-pc-vs10\engines"; Flags: ignoreversion; Components: libs
|
||||
Source: "lib\gtk-2.0\i686-pc-vs14\engines\*"; DestDir: "{app}\lib\gtk-2.0\i686-pc-vs14\engines"; Flags: ignoreversion; Components: libs
|
||||
|
||||
Source: "plugins\hcchecksum.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\checksum
|
||||
Source: "plugins\hcdoat.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\doat
|
||||
@ -270,13 +271,13 @@ begin
|
||||
#if APPARCH == "x64"
|
||||
REDIST := 'https://dl.hexchat.net/misc/vcredist_2015_x64.exe';
|
||||
PERL := 'https://dl.hexchat.net/misc/perl/Perl%205.20.0%20x64.msi';
|
||||
PY2 := 'http://python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi';
|
||||
PY3 := 'http://python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi';
|
||||
PY2 := 'http://python.org/ftp/python/2.7.10/python-2.7.10.amd64.msi';
|
||||
PY3 := 'http://python.org/ftp/python/3.5.1/python-3.5.1-amd64.exe';
|
||||
#else
|
||||
REDIST := 'https://dl.hexchat.net/misc/vcredist_2015_x86.exe';
|
||||
PERL := 'https://dl.hexchat.net/misc/perl/Perl%205.20.0%20x86.msi';
|
||||
PY2 := 'http://python.org/ftp/python/2.7.8/python-2.7.8.msi';
|
||||
PY3 := 'http://python.org/ftp/python/3.4.1/python-3.4.1.msi';
|
||||
PY2 := 'http://python.org/ftp/python/2.7.10/python-2.7.10.msi';
|
||||
PY3 := 'http://python.org/ftp/python/3.5.1/python-3.5.1.exe';
|
||||
#endif
|
||||
DOTNET := 'https://dl.hexchat.net/misc/dotnet_40.exe';
|
||||
SPELL := 'https://dl.hexchat.net/hexchat/HexChat%20Spelling%20Dictionaries%20r2.exe';
|
||||
@ -298,8 +299,8 @@ begin
|
||||
if IsComponentSelected('langs\python\python2') and not CheckDLL('python27.dll') then
|
||||
idpAddFile(PY2, ExpandConstant('{tmp}\python.msi'));
|
||||
|
||||
if IsComponentSelected('langs\python\python3') and not CheckDLL('python34.dll') then
|
||||
idpAddFile(PY3, ExpandConstant('{tmp}\python.msi'));
|
||||
if IsComponentSelected('langs\python\python3') and not CheckDLL('python35.dll') then
|
||||
idpAddFile(PY3, ExpandConstant('{tmp}\python.exe'));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
@ -1 +1 @@
|
||||
2.10.2
|
||||
2.12.0
|
Reference in New Issue
Block a user