aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-01-11 02:40:12 +0000
committerBruce Momjian <bruce@momjian.us>2007-01-11 02:40:12 +0000
commit6a59778360f372ee8246f5b3cf88ff925e67db1f (patch)
treeb80b39385eb6d0e5cb74926ef5446d722185c866 /src
parent9c505e484cbb06bb7d688c86e3d0c54d49414f27 (diff)
downloadpostgresql-6a59778360f372ee8246f5b3cf88ff925e67db1f.tar.gz
postgresql-6a59778360f372ee8246f5b3cf88ff925e67db1f.zip
Allow Borland CC to compile libpq and psql.
Backpatch to 8.2.X. L Bayuk
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/bcc32.mak35
-rw-r--r--src/include/c.h4
-rw-r--r--src/include/port.h4
-rw-r--r--src/include/port/win32.h10
-rw-r--r--src/interfaces/libpq/bcc32.mak24
-rw-r--r--src/interfaces/libpq/win32.mak2
6 files changed, 61 insertions, 18 deletions
diff --git a/src/bin/psql/bcc32.mak b/src/bin/psql/bcc32.mak
index d429a5b9e4a..9115a136b61 100644
--- a/src/bin/psql/bcc32.mak
+++ b/src/bin/psql/bcc32.mak
@@ -60,7 +60,7 @@ INTDIR=.\Release
!endif
REFDOCDIR=../../../doc/src/sgml/ref
-CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32 \
+CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32;..\..\include\port\win32_msvc;..\pg_dump;..\..\backend \
-c -D$(USERDEFINES) -DFRONTEND -n"$(INTDIR)" -tWM -tWC -q -5 -a8 -pc -X -w-use \
-w-par -w-pia -w-csu -w-aus -w-ccc
@@ -98,6 +98,7 @@ CLEAN :
-@erase "$(INTDIR)\mbprint.obj"
-@erase "$(INTDIR)\print.obj"
-@erase "$(INTDIR)\prompt.obj"
+ -@erase "$(INTDIR)\psqlscan.obj"
-@erase "$(INTDIR)\startup.obj"
-@erase "$(INTDIR)\stringutils.obj"
-@erase "$(INTDIR)\tab-complete.obj"
@@ -105,9 +106,13 @@ CLEAN :
-@erase "$(INTDIR)\exec.obj"
-@erase "$(INTDIR)\getopt.obj"
-@erase "$(INTDIR)\getopt_long.obj"
+ -@erase "$(INTDIR)\snprintf.obj"
-@erase "$(INTDIR)\path.obj"
+ -@erase "$(INTDIR)\strlcpy.obj"
-@erase "$(INTDIR)\pgstrcasecmp.obj"
-@erase "$(INTDIR)\sprompt.obj"
+ -@erase "$(INTDIR)\dumputils.obj"
+ -@erase "$(INTDIR)\keywords.obj"
-@erase "$(INTDIR)\psql.ilc"
-@erase "$(INTDIR)\psql.ild"
-@erase "$(INTDIR)\psql.tds"
@@ -138,9 +143,13 @@ LINK32_OBJS= \
"$(INTDIR)\exec.obj" \
"$(INTDIR)\getopt.obj" \
"$(INTDIR)\getopt_long.obj" \
+ "$(INTDIR)\snprintf.obj" \
"$(INTDIR)\path.obj" \
+ "$(INTDIR)\strlcpy.obj" \
"$(INTDIR)\pgstrcasecmp.obj" \
- "$(INTDIR)\sprompt.obj"
+ "$(INTDIR)\sprompt.obj" \
+ "$(INTDIR)\dumputils.obj" \
+ "$(INTDIR)\keywords.obj"
!IFDEF DEBUG
LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Debug\blibpqddll.lib"
@@ -149,7 +158,7 @@ LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib"
!ENDIF
# Have to use \# so # isn't treated as a comment, but MSVC doesn't like this
-"..\..\port\pg_config_paths.h": win32.mak
+"..\..\port\pg_config_paths.h": bcc32.mak
echo \#define PGBINDIR "" >$@
echo \#define PGSHAREDIR "" >>$@
echo \#define SYSCONFDIR "" >>$@
@@ -188,11 +197,21 @@ LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib"
$(CPP_PROJ) ..\..\port\getopt_long.c
<<
+"$(INTDIR)\snprintf.obj" : "$(INTDIR)" ..\..\port\snprintf.c
+ $(CPP) @<<
+ $(CPP_PROJ) ..\..\port\snprintf.c
+<<
+
"$(INTDIR)\path.obj" : "$(INTDIR)" ..\..\port\path.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\path.c
<<
+"$(INTDIR)\strlcpy.obj" : "$(INTDIR)" ..\..\port\strlcpy.c
+ $(CPP) @<<
+ $(CPP_PROJ) ..\..\port\strlcpy.c
+<<
+
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
@@ -203,6 +222,16 @@ LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib"
$(CPP_PROJ) ..\..\port\sprompt.c
<<
+"$(INTDIR)\dumputils.obj" : "$(INTDIR)" ..\pg_dump\dumputils.c
+ $(CPP) @<<
+ $(CPP_PROJ) ..\pg_dump\dumputils.c
+<<
+
+"$(INTDIR)\keywords.obj" : "$(INTDIR)" ..\..\backend\parser\keywords.c
+ $(CPP) @<<
+ $(CPP_PROJ) ..\..\backend\parser\keywords.c
+<<
+
"sql_help.h": create_help.pl
$(PERL) create_help.pl $(REFDOCDIR) $@
diff --git a/src/include/c.h b/src/include/c.h
index a7281dab829..61400a7f682 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.214 2006/10/04 00:30:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.214.2.1 2007/01/11 02:40:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,7 +59,7 @@
#include "postgres_ext.h"
#include "pg_trace.h"
-#if defined(__BORLANDC__) || (_MSC_VER >= 1400)
+#if _MSC_VER >= 1400
#define errcode __msvc_errcode
#include <crtdefs.h>
#undef errcode
diff --git a/src/include/port.h b/src/include/port.h
index 59a15c103ca..ed06e895eba 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.106 2006/11/28 01:12:33 adunstan Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.106.2.1 2007/01/11 02:40:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -343,7 +343,7 @@ extern char *strdup(const char *str);
extern size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
-#ifndef HAVE_RANDOM
+#if !defined(HAVE_RANDOM) && !defined(__BORLANDC__)
extern long random(void);
#endif
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index b23123bc4ab..60f10e89e79 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.63 2006/10/19 20:03:08 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.63.2.1 2007/01/11 02:40:12 momjian Exp $ */
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define WIN32_ONLY_COMPILER
@@ -17,7 +17,9 @@
#include <signal.h>
#include <errno.h>
#include <direct.h>
+#ifndef __BORLANDC__
#include <sys/utime.h> /* for non-unicode version */
+#endif
#undef near
/* Must be here to avoid conflicting with prototype in windows.h */
@@ -149,8 +151,10 @@ int semop(int semId, struct sembuf * sops, int flag);
#define SIGTTIN 21
#define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */
#define SIGWINCH 28
+#ifndef __BORLANDC__
#define SIGUSR1 30
#define SIGUSR2 31
+#endif
struct timezone
{
@@ -259,8 +263,10 @@ extern void _dosmaperr(unsigned long);
/* Things that exist in MingW headers, but need to be added to MSVC */
#ifdef WIN32_ONLY_COMPILER
+#ifndef __BORLANDC__
typedef long ssize_t;
typedef unsigned short mode_t;
+#endif
/*
* Certain "standard edition" versions of MSVC throw a warning
@@ -271,6 +277,7 @@ typedef unsigned short mode_t;
#define inline __inline
#define __inline__ __inline
+#ifndef __BORLANDC__
#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
#define _S_IXUSR _S_IEXEC
#define _S_IWUSR _S_IWRITE
@@ -280,6 +287,7 @@ typedef unsigned short mode_t;
#define S_IXUSR _S_IXUSR
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
#define F_OK 0
#define W_OK 2
diff --git a/src/interfaces/libpq/bcc32.mak b/src/interfaces/libpq/bcc32.mak
index 30e25a29abb..992bb5b68e7 100644
--- a/src/interfaces/libpq/bcc32.mak
+++ b/src/interfaces/libpq/bcc32.mak
@@ -76,7 +76,6 @@ ALL : config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib"
CLEAN :
-@erase "$(INTDIR)\getaddrinfo.obj"
-@erase "$(INTDIR)\pgstrcasecmp.obj"
- -@erase "$(INTDIR)\strlcpy.obj"
-@erase "$(INTDIR)\thread.obj"
-@erase "$(INTDIR)\inet_aton.obj"
-@erase "$(INTDIR)\crypt.obj"
@@ -99,6 +98,8 @@ CLEAN :
-@erase "$(INTDIR)\wchar.obj"
-@erase "$(INTDIR)\encnames.obj"
-@erase "$(INTDIR)\pthread-win32.obj"
+ -@erase "$(INTDIR)\snprintf.obj"
+ -@erase "$(INTDIR)\strlcpy.obj"
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
-@erase "$(OUTDIR)\libpq.res"
@@ -113,7 +114,6 @@ LIB32_OBJS= \
"$(INTDIR)\win32.obj" \
"$(INTDIR)\getaddrinfo.obj" \
"$(INTDIR)\pgstrcasecmp.obj" \
- "$(INTDIR)\strlcpy.obj" \
"$(INTDIR)\thread.obj" \
"$(INTDIR)\inet_aton.obj" \
"$(INTDIR)\crypt.obj" \
@@ -133,6 +133,8 @@ LIB32_OBJS= \
"$(INTDIR)\pqsignal.obj" \
"$(INTDIR)\wchar.obj" \
"$(INTDIR)\encnames.obj" \
+ "$(INTDIR)\snprintf.obj" \
+ "$(INTDIR)\strlcpy.obj" \
"$(INTDIR)\pthread-win32.obj"
@@ -162,7 +164,7 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
$(LINK32_FLAGS) +
c0d32.obj $(LINK32_OBJS), +
$@,, +
- "$(OUTDIR)\blibpq.lib" import32.lib cw32mti.lib, +
+ "$(OUTDIR)\blibpq.lib" import32.lib cw32mt.lib, +
blibpqdll.def,"$(INTDIR)\libpq.res"
<<
implib -w "$(OUTDIR)\blibpqdll.lib" blibpqdll.def $@
@@ -187,11 +189,6 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
<<
-"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
- $(CPP) @<<
- $(CPP_PROJ) ..\..\port\strlcpy.c
-<<
-
"$(INTDIR)\thread.obj" : ..\..\port\thread.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\thread.c
@@ -233,5 +230,16 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
<<
+"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c
+ $(CPP) @<<
+ $(CPP_PROJ) /I"." ..\..\port\snprintf.c
+<<
+
+"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
+ $(CPP) @<<
+ $(CPP_PROJ) ..\..\port\strlcpy.c
+<<
+
+
.c.obj:
$(CPP) $(CPP_PROJ) $<
diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak
index 0fd56eb1741..ca5f4326aa9 100644
--- a/src/interfaces/libpq/win32.mak
+++ b/src/interfaces/libpq/win32.mak
@@ -74,8 +74,6 @@ CLEAN :
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
-@erase "$(OUTDIR)\libpq.res"
-@erase "$(OUTDIR)\$(OUTFILENAME).dll"
-# -@erase "*.pch"
-# -@erase "$(OUTDIR)\libpq.pch"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp"
-@erase "$(INTDIR)\pg_config_paths.h"