]> granicus.if.org Git - postgresql/commitdiff
Add MSVC support for utility commands and pg_dump.
authorBruce Momjian <bruce@momjian.us>
Sun, 12 Feb 2006 06:11:51 +0000 (06:11 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 12 Feb 2006 06:11:51 +0000 (06:11 +0000)
Hiroshi Saito

doc/src/sgml/install-win32.sgml
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_null.c
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_restore.c
src/bin/pg_dump/win32.mak [new file with mode: 0644]
src/include/pg_config.h.win32
src/win32.mak

index 2ecf691b6365c8bf374ef601a2b8203a789ee487..ae19f08bd43b27f6150f0bcf882f41e520d11856 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.26 2005/05/13 15:21:59 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.27 2006/02/12 06:11:50 momjian Exp $
 -->
 
 <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
    </varlistentry>
 
    <varlistentry>
+    <term><filename>bin\pg_config\Release\pg_config.exe</filename></term>
     <term><filename>bin\psql\Release\psql.exe</filename></term>
+    <term><filename>bin\pg_dump\Release\pg_dump.exe</filename></term>
+    <term><filename>bin\pg_dump\Release\pg_dumpall.exe</filename></term>
+    <term><filename>bin\pg_dump\Release\pg_restore.exe</filename></term>
+    <term><filename>bin\scripts\Release\clusterdb.exe</filename></term>
+    <term><filename>bin\scripts\Release\createdb.exe</filename></term>
+    <term><filename>bin\scripts\Release\createuser.exe</filename></term>
+    <term><filename>bin\scripts\Release\createlang.exe</filename></term>
+    <term><filename>bin\scripts\Release\dropdb.exe</filename></term>
+    <term><filename>bin\scripts\Release\dropuser.exe</filename></term>
+    <term><filename>bin\scripts\Release\droplang.exe</filename></term>
+    <term><filename>bin\scripts\Release\vacuumdb.exe</filename></term>
+    <term><filename>bin\scripts\Release\reindexdb.exe</filename></term>
     <listitem>
      <para>
-      The <productname>PostgreSQL</productname> interactive terminal
+     The <productname>PostgreSQL</productname> client applications and utilities.
      </para>
     </listitem>
    </varlistentry>
+
   </variablelist>
  </para>
 
index 987fd4b2284c8e8a12af5c7ae72ba9965a1512e8..dff02d67ceefa627ebe7c7dd755a281934a96304 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.122 2006/02/12 04:04:32 momjian Exp $
+ *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.123 2006/02/12 06:11:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "dumputils.h"
 
 #include <ctype.h>
+
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>
+#endif
 
 #ifdef WIN32
 #include <io.h>
index f5ffb8d8751a8ddbde66dc7efcd61cba823004dd..531ddb9e56678cda9b1a05b01d705431e9a92879 100644 (file)
@@ -5,7 +5,7 @@
  *     Implements the basic DB functions used by the archiver.
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.68 2006/02/09 18:28:29 tgl Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.69 2006/02/12 06:11:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "pg_backup_db.h"
 #include "dumputils.h"
 
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>
+#endif
+
 #include <ctype.h>
 
 #ifdef HAVE_TERMIOS_H
index 76eea193078ab4c6e8164c794accf84535673493..9dd373f252e4a3c690a33807be31e2450ea85da3 100644 (file)
@@ -17,7 +17,7 @@
  *
  *
  * IDENTIFICATION
- *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.16 2005/10/15 02:49:38 momjian Exp $
+ *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.17 2006/02/12 06:11:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -25,7 +25,9 @@
 #include "pg_backup.h"
 #include "pg_backup_archiver.h"
 
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>                            /* for dup */
+#endif
 
 #include "libpq/libpq-fs.h"
 
index cbd9f66865ed744d2063e5a966fdd440b2207f1f..b777fa140e507362cec32d8c28d9d1172363b870 100644 (file)
@@ -16,7 +16,7 @@
  *
  *
  * IDENTIFICATION
- *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.49 2005/10/15 02:49:38 momjian Exp $
+ *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.50 2006/02/12 06:11:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include <ctype.h>
 #include <limits.h>
+
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>
+#endif
 
 static void _ArchiveEntry(ArchiveHandle *AH, TocEntry *te);
 static void _StartData(ArchiveHandle *AH, TocEntry *te);
index fb0be000d581a5d9744dce8fad339956b8243f22..c88f383bf0b3368329e6e4a29c3c894d5e6859b5 100644 (file)
@@ -12,7 +12,7 @@
  *     by PostgreSQL
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.428 2006/02/12 03:22:18 momjian Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.429 2006/02/12 06:11:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
  */
 #include "postgres.h"
 
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>
+#endif
+
 #include <ctype.h>
 #ifdef ENABLE_NLS
 #include <locale.h>
index a811b6353edcd6f58d2077d63e9e73b414500942..cd198ee6e7f284e30418a123401680eaa29bdf4f 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.70 2006/02/12 03:22:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.71 2006/02/12 06:11:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "postgres_fe.h"
 
 #include <time.h>
+
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>
+#endif
+
 #ifdef ENABLE_NLS
 #include <locale.h>
 #endif
index 4f00454a7930f2d292a08144050e1125cd5a5e13..dc233c9b0ee8db518ea6d5e48cdddd0ae917b9ac 100644 (file)
@@ -34,7 +34,7 @@
  *
  *
  * IDENTIFICATION
- *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.75 2006/02/12 04:07:25 momjian Exp $
+ *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.76 2006/02/12 06:11:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,7 +53,9 @@
 #include <termios.h>
 #endif
 
+#ifndef WIN32_CLIENT_ONLY
 #include <unistd.h>
+#endif
 
 #include "getopt_long.h"
 
diff --git a/src/bin/pg_dump/win32.mak b/src/bin/pg_dump/win32.mak
new file mode 100644 (file)
index 0000000..653fefe
--- /dev/null
@@ -0,0 +1,186 @@
+# Makefile for Microsoft Visual C++ 5.0 (or compat)
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+CPP=cl.exe
+PERL=perl.exe
+FLEX=flex.exe
+YACC=bison.exe
+MV=move
+
+!IFDEF DEBUG
+OPT=/Od /Zi /MDd
+LOPT=/DEBUG
+DEBUGDEF=/D _DEBUG
+OUTDIR=.\Debug
+INTDIR=.\Debug
+!ELSE
+OPT=/O2 /MD
+LOPT=
+DEBUGDEF=/D NDEBUG
+OUTDIR=.\Release
+INTDIR=.\Release
+!ENDIF
+
+REFDOCDIR= ../../../doc/src/sgml/ref
+
+CPP_PROJ=/nologo $(OPT) /W3 /GX /D "WIN32" $(DEBUGDEF) /D "_CONSOLE" /D\
+ "_MBCS" /Fp"$(INTDIR)\pg_dump.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
+ /I ..\..\include /I ..\..\interfaces\libpq /I ..\..\include\port\win32 /I ..\..\backend \
+ /D "HAVE_STRDUP" /D "FRONTEND"
+
+CPP_OBJS=$(INTDIR)/
+CPP_SBRS=.
+
+ALL : ..\..\backend\parser\parse.h "..\..\port\pg_config_paths.h" \
+ "$(OUTDIR)\pg_dump.exe" "$(OUTDIR)\pg_dumpall.exe" "$(OUTDIR)\pg_restore.exe"
+
+CLEAN :
+       -@erase "$(INTDIR)\pg_backup_archiver.obj"
+       -@erase "$(INTDIR)\pg_backup_db.obj"
+       -@erase "$(INTDIR)\pg_backup_custom.obj"
+       -@erase "$(INTDIR)\pg_backup_files.obj"
+       -@erase "$(INTDIR)\pg_backup_null.obj"
+       -@erase "$(INTDIR)\pg_backup_tar.obj"
+       -@erase "$(INTDIR)\dumputils.obj"
+       -@erase "$(INTDIR)\common.obj" 
+       -@erase "$(INTDIR)\pg_dump_sort.obj" 
+       -@erase "$(INTDIR)\keywords.obj" 
+       -@erase "$(INTDIR)\exec.obj"
+       -@erase "$(INTDIR)\getopt.obj"
+       -@erase "$(INTDIR)\getopt_long.obj"
+       -@erase "$(INTDIR)\path.obj"
+       -@erase "$(INTDIR)\pgstrcasecmp.obj"
+       -@erase "$(INTDIR)\sprompt.obj"
+       -@erase "$(INTDIR)\pg_dump.pch"
+       -@erase "$(OUTDIR)\pg_dump.obj"
+       -@erase "$(OUTDIR)\pg_dump.exe"
+       -@erase "$(INTDIR)\pg_dumpall.obj"
+       -@erase "$(OUTDIR)\pg_dumpall.exe"
+       -@erase "$(INTDIR)\pg_restore.obj"
+       -@erase "$(OUTDIR)\pg_restore.exe"
+#      -@erase "$(INTDIR)\..\..\port\pg_config_paths.h"
+#      -@erase "$(INTDIR)\..\..\backend\parser\parse.h" 
+#      -@erase "$(INTDIR)\..\..\backend\parser\gram.c"
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shfolder.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
+ odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no
+LINK32_FLAGS_DMP= \
+ /pdb:"$(OUTDIR)\pg_dump.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_dump.exe"
+LINK32_FLAGS_ALL= \
+ /pdb:"$(OUTDIR)\pg_dumpall.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_dumpall.exe"
+LINK32_FLAGS_RES= \
+ /pdb:"$(OUTDIR)\pg_restore.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_restore.exe"
+
+LINK32_OBJS= \
+       "$(INTDIR)\pg_backup_archiver.obj" \
+       "$(INTDIR)\pg_backup_db.obj" \
+       "$(INTDIR)\pg_backup_custom.obj" \
+       "$(INTDIR)\pg_backup_files.obj" \
+       "$(INTDIR)\pg_backup_null.obj" \
+       "$(INTDIR)\pg_backup_tar.obj" \
+       "$(INTDIR)\dumputils.obj" \
+       "$(INTDIR)\keywords.obj" \
+       "$(INTDIR)\exec.obj" \
+       "$(INTDIR)\getopt.obj" \
+       "$(INTDIR)\getopt_long.obj" \
+       "$(INTDIR)\path.obj" \
+       "$(INTDIR)\pgstrcasecmp.obj" \
+       "$(INTDIR)\sprompt.obj"
+
+LINK32_OBJS_DMP= \
+       "$(INTDIR)\common.obj" \
+       "$(INTDIR)\pg_dump_sort.obj" \
+       "$(INTDIR)\pg_dump.obj"
+LINK32_OBJS_RES= "$(INTDIR)\pg_restore.obj"
+LINK32_OBJS_ALL= "$(INTDIR)\pg_dumpall.obj"
+
+!IFDEF DEBUG
+LINK32_OBJS    = $(LINK32_OBJS) "..\..\interfaces\libpq\Debug\libpqddll.lib"
+!ELSE
+LINK32_OBJS    = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\libpqdll.lib"
+!ENDIF
+
+"..\..\port\pg_config_paths.h": 
+       echo #define PGBINDIR "" >$@
+       echo #define PGSHAREDIR "" >>$@
+       echo #define SYSCONFDIR "" >>$@
+       echo #define INCLUDEDIR "" >>$@
+       echo #define PKGINCLUDEDIR "" >>$@
+       echo #define INCLUDEDIRSERVER "" >>$@
+       echo #define LIBDIR "" >>$@
+       echo #define PKGLIBDIR "" >>$@
+       echo #define LOCALEDIR "" >>$@
+       echo #define DOCDIR "" >>$@
+       echo #define MANDIR "" >>$@
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(OUTDIR)\pg_dump.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32_OBJS_DMP)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_FLAGS_DMP) $(LINK32_OBJS) $(LINK32_OBJS_DMP)
+<<
+
+"$(OUTDIR)\pg_dumpall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32_OBJS_ALL)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_FLAGS_ALL) $(LINK32_OBJS) $(LINK32_OBJS_ALL)
+<<
+
+"$(OUTDIR)\pg_restore.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32_OBJS_RES)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_FLAGS_RES) $(LINK32_OBJS) $(LINK32_OBJS_RES)
+<<
+
+"$(INTDIR)\keywords.obj" : ..\..\backend\parser\keywords.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\backend\parser\keywords.c
+<<
+
+"$(INTDIR)\exec.obj" : ..\..\port\exec.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\exec.c
+<<
+
+"$(INTDIR)\getopt.obj" : "$(INTDIR)" ..\..\port\getopt.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\getopt.c
+<<
+
+"$(INTDIR)\getopt_long.obj" : "$(INTDIR)" ..\..\port\getopt_long.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\getopt_long.c
+<<
+
+"$(INTDIR)\path.obj" : "$(INTDIR)" ..\..\port\path.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\path.c
+<<
+
+"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\pgstrcasecmp.c
+<<
+
+"$(INTDIR)\sprompt.obj" : "$(INTDIR)" ..\..\port\sprompt.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\sprompt.c
+<<
+
+..\..\backend\parser\parse.h : ..\..\backend\parser\gram.y
+       $(YACC) -y -d  ..\..\backend\parser\gram.y
+       $(MV) ..\..\backend\parser\y.tab.h ..\..\backend\parser\parse.h 
+       $(MV) ..\..\backend\parser\y.tab.c ..\..\backend\parser\gram.c
+
+.c{$(CPP_OBJS)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+
index ffa386c99227710111e503cfc015ccb6428a8f49..db578af374cd0c1a77fa19f8ae6e9306f192557b 100644 (file)
@@ -23,6 +23,9 @@
 #define HAVE_RANDOM
 #endif
 
+#define INT64_FORMAT "%I64d"
+#define HAVE_DECL_VSNPRINTF 1
+
 /* use _snprintf and _vsnprintf */
 #define HAVE_DECL_SNPRINTF 1
 #define snprintf        _snprintf
index 5a69de50a2caed427134bec6c21ac111df45dc89..1e6413c920e7a68239ef622bba3b1d1af092a04f 100644 (file)
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/win32.mak,v 1.10 2005/06/14 17:50:37 momjian Exp $
+# $PostgreSQL: pgsql/src/win32.mak,v 1.11 2006/02/12 06:11:50 momjian Exp $
 
 # Makefile for Microsoft Visual C++ 5.0 (or compat)
 # Top-file makefile for Win32 parts of postgresql.
@@ -18,6 +18,10 @@ ALL:
    nmake /f win32.mak $(MAKEMACRO)
    cd ..\..\bin\psql
    nmake /f win32.mak $(MAKEMACRO)
+   cd ..\..\bin\pg_dump
+   nmake /f win32.mak $(MAKEMACRO)
+   cd ..\..\bin\scripts
+   nmake /f win32.mak $(MAKEMACRO)
    cd ..\..\bin\pg_config
    nmake /f win32.mak $(MAKEMACRO)
    cd ..\..
@@ -28,6 +32,10 @@ CLEAN:
    nmake /f win32.mak CLEAN
    cd ..\..\bin\psql
    nmake /f win32.mak CLEAN
+   cd ..\..\bin\pg_dump
+   nmake /f win32.mak CLEAN
+   cd ..\..\bin\scripts
+   nmake /f win32.mak CLEAN
    cd ..\..\bin\pg_config
    nmake /f win32.mak CLEAN
    cd ..\..