Skip to content

Commit

Permalink
Various Win32 fixes
Browse files Browse the repository at this point in the history
-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
ssinger committed May 27, 2011
1 parent 1f79a1f commit b2e10ea
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 33 deletions.
33 changes: 19 additions & 14 deletions doc/adminguide/installation.sgml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -234,19 +234,22 @@ for win32</ulink></para></listitem>
<para> <para>
To compile the &slony1; binaries you will need to To compile the &slony1; binaries you will need to
<itemizedlist> <itemizedlist>
<listitem><para>Edit src\slon\win32.mak, src\slonik\win32.mak, <listitem><para>Set the environment variables PGSHARE,PG_INC,PG_LIB,
src\backend\win32.mak and set PTHREADS_INC,PTHREADS_LIB, GETTEXT_LIB to point to the proper locations
<itemizedlist><listitem><para>PGHOME directory to the top level based on where these applications were installed. For example</para>
directory of your &postgres; installation.</para></listitem> <programlisting>
<listitem><para>PTHREADS_INC, and PTHREADS_LIB to where your set PG_INC=c:\Postgresql\9.0\include
pthreads-win32 package library and headers were installed to set PG_LIB=c:\Postgresql\9.0\lib
</para></listitem> set PGSHARE=c:\\Postgresql\\9.0\\share
<listitem><para>GETTEXT_LIB to where the gettext library was installed to set PTHREADS_INC=c:\pthreads-win32\include
</para></listitem> set PTHREADS_LIB=c:\pthreads-win32\lib
</itemizedlist> set GETTEXT_LIB=c:\gettext\lib
</para></listitem> </programlisting>
</itemizedlist> <para>
</para> Note that the backslash characters must be escaped for PGSHARE as in the
above example</para>
</listitem>

<para> <para>
From the Visual Studio or Microsoft Windows SDK command prompt run From the Visual Studio or Microsoft Windows SDK command prompt run
<programlisting> <programlisting>
Expand All @@ -257,10 +260,12 @@ nmake /f win32.mak slon.exe
cd ..\slonik cd ..\slonik
nmake /f win32.mak slonik.exe nmake /f win32.mak slonik.exe
</programlisting> </programlisting>

</para>
<para> <para>
src\backend\slony1_funcs.dll and any of the .sql files in src\backend\slony1_funcs.dll and any of the .sql files in
src\backend need to be installed in your postgresql $share directory. src\backend need to be installed in your postgresql $share directory.
</para>

</sect2> </sect2>


<sect2 id="buildingdocs"> <title> Building Documentation: Admin Guide </title> <sect2 id="buildingdocs"> <title> Building Documentation: Admin Guide </title>
Expand Down
3 changes: 2 additions & 1 deletion src/backend/slony1_funcs.def
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ _Slony_I_lockedSet
_Slony_I_getLocalNodeId _Slony_I_getLocalNodeId
_Slony_I_killBackend _Slony_I_killBackend
_Slony_I_seqtrack _Slony_I_seqtrack
_Slony_I_logTrigger _Slony_I_logTrigger
_Slony_I_resetSession
9 changes: 3 additions & 6 deletions src/backend/win32.mak
Original file line number Original file line Diff line number Diff line change
@@ -1,13 +1,10 @@
CPP=cl.exe CPP=cl.exe
LINK32=link.exe LINK32=link.exe
PGHOME=c:\postgresql\9.0
PGSHARE=$(PGHOME)\share LINK32_FLAGS= /PDB:slony1_funcs.pdb /DEF:slony1_funcs.def /DLL $(PG_LIB)\postgres.lib
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
OBJS = slony1_funcs.obj \ 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 slony1_funcs.obj: slony1_funcs.c
$(CPP) $(CPP_FLAGS) slony1_funcs.c $(CPP) $(CPP_FLAGS) slony1_funcs.c
Expand Down
9 changes: 2 additions & 7 deletions src/slon/win32.mak
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,6 @@
CPP=cl.exe CPP=cl.exe
LINK32=link.exe LINK32=link.exe
PGHOME=c:\postgresql\9.0 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
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
OBJS = slon.obj \ OBJS = slon.obj \
runtime_config.obj \ runtime_config.obj \
local_listen.obj \ local_listen.obj \
Expand All @@ -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 slon.obj: slon.c
$(CPP) $(CPP_FLAGS) slon.c $(CPP) $(CPP_FLAGS) slon.c
Expand Down
5 changes: 3 additions & 2 deletions src/slonik/dbutil.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@




#ifndef WIN32 #ifndef WIN32
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif


#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include <stdlib.h>


#ifdef WIN32 #ifdef WIN32
#include "config_msvc.h" #include "config_msvc.h"
Expand Down
5 changes: 2 additions & 3 deletions src/slonik/win32.mak
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
CPP=cl.exe CPP=cl.exe
LINK32=link.exe LINK32=link.exe
PGHOME=c:\\postgresql\\9.0 LINK32_FLAGS=/libpath:$(PG_LIB) libpq.lib libpgport.lib kernel32.lib
LINK32_FLAGS=/libpath:$(PGHOME)\lib libpq.lib libpgport.lib kernel32.lib
OBJS = slonik.obj \ OBJS = slonik.obj \
dbutil.obj \ dbutil.obj \
parser.obj \ parser.obj \
Expand All @@ -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 slonik.obj: slonik.c
$(CPP)$(CPP_FLAGS) slonik.c $(CPP)$(CPP_FLAGS) slonik.c
Expand Down

0 comments on commit b2e10ea

Please sign in to comment.