aboutsummaryrefslogtreecommitdiffstats
path: root/wlp
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2013-09-08 22:29:44 +0200
committerMatěj Cepl <mcepl@redhat.com>2013-09-08 22:29:44 +0200
commitaa233606dc5358292f26808439bd60836a9b5dfe (patch)
tree097a6fa9a952a8d77161f219c5c8b38da086099e /wlp
parentc50ce75f2e06b6b8abe49e34775d343b74f7e8cd (diff)
downloadpyg-aa233606dc5358292f26808439bd60836a9b5dfe.tar.gz
New version from Debian0.9.8
Diffstat (limited to 'wlp')
-rw-r--r--wlp/C/Makefile7
-rw-r--r--wlp/C/commands.y1
-rw-r--r--wlp/C/wlp.c31
-rw-r--r--wlp/Makefile14
-rw-r--r--wlp/README2
-rw-r--r--wlp/module/Makefile.pre.in10
6 files changed, 24 insertions, 41 deletions
diff --git a/wlp/C/Makefile b/wlp/C/Makefile
index 6bc8fc3..961690d 100644
--- a/wlp/C/Makefile
+++ b/wlp/C/Makefile
@@ -9,6 +9,11 @@ AROPTS=-rs
FLEXOPTS=
YACCOPTS=-d
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
SRCDIR=.
BINDIR=.
@@ -40,4 +45,4 @@ structs:
$(CC) $(CCSHARED) $(CCOPTS) -c structs.c -o structs.o
clean:
- -rm $(OBJFILE) lex.yy.c commands.tab.h commands.tab.c wlp.a yytest
+ rm -f $(OBJFILE) lex.yy.c commands.tab.h commands.tab.c wlp.a yytest
diff --git a/wlp/C/commands.y b/wlp/C/commands.y
index 8b720d7..e6cfb18 100644
--- a/wlp/C/commands.y
+++ b/wlp/C/commands.y
@@ -3,6 +3,7 @@
/*#define YYSTYPE char**/
/*#define DEBUG*/
#include "macro.h"
+#include "string.h"
%}
%union {
diff --git a/wlp/C/wlp.c b/wlp/C/wlp.c
index 8c0779d..6a36617 100644
--- a/wlp/C/wlp.c
+++ b/wlp/C/wlp.c
@@ -6,7 +6,6 @@
* Thanks to md for this useful formula. Beer is beer.
*/
-//#include <python/Python.h>
#include <Python.h>
#include <stdio.h>
#include <unistd.h>
@@ -20,8 +19,6 @@ static FILE *fd = NULL;
struct wlp_list_t *list;
static PyObject *node2dict(struct wlp_node_t *node);
-static PyObject *node2dict2(struct wlp_node_t *node);
-
@@ -37,7 +34,7 @@ static PyObject *wlp_setfilebyname(PyObject *self, PyObject *args) {
if (!PyArg_ParseTuple(args, "s", &file))
return NULL;
- if(fd = fopen(file,"r")) {
+ if((fd = fopen(file,"r"))) {
return Py_None;
} else {
PyErr_SetFromErrno(PyExc_Exception);
@@ -144,32 +141,6 @@ static PyObject *node2dict(struct wlp_node_t *node) {
}
-
-/*
- * node2dict2(): transoform a wlp_node_t node in a python dictionary of the form
- * { 'owner': ownername, var: val}
- * it's currently unused (obsoleted)
- */
-
-static PyObject *node2dict2(struct wlp_node_t *node) {
- PyObject *dict = PyDict_New();
-
- if(!dict)
- dict = Py_None;
- else {
- PyDict_SetItem(dict,
- Py_BuildValue("s","owner"),
- Py_BuildValue("s",node->owner));
-
- PyDict_SetItem(dict,
- Py_BuildValue("s",node->left),
- Py_BuildValue("s",node->right));
- }
-
- return dict;
-
-}
-
static PyMethodDef wlp_methods[] = {
{"mkdict", wlp_mkdict, METH_VARARGS},
{"setfilebyname", wlp_setfilebyname, METH_VARARGS},
diff --git a/wlp/Makefile b/wlp/Makefile
index 4e180d1..7480b47 100644
--- a/wlp/Makefile
+++ b/wlp/Makefile
@@ -28,15 +28,15 @@ makemodule:
clean: cleanmodule cleansrc
- -rm $(BINDIR)/*.so
+ rm -f $(BINDIR)/*.so
cleansrc:
- -$(MAKE) -C $(CSRCDIR) clean
+ $(MAKE) -C $(CSRCDIR) clean
cleanmodule:
- -$(MAKE) -C $(MODULEDIR) clean
- -rm $(MODULEDIR)/Makefile.pre $(MODULEDIR)/Makefile
- -rm $(MODULEDIR)/config.c
- -rm $(MODULEDIR)/sedscript
- -rm $(MODULEDIR)/Setup
+ @if test -f $(MODULEDIR)/Makefile; then $(MAKE) -C $(MODULEDIR) clean ;fi
+ rm -f $(MODULEDIR)/Makefile.pre $(MODULEDIR)/Makefile
+ rm -f $(MODULEDIR)/config.c
+ rm -f $(MODULEDIR)/sedscript
+ rm -f $(MODULEDIR)/Setup
diff --git a/wlp/README b/wlp/README
index a2f97a0..9c4d9b7 100644
--- a/wlp/README
+++ b/wlp/README
@@ -9,4 +9,4 @@ make -C module # to really make .so python module
Please, remeber to report full output.
-Cosimo Alfarano <alfarano@cs.unibo.it>
+Cosimo Alfarano <kalfa@debian.org>
diff --git a/wlp/module/Makefile.pre.in b/wlp/module/Makefile.pre.in
index 05f108b..fce3177 100644
--- a/wlp/module/Makefile.pre.in
+++ b/wlp/module/Makefile.pre.in
@@ -94,8 +94,12 @@ TARGET= python
# Installed python binary (used only by boot target)
PYTHON= python
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
# Add more -I and -D options here
-CFLAGS= $(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY) $(DEFS)
+CFLAGS=$(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY) $(DEFS) $(shell dpkg-buildflags --get CFLAGS)
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
# These two variables can be set in Setup to merge extensions.
# See example[23].
@@ -126,12 +130,13 @@ RANLIB= @RANLIB@
MACHDEP= @MACHDEP@
SO= @SO@
LDSHARED= @LDSHARED@
+BLDSHARED= @BLDSHARED@
CCSHARED= @CCSHARED@
LINKFORSHARED= @LINKFORSHARED@
CXX= @CXX@
# Install prefix for architecture-independent files
-prefix= /usr/local
+prefix= /usr
# Install prefix for architecture-dependent files
exec_prefix= $(prefix)
@@ -264,6 +269,7 @@ sedscript: $(MAKEFILE)
-e '/^MACHDEP=/s/^MACHDEP=[ ]*\(.*\)/s%@MACHDEP[@]%\1%/p' \
-e '/^SO=/s/^SO=[ ]*\(.*\)/s%@SO[@]%\1%/p' \
-e '/^LDSHARED=/s/^LDSHARED=[ ]*\(.*\)/s%@LDSHARED[@]%\1%/p' \
+ -e '/^BLDSHARED=/s/^BLDSHARED=[ ]*\(.*\)/s%@BLDSHARED[@]%\1%/p' \
-e '/^CCSHARED=/s/^CCSHARED=[ ]*\(.*\)/s%@CCSHARED[@]%\1%/p' \
-e '/^SGI_ABI=/s/^SGI_ABI=[ ]*\(.*\)/s%@SGI_ABI[@]%\1%/p' \
-e '/^$L=/s/^$L=[ ]*\(.*\)/s%@$L[@]%\1%/p' \