File: 06tutorial

package info (click to toggle)
postgresql 7.4.7-6sarge6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,168 kB
  • ctags: 27
  • sloc: sh: 1,903; makefile: 337; ansic: 204; perl: 69; sed: 6; tcl: 1
file content (63 lines) | stat: -rw-r--r-- 2,287 bytes parent folder | download
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
diff -ruN postgresql-7.4.7-old/src/tutorial/Makefile postgresql-7.4.7/src/tutorial/Makefile
--- postgresql-7.4.7-old/src/tutorial/Makefile	2002-09-05 20:28:46.000000000 +0200
+++ postgresql-7.4.7/src/tutorial/Makefile	2003-11-07 14:24:32.000000000 +0100
@@ -6,15 +6,15 @@
 # IDENTIFICATION
 #    $Header: /cvsroot/pkg-postgresql/7.4/postgresql-7.4.7/debian/patches/06tutorial,v 1.3 2004/03/10 18:07:28 elphick Exp $
 #
+# Please note that this Makefile was modified for Debian to allow
+# compilation in an arbitrary directory and without the complete
+# PostgreSQL source tree.
 #-------------------------------------------------------------------------
 
-subdir = src/tutorial
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-
-override CFLAGS+= $(CFLAGS_SL)
-SHLIB_LINK = $(BE_DLLLIBS)
-
+DLSUFFIX=.so
+INCLUDES= -I/usr/include/postgresql/ -I/usr/include/postgresql/server/
+CC= gcc $(INCLUDES)
+ 
 #
 # DLOBJS are the dynamically-loaded object files.  The "funcs" queries
 # include CREATE FUNCTIONs that load routines from these files.
@@ -25,6 +25,9 @@
 
 all: $(DLOBJS) $(QUERIES)
 
+%$(DLSUFFIX): %.c
+	$(CC) -shared -o $@ $<
+
 %.sql: %.source
 	rm -f $@; \
 	C=`pwd`; \
@@ -32,3 +35,5 @@
 
 clean distclean maintainer-clean:
 	rm -f $(DLOBJS) $(QUERIES)
+
+.PHONY: clean distclean maintainer-clean
diff -ruN postgresql-7.4.7-old/src/tutorial/README postgresql-7.4.7/src/tutorial/README
--- postgresql-7.4.7-old/src/tutorial/README	2001-10-26 22:45:33.000000000 +0200
+++ postgresql-7.4.7/src/tutorial/README	2003-11-07 14:25:36.000000000 +0100
@@ -2,10 +2,16 @@
 	% make
 to compile all the scripts and C files for the user-defined functions
 and types.  (make needs to be GNU make --- it may be named something
-different on your system, often gmake)
+different on your system, often gmake.) The package postgresql-dev
+must be installed for the tutorials to compile.
 
 Then, run psql with the -s (single-step) flag:
 	% psql -s
 
 From within psql, you can try each individual script file by using
 psql's \i <filename> command.
+
+Please note that you need database superuser privileges to execute the
+examples which load dynamic libraries ('funcs' and 'complex') since
+the language C is usually not 'trusted', i. e. may not be used by
+normal users.