Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit432ea3c

Browse files
committed
Enable building of 64-bit libpq using visual studio 8 and the
win32.mak file.Enable building with kerberos support using the win32.mak file.Hiroshi Saito + me
1 parent9e53f83 commit432ea3c

File tree

2 files changed

+67
-16
lines changed

2 files changed

+67
-16
lines changed

‎doc/src/sgml/install-win32.sgml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.39 2007/04/1810:14:06 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.40 2007/04/1813:50:08 mha Exp $ -->
22

33
<chapter id="install-win32">
44
<title>Installation on <productname>Windows</productname></title>
@@ -360,7 +360,7 @@
360360
<productname>Borland C++</productname></title>
361361

362362
<para>
363-
Using <productname>VisualStudio 6.0</productname> or
363+
Using <productname>VisualC++ 6.0-8.0</productname> or
364364
<productname>Borland C++</productname> to build libpq is only recommended
365365
if you need a version with different debug/release flags, or if you need a
366366
static library to link into an application. For normal use the
@@ -370,12 +370,23 @@
370370

371371
<para>
372372
To build the <application>libpq</application> client library using
373-
<productname>Visual Studio 6.0</productname>, change into the
373+
<productname>Visual Studio 6.0 or later</productname>, change into the
374374
<filename>src</filename> directory and type the command
375375
<screen>
376376
<userinput>nmake /f win32.mak</userinput>
377377
</screen>
378378
</para>
379+
<para>
380+
To build a 64-bit version of the <application>libpq</application>
381+
client library using <productname>Visual Studio 8.0 or
382+
later</productname>, change into the <filename>src</filename>
383+
directory and type in the command
384+
<screen>
385+
<userinput>nmake /f win32.mak CPU=AMD64</userinput>
386+
</screen>
387+
See the <filename>win32.mak</filename> file for further details
388+
about supported variables.
389+
</para>
379390

380391
<para>
381392
To build the <application>libpq</application> client library using

‎src/interfaces/libpq/win32.mak

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
# Makefile for Microsoft Visual C++5.0 (or compat)
1+
# Makefile for Microsoft Visual C++6.0-8.0
22

3-
# Will build aWin32static library libpq(d).lib
4-
# and aWin32dynamic library libpq(d).dll with import library libpq(d)dll.lib
3+
# Will build a static library libpq(d).lib
4+
# and a dynamic library libpq(d).dll with import library libpq(d)dll.lib
55
# USE_SSL=1 will compile with OpenSSL
6+
# USE_KFW=1 will compile with kfw(kerberos for Windows)
67
# DEBUG=1 compiles with debugging symbols
78
# ENABLE_THREAD_SAFETY=1 compiles with threading enabled
9+
# CPU="i386" or CPU environment of nmake.exe (AMD64 or IA64)
810

11+
!IF "$(CPU)" == ""
12+
CPU=i386
913
!MESSAGE Building the Win32 static library...
1014
!MESSAGE
15+
!ELSE
16+
ADD_DEFINES=/D "WIN64" /Wp64
17+
!MESSAGE Building the Win64 static library...
18+
!MESSAGE
19+
!ENDIF
1120

1221
!IFDEF DEBUG
1322
OPT=/Od /Zi /MDd
@@ -21,6 +30,26 @@ DEBUGDEF=/D NDEBUG
2130
OUTFILENAME=libpq
2231
!ENDIF
2332

33+
!IF "$(SSL_INC)" == ""
34+
SSL_INC=C:\OpenSSL\include
35+
!MESSAGEUsingdefaultOpenSSLIncludedirectory:$(SSL_INC)
36+
!ENDIF
37+
38+
!IF "$(SSL_LIB_PATH)" == ""
39+
SSL_LIB_PATH=C:\OpenSSL\lib\VC
40+
!MESSAGEUsingdefaultOpenSSLLibrarydirectory:$(SSL_LIB_PATH)
41+
!ENDIF
42+
43+
!IF "$(KFW_INC)" == ""
44+
KFW_INC=C:\kfw-2.6.5\inc
45+
!MESSAGEUsingdefaultKerberosIncludedirectory:$(KFW_INC)
46+
!ENDIF
47+
48+
!IF "$(KFW_LIB_PATH)" == ""
49+
KFW_LIB_PATH=C:\kfw-2.6.5\lib\$(CPU)
50+
!MESSAGEUsingdefaultKerberosLibrarydirectory:$(KFW_LIB_PATH)
51+
!ENDIF
52+
2453
!IF "$(OS)" == "Windows_NT"
2554
NULL=
2655
!ELSE
@@ -74,7 +103,7 @@ CLEAN :
74103
-@erase"$(OUTDIR)\libpq.res"
75104
-@erase"$(OUTDIR)\$(OUTFILENAME).dll"
76105
-@erase"$(OUTDIR)\$(OUTFILENAME)dll.exp"
77-
-@erase"$(INTDIR)\pg_config_paths.h"
106+
-@erase pg_config_paths.h"
78107

79108

80109
LIB32=link.exe -lib
@@ -107,27 +136,36 @@ LIB32_OBJS= \
107136
"$(INTDIR)\pthread-win32.obj"
108137

109138

110-
config: ..\..\include\pg_config.h pg_config_paths.h
139+
config: ..\..\include\pg_config.h pg_config_paths.h ..\..\include\pg_config_os.h
111140

112141
..\..\include\pg_config.h: ..\..\include\pg_config.h.win32
113142
copy ..\..\include\pg_config.h.win32 ..\..\include\pg_config.h
114143

144+
..\..\include\pg_config_os.h:
145+
copy ..\..\include\port\win32.h ..\..\include\pg_config_os.h
146+
115147
pg_config_paths.h: win32.mak
116148
echo#define SYSCONFDIR "" > pg_config_paths.h
117149

118150
"$(OUTDIR)" :
119151
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
120152

121-
CPP_PROJ=/nologo /W3 /EHsc$(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. /D "FRONTEND"$(DEBUGDEF) /D\
122-
"WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch"\
153+
CPP_PROJ=/nologo /W3 /EHsc$(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. /I "$(SSL_INC)"\
154+
/D "FRONTEND"$(DEBUGDEF)\
155+
/D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch"\
123156
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
124-
/D "_CRT_SECURE_NO_DEPRECATE"
157+
/D "_CRT_SECURE_NO_DEPRECATE"$(ADD_DEFINES)
125158

126159
!IFDEF USE_SSL
127160
CPP_PROJ=$(CPP_PROJ) /D USE_SSL
128161
SSL_LIBS=ssleay32.lib libeay32.lib gdi32.lib
129162
!ENDIF
130163

164+
!IFDEF USE_KFW
165+
CPP_PROJ=$(CPP_PROJ) /D KRB5
166+
KFW_LIBS=krb5_32.lib comerr32.lib
167+
!ENDIF
168+
131169
!IFDEF ENABLE_THREAD_SAFETY
132170
CPP_PROJ=$(CPP_PROJ) /D ENABLE_THREAD_SAFETY
133171
!ENDIF
@@ -137,15 +175,17 @@ CPP_SBRS=.
137175
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
138176

139177
LINK32=link.exe
140-
LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shfolder.lib wsock32.lib$(SSL_LIBS)\
141-
/nologo /subsystem:windows /dll$(LOPT) /incremental:no\
142-
/pdb:"$(OUTDIR)\libpqdll.pdb" /machine:I386 /out:"$(OUTDIR)\$(OUTFILENAME).dll"\
143-
/implib:"$(OUTDIR)\$(OUTFILENAME)dll.lib" /def:$(OUTFILENAME)dll.def
178+
LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shfolder.lib wsock32.lib$(SSL_LIBS)$(KFW_LIB)\
179+
/nologo /subsystem:windows /dll$(LOPT) /incremental:no\
180+
/pdb:"$(OUTDIR)\libpqdll.pdb" /machine:$(CPU)\
181+
/out:"$(OUTDIR)\$(OUTFILENAME).dll"\
182+
/implib:"$(OUTDIR)\$(OUTFILENAME)dll.lib"\
183+
/libpath:"$(SSL_LIB_PATH)" /libpath:"$(KFW_LIB_PATH)"\
184+
/def:$(OUTFILENAME)dll.def
144185
LINK32_OBJS=\
145186
"$(OUTDIR)\$(OUTFILENAME).lib"\
146187
"$(OUTDIR)\libpq.res"
147188

148-
149189
# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm
150190

151191
"$(OUTDIR)\$(OUTFILENAME).lib" : "$(OUTDIR)"$(DEF_FILE)$(LIB32_OBJS)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp