blob: 29d2c2f28f181450932c2a656c8036a59272be09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# cflags. pick your favorite
#
CC=gcc
CFLAGS=-g -O0 -Wall -Wmissing-declarations -fPIC
# build info for python, alter as needed
#
# python headers
#
#INCPYTHON=/usr/include/python1.5
INCPYTHON=/usr/include/python2.0
# python shared library
#
#LIBPYTHON=python1.5
LIBPYTHON=python2.0
# if python is someplace odd
#
LIBPYTHONPATH=/usr/lib
# python 2 seems to want libdb
# various db libs are still messed on my system
#
#LIBPYTHONEXTRA=/usr/lib/libdb2.so.2.7.7
#LIBPYTHONEXTRA=-ldb2
LDPYTHON=-L$(LIBPYTHONPATH) -l$(LIBPYTHON) $(LIBPYTHONEXTRA)
# build info for postgres
#
# postgres headers. the installed include directory doesn't work for me
#
#INCPOSTGRES=/usr/include/postgres
INCPOSTGRES=/home/andrew/builds/postgresql/src/include
# hopefully you won't need this utter crap...
# but if you can't patch the appropriate dynloader file, try this. you
# may have to add other modules.
#
#DLDIR=/usr/lib/python1.5/lib-dynload
#DLHACK=$(DLDIR)/arraymodule.so $(DLDIR)/timemodule.so $(DLDIR)/cmathmodule.so $(DLDIR)/errnomodule.so $(DLDIR)/mathmodule.so $(DLDIR)/md5module.so $(DLDIR)/operator.so
# $(DLDIR)/shamodule.so
# shouldn't need to alter anything below here
#
INCLUDES=-I$(INCPYTHON) -I$(INCPOSTGRES) -I./
# dynamic linker flags.
#
#LDFLAGS=--shared -Wl,-Bshareable -Wl,-E -Wl,-soname,$@
LDFLAGS=--shared -Wl,-E -Wl,-soname,$@
.PHONY: clean
all: plpython.so
plpython.o: plpython.c plpython.h
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
plpython.so: plpython.o
$(CC) $(LDFLAGS) -o $@ $^ $(LDPYTHON) $(DLHACK) -ldl -lpthread -lm
clean:
rm -f plpython.so *.o
|