[dak/master] Merge from Michael:
Fixed sql-qptvc.cpp to work on modern postgresql versions,
and made the makefile be less braindead
Signed-off-by: Michael Casadevall <sonicmctails@gmail.com>
(cherry picked from commit 8e2d5f69dc3519cff036b34e6e7ce3956088f7e1)
Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
ChangeLog | 5 +++++
src/Makefile | 8 ++++----
src/sql-aptvc.cpp | 5 +++++
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 946cf32..2bee620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-30 Michael Casadevall <sonicmctails@gmail.com>
+
+ * src/sql-aptvc.cpp - Fixed to work on modern postgresql version
+ * src/Makefile - Gave it a brain on finding postgres headers
+
2008-12-30 Joerg Jaspert <joerg@debian.org>
* config/debian/cron.hourly: Generate the 822 format for accepted,
diff --git a/src/Makefile b/src/Makefile
index b45b07d..206f320 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,9 +1,9 @@
#!/usr/bin/make -f
-CXXFLAGS = -I/usr/include/postgresql/ -I/usr/include/postgresql/server/ -fPIC -Wall
-CFLAGS = -fPIC -Wall
-LDFLAGS = -fPIC
-LIBS = -lapt-pkg
+CXXFLAGS = -I/usr/include/postgresql/ -I`pg_config --includedir-server` -fPIC -Wall
+CFLAGS = -fFIC -Wall `pg_config --cflags`
+LDFLAGS = `pg_config --ldflags`
+LIBS = -lapt-pkg `pg_config --libs`
C++ = g++
diff --git a/src/sql-aptvc.cpp b/src/sql-aptvc.cpp
index 54ba9e9..a9c3e53 100644
--- a/src/sql-aptvc.cpp
+++ b/src/sql-aptvc.cpp
@@ -26,6 +26,11 @@ extern "C"
{
#include <postgres.h>
+#include <fmgr.h>
+
+#ifdef PG_MODULE_MAGIC
+PG_MODULE_MAGIC;
+#endif
int versioncmp(text *A, text *B);
--
1.5.6.5
Reply to: