Python build fixes
This commit is contained in:
parent
f1eda8acff
commit
5576d7a094
@ -18,7 +18,7 @@ DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto
|
|||||||
|
|
||||||
EXE_LIST=${EXE}/telegram-cli
|
EXE_LIST=${EXE}/telegram-cli
|
||||||
|
|
||||||
TG_OBJECTS=${OBJ}/main.o ${OBJ}/loop.o ${OBJ}/interface.o ${OBJ}/lua-tg.o ${OBJ}/json-tg.o ${OBJ}/python-tg.o
|
TG_OBJECTS=${OBJ}/main.o ${OBJ}/loop.o ${OBJ}/interface.o ${OBJ}/lua-tg.o ${OBJ}/json-tg.o ${OBJ}/python-tg.o ${OBJ}/python-types.o
|
||||||
|
|
||||||
INCLUDE=-I. -I${srcdir} -I${srcdir}/tgl
|
INCLUDE=-I. -I${srcdir} -I${srcdir}/tgl
|
||||||
CC=@CC@
|
CC=@CC@
|
||||||
|
@ -56,8 +56,7 @@
|
|||||||
AC_DEFUN([AX_PYTHON],
|
AC_DEFUN([AX_PYTHON],
|
||||||
[AC_MSG_CHECKING(for python build information)
|
[AC_MSG_CHECKING(for python build information)
|
||||||
AC_MSG_RESULT([])
|
AC_MSG_RESULT([])
|
||||||
for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
|
for python in python3.4 python3.3 python3.2 python3.1 python3 python2.7 python2.6 python2 python; do
|
||||||
|
|
||||||
AC_CHECK_PROGS(PYTHON_BIN, [$python])
|
AC_CHECK_PROGS(PYTHON_BIN, [$python])
|
||||||
ax_python_bin=$PYTHON_BIN
|
ax_python_bin=$PYTHON_BIN
|
||||||
if test x$ax_python_bin != x; then
|
if test x$ax_python_bin != x; then
|
||||||
|
6
configure
vendored
6
configure
vendored
@ -5947,8 +5947,7 @@ $as_echo "enabled" >&6; }
|
|||||||
$as_echo_n "checking for python build information... " >&6; }
|
$as_echo_n "checking for python build information... " >&6; }
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
|
||||||
$as_echo "" >&6; }
|
$as_echo "" >&6; }
|
||||||
for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
|
for python in python3.4 python3.3 python3.2 python3.1 python3 python2.7 python2.6 python2 python; do
|
||||||
|
|
||||||
for ac_prog in $python
|
for ac_prog in $python
|
||||||
do
|
do
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
@ -6139,8 +6138,7 @@ $as_echo "enabled" >&6; }
|
|||||||
$as_echo_n "checking for python build information... " >&6; }
|
$as_echo_n "checking for python build information... " >&6; }
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
|
||||||
$as_echo "" >&6; }
|
$as_echo "" >&6; }
|
||||||
for python in python3.4 python3.3 python3.2 python3.1 python2.7 python2.6 python3, python2, python; do
|
for python in python3.4 python3.3 python3.2 python3.1 python3 python2.7 python2.6 python2 python; do
|
||||||
|
|
||||||
for ac_prog in $python
|
for ac_prog in $python
|
||||||
do
|
do
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
|
4
loop.c
4
loop.c
@ -56,8 +56,12 @@
|
|||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
#include "telegram.h"
|
#include "telegram.h"
|
||||||
#include "loop.h"
|
#include "loop.h"
|
||||||
|
#if USE_LUA
|
||||||
#include "lua-tg.h"
|
#include "lua-tg.h"
|
||||||
|
#endif
|
||||||
|
#if USE_PYTHON
|
||||||
#include "python-tg.h"
|
#include "python-tg.h"
|
||||||
|
#endif
|
||||||
#include <tgl/tgl.h>
|
#include <tgl/tgl.h>
|
||||||
#include <tgl/tgl-binlog.h>
|
#include <tgl/tgl-binlog.h>
|
||||||
#include <tgl/tgl-net.h>
|
#include <tgl/tgl-net.h>
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#ifdef USE_PYTHON
|
#ifdef USE_PYTHON
|
||||||
#include "python-tg.h"
|
#include "python-tg.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -1251,3 +1250,4 @@ void py_init (const char *file) {
|
|||||||
logprintf("Python Initialized\n");
|
logprintf("Python Initialized\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_PYTHON
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#include <tgl/tgl.h>
|
#include <tgl/tgl.h>
|
||||||
#include <tgl/tools.h>
|
#include <tgl/tools.h>
|
||||||
@ -120,10 +125,9 @@ tgl_Peer_getuser_id (tgl_Peer *self, void *closure)
|
|||||||
static PyObject *
|
static PyObject *
|
||||||
tgl_Peer_getuser_list (tgl_Peer *self, void *closure)
|
tgl_Peer_getuser_list (tgl_Peer *self, void *closure)
|
||||||
{
|
{
|
||||||
PyObject *ret, *peer;
|
PyObject *ret;
|
||||||
int i;
|
int i;
|
||||||
struct tgl_chat_user *user_list;
|
struct tgl_chat_user *user_list;
|
||||||
struct tgl_user *user;
|
|
||||||
|
|
||||||
switch(self->peer->id.type) {
|
switch(self->peer->id.type) {
|
||||||
case TGL_PEER_CHAT:
|
case TGL_PEER_CHAT:
|
||||||
@ -382,7 +386,7 @@ tgl_Peer_send_msg (tgl_Peer *self, PyObject *args, PyObject *kwargs)
|
|||||||
else
|
else
|
||||||
api_call = Py_BuildValue("Os", (PyObject*) self, message);
|
api_call = Py_BuildValue("Os", (PyObject*) self, message);
|
||||||
|
|
||||||
Py_XINCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
Py_XINCREF(api_call);
|
Py_XINCREF(api_call);
|
||||||
|
|
||||||
return py_send_msg(Py_None, api_call);
|
return py_send_msg(Py_None, api_call);
|
||||||
@ -868,3 +872,5 @@ tgl_Msg_FromTglMsg(struct tgl_message *msg) {
|
|||||||
self->msg = msg;
|
self->msg = msg;
|
||||||
return (PyObject *) self;
|
return (PyObject *) self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user