Add modpython module which allows to write ZNC modules on python3.

Notice for distro maintainers: perl interpreter is required to compile modpython.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2196 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
darthgandalf committed 2010-12-22 14:52:53 +00:00
1 parent c7c0d1714c
commit a564e25c13
11 files changed
+2440 -96

No files matched your search

Vendored
+216 -68
View File
@@ -556,6 +556,7 @@ PACKAGE_URL=''
ac_unique_file="znc.cpp"
ac_subst_vars='LTLIBOBJS
LIBOBJS
PERL
DATADIR
MODDIR
LIBICONV
@@ -568,8 +569,9 @@ MODLINK
LIBZNCDIR
LIBZNC
MODFLAGS
SWIG_BINARY
PYTHONCFG_BINARY
PERL_BINARY
SWIG_BINARY
openssl_LIBS
openssl_CFLAGS
c_ares_LIBS
@@ -643,6 +645,7 @@ enable_debug
enable_ipv6
enable_openssl
enable_perl
enable_python
enable_swig
enable_sasl
enable_optimization
@@ -1292,12 +1295,18 @@ Optional Features:
--disable-ipv6 disable ipv6 support
--disable-openssl disable openssl
--enable-perl enable perl
--enable-python[=python3-config]
enable python. By default python3-config is used,
but you can use another name if your python3-config
has another name.
--disable-swig Disable automatic generation of source files needed
for modperl. This value is ignored if perl is
disabled or not found. If you disable swig, but
still want to use modperl, please download the
necessary files to modules/modperl. Check
http://en.znc.in/wiki/Modperl for details.
for modperl/modpython. This value is ignored if perl
and python are disabled. If you disable swig, but
still want to use these modules, please download the
necessary files to modules/modperl and/or to
modules/modpython. Check
http://en.znc.in/wiki/Modperl and
http://en.znc.in/wiki/Modpython for details.
--enable-sasl enable sasl
--disable-optimization Disable some compiler optimizations to decrease
memory usage while compiling
@@ -2926,6 +2935,13 @@ else
PERL="no"
fi
# Check whether --enable-python was given.
if test "${enable_python+set}" = set; then :
enableval=$enable_python; PYTHON="$enableval"
else
PYTHON="no"
fi
# Check whether --enable-swig was given.
if test "${enable_swig+set}" = set; then :
enableval=$enable_swig; SWIG="$enableval"
@@ -3675,9 +3691,76 @@ else
# (dynamic_lookup might only work on 10.4 and later)
fi
if test "x$PERL" != xno -o "x$PYTHON" != xno; then
old_SWIG="$SWIG"
if test "x$SWIG" != "xno"; then
# Extract the first word of "swig", so it can be a program name with args.
set dummy swig; 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_SWIG_BINARY+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $SWIG_BINARY in
[\\/]* | ?:[\\/]*)
ac_cv_path_SWIG_BINARY="$SWIG_BINARY" # 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_SWIG_BINARY="$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
SWIG_BINARY=$ac_cv_path_SWIG_BINARY
if test -n "$SWIG_BINARY"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_BINARY" >&5
$as_echo "$SWIG_BINARY" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -z "$SWIG_BINARY" && SWIG=no
fi
if test "x$SWIG" = xno; then
SWIG_BINARY=""
if test "x$old_SWIG" = xno; then
SWIG="no, need manual download for perl/python bindings"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: swig was disabled, so you should put needed sources to modules/
Please check http://en.znc.in/wiki/Modperl or http://en.znc.in/wiki/Modpython for details." >&5
$as_echo "$as_me: WARNING: swig was disabled, so you should put needed sources to modules/
Please check http://en.znc.in/wiki/Modperl or http://en.znc.in/wiki/Modpython for details." >&2;}
else
as_fn_error $? "swig was not found. Try --disable-perl --disable-python, or download the necessary sources and use --disable-swig.
Please check http://en.znc.in/wiki/Modperl or http://en.znc.in/wiki/Modpython for details." "$LINENO" 5
fi
else
SWIG=yes
fi
else
if test "x$SWIG" = "xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: swig is needed only for perl and python, but both are disabled. Disabling swig." >&5
$as_echo "$as_me: WARNING: swig is needed only for perl and python, but both are disabled. Disabling swig." >&2;}
fi
SWIG=no
fi
if test "x$PERL" != "xno"; then
old_PERL="$PERL"
old_SWIG="$SWIG"
# 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
@@ -3763,53 +3846,6 @@ else
PERL="no"
fi
if test "x$PERL" != "xno"; then
if test "x$SWIG" != "xno"; then
# Extract the first word of "swig", so it can be a program name with args.
set dummy swig; 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_SWIG_BINARY+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $SWIG_BINARY in
[\\/]* | ?:[\\/]*)
ac_cv_path_SWIG_BINARY="$SWIG_BINARY" # 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_SWIG_BINARY="$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
SWIG_BINARY=$ac_cv_path_SWIG_BINARY
if test -n "$SWIG_BINARY"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_BINARY" >&5
$as_echo "$SWIG_BINARY" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$SWIG_BINARY"; then
SWIG="no"
fi
fi
fi
LDFLAGS="$my_saved_LDFLAGS"
else
PERL="no"
@@ -3827,22 +3863,131 @@ $as_echo "$as_me: WARNING: perl was not found and thus disabled" >&2;}
PERL_BINARY=""
else
if test "x$SWIG" = "xno"; then
SWIG_BINARY=""
if test "x$old_SWIG" = "xno"; then
PERL="yes, but with manual download"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: swig was disabled, so you should put needed sources for modperl to modules/modperl.
Please check http://en.znc.in/wiki/Modperl for details." >&5
$as_echo "$as_me: WARNING: swig was disabled, so you should put needed sources for modperl to modules/modperl.
Please check http://en.znc.in/wiki/Modperl for details." >&2;}
else
as_fn_error $? "swig was not found. Try --disable-perl, or download the necessary sources and use --disable-swig.
Please check http://en.znc.in/wiki/Modperl for details." "$LINENO" 5
PERL="yes"
fi
fi
if test "x$PYTHON" != "xno"; then
# Default value for just --enable-python
if test "x$PYTHON" = "xyes"; then
PYTHON="python3-config"
fi
old_PYTHON="$PYTHON"
# Extract the first word of ""$PYTHON"", so it can be a program name with args.
set dummy "$PYTHON"; 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_PYTHONCFG_BINARY+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $PYTHONCFG_BINARY in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHONCFG_BINARY="$PYTHONCFG_BINARY" # 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_PYTHONCFG_BINARY="$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
PYTHONCFG_BINARY=$ac_cv_path_PYTHONCFG_BINARY
if test -n "$PYTHONCFG_BINARY"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONCFG_BINARY" >&5
$as_echo "$PYTHONCFG_BINARY" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -n "$PYTHONCFG_BINARY"; then
my_saved_LDFLAGS="$LDFLAGS"
appendLD `$PYTHONCFG_BINARY --includes`
appendLD `$PYTHONCFG_BINARY --ldflags`
ac_fn_cxx_check_func "$LINENO" "Py_Initialize" "ac_cv_func_Py_Initialize"
if test "x$ac_cv_func_Py_Initialize" = x""yes; then :
else
PYTHON="no"
fi
if test "x$PYTHON" != "xno"; then
# Yes, modpython depends on perl.
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_path_PERL_BINARY+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $PERL_BINARY in
[\\/]* | ?:[\\/]*)
ac_cv_path_PERL_BINARY="$PERL_BINARY" # 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_PERL_BINARY="$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
PERL_BINARY=$ac_cv_path_PERL_BINARY
if test -n "$PERL_BINARY"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_BINARY" >&5
$as_echo "$PERL_BINARY" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$PERL_BINARY"; then
as_fn_error $? "To compile modpython you need to be able to execute perl scripts. Try --disable-python or install perl." "$LINENO" 5
fi
else
PERL="yes"
SWIG="yes"
fi
LDFLAGS="$my_saved_LDFLAGS"
else
PYTHON="no"
fi
if test "x$PYTHON" = "xno"; then
# This looks better in the summary at the end
PYTHON="not found"
if test "x$old_PYTHON" != "xauto" ; then
as_fn_error $? "python not found. Try --disable-python." "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: python was not found and thus disabled" >&5
$as_echo "$as_me: WARNING: python was not found and thus disabled" >&2;}
fi
PYTHONCFG_BINARY=""
else
PYTHON="yes"
fi
fi
@@ -4085,6 +4230,7 @@ appendCXX "-D_DATADIR_=\\\"${DATADIR}\\\""
ac_config_files="$ac_config_files Makefile"
ac_config_files="$ac_config_files znc-config"
@@ -5273,6 +5419,8 @@ echo "ipv6: $IPV6"
echo "openssl: $SSL"
echo "c-ares: $ARES"
echo "perl: $PERL"
echo "python: $PYTHON"
echo "swig: $SWIG"
if test x"$SASL" = "x" ; then
echo "sasl: no"
else