Python build fixes

This commit is contained in:
Vincent Castellano 2015-05-20 10:55:06 -07:00
parent f1eda8acff
commit 5576d7a094
6 changed files with 18 additions and 11 deletions

View File

@ -18,7 +18,7 @@ DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto
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
CC=@CC@

View File

@ -56,8 +56,7 @@
AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information)
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])
ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then

6
configure vendored
View File

@ -5947,8 +5947,7 @@ $as_echo "enabled" >&6; }
$as_echo_n "checking for python build information... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
$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
do
# 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 "$as_me:${as_lineno-$LINENO}: result: " >&5
$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
do
# Extract the first word of "$ac_prog", so it can be a program name with args.

4
loop.c
View File

@ -56,8 +56,12 @@
#include "interface.h"
#include "telegram.h"
#include "loop.h"
#if USE_LUA
#include "lua-tg.h"
#endif
#if USE_PYTHON
#include "python-tg.h"
#endif
#include <tgl/tgl.h>
#include <tgl/tgl-binlog.h>
#include <tgl/tgl-net.h>

View File

@ -24,7 +24,6 @@
#ifdef USE_PYTHON
#include "python-tg.h"
#endif
#include <string.h>
#include <stdlib.h>
@ -1251,3 +1250,4 @@ void py_init (const char *file) {
logprintf("Python Initialized\n");
}
#endif

View File

@ -1,4 +1,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef USE_PYTHON
#include <Python.h>
#include <tgl/tgl.h>
#include <tgl/tools.h>
@ -120,10 +125,9 @@ tgl_Peer_getuser_id (tgl_Peer *self, void *closure)
static PyObject *
tgl_Peer_getuser_list (tgl_Peer *self, void *closure)
{
PyObject *ret, *peer;
PyObject *ret;
int i;
struct tgl_chat_user *user_list;
struct tgl_user *user;
switch(self->peer->id.type) {
case TGL_PEER_CHAT:
@ -382,7 +386,7 @@ tgl_Peer_send_msg (tgl_Peer *self, PyObject *args, PyObject *kwargs)
else
api_call = Py_BuildValue("Os", (PyObject*) self, message);
Py_XINCREF(Py_None);
Py_INCREF(Py_None);
Py_XINCREF(api_call);
return py_send_msg(Py_None, api_call);
@ -868,3 +872,5 @@ tgl_Msg_FromTglMsg(struct tgl_message *msg) {
self->msg = msg;
return (PyObject *) self;
}
#endif