Skip to content

Commit 58634ca

Browse files
committed
Add MSVC support for utility commands and pg_dump.
Hiroshi Saito
1 parent 025ffe5 commit 58634ca

File tree

11 files changed

+241
-10
lines changed

11 files changed

+241
-10
lines changed

doc/src/sgml/install-win32.sgml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.26 2005/05/13 15:21:59 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.27 2006/02/12 06:11:50 momjian Exp $
33
-->
44

55
<chapter id="install-win32">
@@ -83,13 +83,27 @@ $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.26 2005/05/13 15:21:59 tg
8383
</varlistentry>
8484

8585
<varlistentry>
86+
<term><filename>bin\pg_config\Release\pg_config.exe</filename></term>
8687
<term><filename>bin\psql\Release\psql.exe</filename></term>
88+
<term><filename>bin\pg_dump\Release\pg_dump.exe</filename></term>
89+
<term><filename>bin\pg_dump\Release\pg_dumpall.exe</filename></term>
90+
<term><filename>bin\pg_dump\Release\pg_restore.exe</filename></term>
91+
<term><filename>bin\scripts\Release\clusterdb.exe</filename></term>
92+
<term><filename>bin\scripts\Release\createdb.exe</filename></term>
93+
<term><filename>bin\scripts\Release\createuser.exe</filename></term>
94+
<term><filename>bin\scripts\Release\createlang.exe</filename></term>
95+
<term><filename>bin\scripts\Release\dropdb.exe</filename></term>
96+
<term><filename>bin\scripts\Release\dropuser.exe</filename></term>
97+
<term><filename>bin\scripts\Release\droplang.exe</filename></term>
98+
<term><filename>bin\scripts\Release\vacuumdb.exe</filename></term>
99+
<term><filename>bin\scripts\Release\reindexdb.exe</filename></term>
87100
<listitem>
88101
<para>
89-
The <productname>PostgreSQL</productname> interactive terminal
102+
The <productname>PostgreSQL</productname> client applications and utilities.
90103
</para>
91104
</listitem>
92105
</varlistentry>
106+
93107
</variablelist>
94108
</para>
95109

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.122 2006/02/12 04:04:32 momjian Exp $
18+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.123 2006/02/12 06:11:50 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -27,7 +27,10 @@
2727
#include "dumputils.h"
2828

2929
#include <ctype.h>
30+
31+
#ifndef WIN32_CLIENT_ONLY
3032
#include <unistd.h>
33+
#endif
3134

3235
#ifdef WIN32
3336
#include <io.h>

src/bin/pg_dump/pg_backup_db.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Implements the basic DB functions used by the archiver.
66
*
77
* IDENTIFICATION
8-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.68 2006/02/09 18:28:29 tgl Exp $
8+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.69 2006/02/12 06:11:50 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -15,7 +15,10 @@
1515
#include "pg_backup_db.h"
1616
#include "dumputils.h"
1717

18+
#ifndef WIN32_CLIENT_ONLY
1819
#include <unistd.h>
20+
#endif
21+
1922
#include <ctype.h>
2023

2124
#ifdef HAVE_TERMIOS_H

src/bin/pg_dump/pg_backup_null.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717
*
1818
*
1919
* IDENTIFICATION
20-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.16 2005/10/15 02:49:38 momjian Exp $
20+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.17 2006/02/12 06:11:50 momjian Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
2424

2525
#include "pg_backup.h"
2626
#include "pg_backup_archiver.h"
2727

28+
#ifndef WIN32_CLIENT_ONLY
2829
#include <unistd.h> /* for dup */
30+
#endif
2931

3032
#include "libpq/libpq-fs.h"
3133

src/bin/pg_dump/pg_backup_tar.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.49 2005/10/15 02:49:38 momjian Exp $
19+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.50 2006/02/12 06:11:50 momjian Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -27,7 +27,10 @@
2727

2828
#include <ctype.h>
2929
#include <limits.h>
30+
31+
#ifndef WIN32_CLIENT_ONLY
3032
#include <unistd.h>
33+
#endif
3134

3235
static void _ArchiveEntry(ArchiveHandle *AH, TocEntry *te);
3336
static void _StartData(ArchiveHandle *AH, TocEntry *te);

src/bin/pg_dump/pg_dump.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.428 2006/02/12 03:22:18 momjian Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.429 2006/02/12 06:11:51 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -24,7 +24,10 @@
2424
*/
2525
#include "postgres.h"
2626

27+
#ifndef WIN32_CLIENT_ONLY
2728
#include <unistd.h>
29+
#endif
30+
2831
#include <ctype.h>
2932
#ifdef ENABLE_NLS
3033
#include <locale.h>

src/bin/pg_dump/pg_dumpall.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.70 2006/02/12 03:22:19 momjian Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.71 2006/02/12 06:11:51 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313

1414
#include "postgres_fe.h"
1515

1616
#include <time.h>
17+
18+
#ifndef WIN32_CLIENT_ONLY
1719
#include <unistd.h>
20+
#endif
21+
1822
#ifdef ENABLE_NLS
1923
#include <locale.h>
2024
#endif

src/bin/pg_dump/pg_restore.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
*
3636
* IDENTIFICATION
37-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.75 2006/02/12 04:07:25 momjian Exp $
37+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.76 2006/02/12 06:11:51 momjian Exp $
3838
*
3939
*-------------------------------------------------------------------------
4040
*/
@@ -53,7 +53,9 @@
5353
#include <termios.h>
5454
#endif
5555

56+
#ifndef WIN32_CLIENT_ONLY
5657
#include <unistd.h>
58+
#endif
5759

5860
#include "getopt_long.h"
5961

src/bin/pg_dump/win32.mak

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
# Makefile for Microsoft Visual C++ 5.0 (or compat)
2+
3+
!IF "$(OS)" == "Windows_NT"
4+
NULL=
5+
!ELSE
6+
NULL=nul
7+
!ENDIF
8+
9+
CPP=cl.exe
10+
PERL=perl.exe
11+
FLEX=flex.exe
12+
YACC=bison.exe
13+
MV=move
14+
15+
!IFDEF DEBUG
16+
OPT=/Od /Zi /MDd
17+
LOPT=/DEBUG
18+
DEBUGDEF=/D _DEBUG
19+
OUTDIR=.\Debug
20+
INTDIR=.\Debug
21+
!ELSE
22+
OPT=/O2 /MD
23+
LOPT=
24+
DEBUGDEF=/D NDEBUG
25+
OUTDIR=.\Release
26+
INTDIR=.\Release
27+
!ENDIF
28+
29+
REFDOCDIR= ../../../doc/src/sgml/ref
30+
31+
CPP_PROJ=/nologo $(OPT) /W3 /GX /D "WIN32" $(DEBUGDEF) /D "_CONSOLE" /D\
32+
"_MBCS" /Fp"$(INTDIR)\pg_dump.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
33+
/I ..\..\include /I ..\..\interfaces\libpq /I ..\..\include\port\win32 /I ..\..\backend \
34+
/D "HAVE_STRDUP" /D "FRONTEND"
35+
36+
CPP_OBJS=$(INTDIR)/
37+
CPP_SBRS=.
38+
39+
ALL : ..\..\backend\parser\parse.h "..\..\port\pg_config_paths.h" \
40+
"$(OUTDIR)\pg_dump.exe" "$(OUTDIR)\pg_dumpall.exe" "$(OUTDIR)\pg_restore.exe"
41+
42+
CLEAN :
43+
-@erase "$(INTDIR)\pg_backup_archiver.obj"
44+
-@erase "$(INTDIR)\pg_backup_db.obj"
45+
-@erase "$(INTDIR)\pg_backup_custom.obj"
46+
-@erase "$(INTDIR)\pg_backup_files.obj"
47+
-@erase "$(INTDIR)\pg_backup_null.obj"
48+
-@erase "$(INTDIR)\pg_backup_tar.obj"
49+
-@erase "$(INTDIR)\dumputils.obj"
50+
-@erase "$(INTDIR)\common.obj"
51+
-@erase "$(INTDIR)\pg_dump_sort.obj"
52+
-@erase "$(INTDIR)\keywords.obj"
53+
-@erase "$(INTDIR)\exec.obj"
54+
-@erase "$(INTDIR)\getopt.obj"
55+
-@erase "$(INTDIR)\getopt_long.obj"
56+
-@erase "$(INTDIR)\path.obj"
57+
-@erase "$(INTDIR)\pgstrcasecmp.obj"
58+
-@erase "$(INTDIR)\sprompt.obj"
59+
-@erase "$(INTDIR)\pg_dump.pch"
60+
-@erase "$(OUTDIR)\pg_dump.obj"
61+
-@erase "$(OUTDIR)\pg_dump.exe"
62+
-@erase "$(INTDIR)\pg_dumpall.obj"
63+
-@erase "$(OUTDIR)\pg_dumpall.exe"
64+
-@erase "$(INTDIR)\pg_restore.obj"
65+
-@erase "$(OUTDIR)\pg_restore.exe"
66+
# -@erase "$(INTDIR)\..\..\port\pg_config_paths.h"
67+
# -@erase "$(INTDIR)\..\..\backend\parser\parse.h"
68+
# -@erase "$(INTDIR)\..\..\backend\parser\gram.c"
69+
70+
LINK32=link.exe
71+
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
72+
advapi32.lib shfolder.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
73+
odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no
74+
LINK32_FLAGS_DMP= \
75+
/pdb:"$(OUTDIR)\pg_dump.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_dump.exe"
76+
LINK32_FLAGS_ALL= \
77+
/pdb:"$(OUTDIR)\pg_dumpall.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_dumpall.exe"
78+
LINK32_FLAGS_RES= \
79+
/pdb:"$(OUTDIR)\pg_restore.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_restore.exe"
80+
81+
LINK32_OBJS= \
82+
"$(INTDIR)\pg_backup_archiver.obj" \
83+
"$(INTDIR)\pg_backup_db.obj" \
84+
"$(INTDIR)\pg_backup_custom.obj" \
85+
"$(INTDIR)\pg_backup_files.obj" \
86+
"$(INTDIR)\pg_backup_null.obj" \
87+
"$(INTDIR)\pg_backup_tar.obj" \
88+
"$(INTDIR)\dumputils.obj" \
89+
"$(INTDIR)\keywords.obj" \
90+
"$(INTDIR)\exec.obj" \
91+
"$(INTDIR)\getopt.obj" \
92+
"$(INTDIR)\getopt_long.obj" \
93+
"$(INTDIR)\path.obj" \
94+
"$(INTDIR)\pgstrcasecmp.obj" \
95+
"$(INTDIR)\sprompt.obj"
96+
97+
LINK32_OBJS_DMP= \
98+
"$(INTDIR)\common.obj" \
99+
"$(INTDIR)\pg_dump_sort.obj" \
100+
"$(INTDIR)\pg_dump.obj"
101+
LINK32_OBJS_RES= "$(INTDIR)\pg_restore.obj"
102+
LINK32_OBJS_ALL= "$(INTDIR)\pg_dumpall.obj"
103+
104+
!IFDEF DEBUG
105+
LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Debug\libpqddll.lib"
106+
!ELSE
107+
LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\libpqdll.lib"
108+
!ENDIF
109+
110+
"..\..\port\pg_config_paths.h":
111+
echo #define PGBINDIR "" >$@
112+
echo #define PGSHAREDIR "" >>$@
113+
echo #define SYSCONFDIR "" >>$@
114+
echo #define INCLUDEDIR "" >>$@
115+
echo #define PKGINCLUDEDIR "" >>$@
116+
echo #define INCLUDEDIRSERVER "" >>$@
117+
echo #define LIBDIR "" >>$@
118+
echo #define PKGLIBDIR "" >>$@
119+
echo #define LOCALEDIR "" >>$@
120+
echo #define DOCDIR "" >>$@
121+
echo #define MANDIR "" >>$@
122+
123+
"$(OUTDIR)" :
124+
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
125+
126+
"$(OUTDIR)\pg_dump.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32_OBJS_DMP)
127+
$(LINK32) @<<
128+
$(LINK32_FLAGS) $(LINK32_FLAGS_DMP) $(LINK32_OBJS) $(LINK32_OBJS_DMP)
129+
<<
130+
131+
"$(OUTDIR)\pg_dumpall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32_OBJS_ALL)
132+
$(LINK32) @<<
133+
$(LINK32_FLAGS) $(LINK32_FLAGS_ALL) $(LINK32_OBJS) $(LINK32_OBJS_ALL)
134+
<<
135+
136+
"$(OUTDIR)\pg_restore.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32_OBJS_RES)
137+
$(LINK32) @<<
138+
$(LINK32_FLAGS) $(LINK32_FLAGS_RES) $(LINK32_OBJS) $(LINK32_OBJS_RES)
139+
<<
140+
141+
"$(INTDIR)\keywords.obj" : ..\..\backend\parser\keywords.c
142+
$(CPP) @<<
143+
$(CPP_PROJ) ..\..\backend\parser\keywords.c
144+
<<
145+
146+
"$(INTDIR)\exec.obj" : ..\..\port\exec.c
147+
$(CPP) @<<
148+
$(CPP_PROJ) ..\..\port\exec.c
149+
<<
150+
151+
"$(INTDIR)\getopt.obj" : "$(INTDIR)" ..\..\port\getopt.c
152+
$(CPP) @<<
153+
$(CPP_PROJ) ..\..\port\getopt.c
154+
<<
155+
156+
"$(INTDIR)\getopt_long.obj" : "$(INTDIR)" ..\..\port\getopt_long.c
157+
$(CPP) @<<
158+
$(CPP_PROJ) ..\..\port\getopt_long.c
159+
<<
160+
161+
"$(INTDIR)\path.obj" : "$(INTDIR)" ..\..\port\path.c
162+
$(CPP) @<<
163+
$(CPP_PROJ) ..\..\port\path.c
164+
<<
165+
166+
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
167+
$(CPP) @<<
168+
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
169+
<<
170+
171+
"$(INTDIR)\sprompt.obj" : "$(INTDIR)" ..\..\port\sprompt.c
172+
$(CPP) @<<
173+
$(CPP_PROJ) ..\..\port\sprompt.c
174+
<<
175+
176+
..\..\backend\parser\parse.h : ..\..\backend\parser\gram.y
177+
$(YACC) -y -d ..\..\backend\parser\gram.y
178+
$(MV) ..\..\backend\parser\y.tab.h ..\..\backend\parser\parse.h
179+
$(MV) ..\..\backend\parser\y.tab.c ..\..\backend\parser\gram.c
180+
181+
.c{$(CPP_OBJS)}.obj::
182+
$(CPP) @<<
183+
$(CPP_PROJ) $<
184+
<<
185+
186+

src/include/pg_config.h.win32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#define HAVE_RANDOM
2424
#endif
2525

26+
#define INT64_FORMAT "%I64d"
27+
#define HAVE_DECL_VSNPRINTF 1
28+
2629
/* use _snprintf and _vsnprintf */
2730
#define HAVE_DECL_SNPRINTF 1
2831
#define snprintf _snprintf

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy