Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Various Win32 fixes

-Add resetSession to the win32 exports file.
-Also remove /DEBUG from the win32 slony1_funcs.dll link line
-Use PG_LIB not PGHOME.  Also include standard headers on win32
-Win32 makefile changes.  The location of required applications
 (postgresql,pthreads,gettext) will now come from the environment
 instead of requiring users to change the makefiles.
  • Loading branch information...
commit b2e10ea9eed60bddad5c2e8fbf3f1ae2cf02e080 1 parent 1f79a1f
Steve Singer ssinger authored
33 doc/adminguide/installation.sgml
View
@@ -234,19 +234,22 @@ for win32</ulink></para></listitem>
<para>
To compile the &slony1; binaries you will need to
<itemizedlist>
-<listitem><para>Edit src\slon\win32.mak, src\slonik\win32.mak,
-src\backend\win32.mak and set
- <itemizedlist><listitem><para>PGHOME directory to the top level
-directory of your &postgres; installation.</para></listitem>
- <listitem><para>PTHREADS_INC, and PTHREADS_LIB to where your
- pthreads-win32 package library and headers were installed to
- </para></listitem>
- <listitem><para>GETTEXT_LIB to where the gettext library was installed to
- </para></listitem>
- </itemizedlist>
- </para></listitem>
-</itemizedlist>
-</para>
+<listitem><para>Set the environment variables PGSHARE,PG_INC,PG_LIB,
+PTHREADS_INC,PTHREADS_LIB, GETTEXT_LIB to point to the proper locations
+based on where these applications were installed. For example</para>
+<programlisting>
+set PG_INC=c:\Postgresql\9.0\include
+set PG_LIB=c:\Postgresql\9.0\lib
+set PGSHARE=c:\\Postgresql\\9.0\\share
+set PTHREADS_INC=c:\pthreads-win32\include
+set PTHREADS_LIB=c:\pthreads-win32\lib
+set GETTEXT_LIB=c:\gettext\lib
+</programlisting>
+<para>
+Note that the backslash characters must be escaped for PGSHARE as in the
+above example</para>
+</listitem>
+
<para>
From the Visual Studio or Microsoft Windows SDK command prompt run
<programlisting>
@@ -257,10 +260,12 @@ nmake /f win32.mak slon.exe
cd ..\slonik
nmake /f win32.mak slonik.exe
</programlisting>
-
+</para>
<para>
src\backend\slony1_funcs.dll and any of the .sql files in
src\backend need to be installed in your postgresql $share directory.
+</para>
+
</sect2>
<sect2 id="buildingdocs"> <title> Building Documentation: Admin Guide </title>
3  src/backend/slony1_funcs.def
View
@@ -6,4 +6,5 @@ _Slony_I_lockedSet
_Slony_I_getLocalNodeId
_Slony_I_killBackend
_Slony_I_seqtrack
-_Slony_I_logTrigger
+_Slony_I_logTrigger
+_Slony_I_resetSession
9 src/backend/win32.mak
View
@@ -1,13 +1,10 @@
CPP=cl.exe
LINK32=link.exe
-PGHOME=c:\postgresql\9.0
-PGSHARE=$(PGHOME)\share
-PTHREADS_INC=C:\pthreads-win32\include
-PTHREADS_LIB=c:\pthreads-win32\lib
-LINK32_FLAGS= /PDB:slony1_funcs.pdb /DEBUG /DEF:slony1_funcs.def /DLL $(PGHOME)\lib\postgres.lib
+
+LINK32_FLAGS= /PDB:slony1_funcs.pdb /DEF:slony1_funcs.def /DLL $(PG_LIB)\postgres.lib
OBJS = slony1_funcs.obj \
-CPP_FLAGS=/c /D MSVC /D WIN32 /D PGSHARE=$(PGSHARE) /I..\misc /I..\..\ /I$(PGHOME)\include /I$(PGHOME)\include\server /I$(PGHOME)\include\server\port\win32_msvc /I$(PGHOME)\include\server\port\win32 /D HAVE_LONG_INT_64 /D HAVE_GETACTIVESNAPSHOT /LD /Gd /Tc
+CPP_FLAGS=/c /D MSVC /D WIN32 /D PGSHARE=\"$(PGSHARE)\" /I..\misc /I..\..\ /I$(PG_INC) /I$(PG_INC)\server /I$(PG_INC)\server\port\win32_msvc /I$(PG_INC)\server\port\win32 /D HAVE_LONG_INT_64 /D HAVE_GETACTIVESNAPSHOT /LD /Gd /Tc
slony1_funcs.obj: slony1_funcs.c
$(CPP) $(CPP_FLAGS) slony1_funcs.c
9 src/slon/win32.mak
View
@@ -1,11 +1,6 @@
CPP=cl.exe
LINK32=link.exe
-PGHOME=c:\postgresql\9.0
-PGSHARE=$(PGHOME)\share
-PTHREADS_INC=C:\pthreads-win32\include
-PTHREADS_LIB="c:\pthreads-win32\lib"
-GETTEXT_LIB=c:\gettext\lib
-LINK32_FLAGS=/libpath:$(PGHOME)\lib libpq.lib libpgport.lib /libpath:$(PTHREADS_LIB) pthreadVC2.lib wsock32.lib kernel32.lib user32.lib advapi32.lib /libpath:$(GETTEXT_LIB) intl.lib
+LINK32_FLAGS=/libpath:$(PG_LIB) libpq.lib libpgport.lib /libpath:$(PTHREADS_LIB) pthreadVC2.lib wsock32.lib kernel32.lib user32.lib advapi32.lib /libpath:$(GETTEXT_LIB) intl.lib
OBJS = slon.obj \
runtime_config.obj \
local_listen.obj \
@@ -25,7 +20,7 @@ OBJS = slon.obj \
-CPP_FLAGS=/c /D MSVC /D WIN32 /D PGSHARE=$(PGSHARE) /D YY_NO_UNISTD_H /I..\..\ /I$(PGHOME)\include /I$(PGHOME)\include/server /I$(PGHOME)\include/server/port/win32 /I$(PTHREADS_INC) /MD /Zi
+CPP_FLAGS=/c /D MSVC /D WIN32 /D PGSHARE=$(PGSHARE) /D YY_NO_UNISTD_H /I..\..\ /I$(PG_INC) /I$(PG_INC)/server /I$(PG_INC)/server/port/win32 /I$(PTHREADS_INC) /MD /Zi
slon.obj: slon.c
$(CPP) $(CPP_FLAGS) slon.c
5 src/slonik/dbutil.c
View
@@ -12,8 +12,7 @@
#ifndef WIN32
-#include <stdio.h>
-#include <stdlib.h>
+
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -21,6 +20,8 @@
#include <stdarg.h>
#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
#ifdef WIN32
#include "config_msvc.h"
5 src/slonik/win32.mak
View
@@ -1,7 +1,6 @@
CPP=cl.exe
LINK32=link.exe
-PGHOME=c:\\postgresql\\9.0
-LINK32_FLAGS=/libpath:$(PGHOME)\lib libpq.lib libpgport.lib kernel32.lib
+LINK32_FLAGS=/libpath:$(PG_LIB) libpq.lib libpgport.lib kernel32.lib
OBJS = slonik.obj \
dbutil.obj \
parser.obj \
@@ -10,7 +9,7 @@ OBJS = slonik.obj \
-CPP_FLAGS=/c /D MSVC /D WIN32 /D PGSHARE=\"$(PGHOME)/share\" /D YY_NO_UNISTD_H /I..\..\ /I$(PGHOME)\include /MD
+CPP_FLAGS=/c /D MSVC /D WIN32 /D PGSHARE=\"$(PGSHARE)\" /D YY_NO_UNISTD_H /I..\..\ /I$(PG_INC) /MD
slonik.obj: slonik.c
$(CPP)$(CPP_FLAGS) slonik.c
Please sign in to comment.
Something went wrong with that request. Please try again.