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

Commit7cebfdf

Browse files
committed
Backpatch BCC compile changes to 8.0.X for psql.
1 parent18b5ef5 commit7cebfdf

File tree

9 files changed

+243
-218
lines changed

9 files changed

+243
-218
lines changed

‎src/bin/psql/bcc32.mak

Lines changed: 106 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Makefile for Borland C++ 5.5
2+
23
# Borland C++ base install directory goes here
3-
# BCB=d:\Borland\Bcc55
4+
# BCB=c:\Borland\Bcc55
5+
6+
!IF "$(BCB)" == ""
7+
!MESSAGE You must edit bcc32.mak and define BCB at the top
8+
!ERROR missing BCB
9+
!ENDIF
10+
11+
!IF "$(__NMAKE__)" == ""
12+
!MESSAGE You must use the -N compatibility flag, e.g. make -N -f bcc32.make
13+
!ERROR missing -N
14+
!ENDIF
415

516
!MESSAGE Building PSQL.EXE ...
617
!MESSAGE
@@ -19,7 +30,7 @@ CFG=Release
1930
!MESSAGE You can specify a configuration when running MAKE
2031
!MESSAGEbydefiningthemacroCFGonthecommandline.Forexample:
2132
!MESSAGE
22-
!MESSAGE make -DCFG=[Release | Debug]/f bcc32.mak
33+
!MESSAGE make-N -DCFG=[Release | Debug]-f bcc32.mak
2334
!MESSAGE
2435
!MESSAGEPossiblechoicesforconfigurationare:
2536
!MESSAGE
@@ -49,10 +60,29 @@ INTDIR=.\Release
4960
!endif
5061
REFDOCDIR=../../../doc/src/sgml/ref
5162

63+
CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32\
64+
-c -D$(USERDEFINES) -DFRONTEND -n"$(INTDIR)" -tWM -tWC -q -5 -a8 -pc -X -w-use\
65+
-w-par -w-pia -w-csu -w-aus -w-ccc
66+
67+
!IFDEF DEBUG
68+
CPP_PROJ =$(CPP_PROJ) -Od -r- -k -v -y -vi- -D_DEBUG
69+
LIBPG_DIR = Debug
70+
!ELSE
71+
CPP_PROJ=$(CPP_PROJ) -O -Oi -OS -DNDEBUG
72+
LIBPG_DIR = Release
73+
!ENDIF
74+
75+
!IFDEF DLL_LIBS
76+
CPP_PROJ=$(CPP_PROJ) -D_RTLDLL
77+
LIBRARIES= cw32mti.lib ..\..\interfaces\libpq\$(LIBPG_DIR)\blibpqdll.lib
78+
!ELSE
79+
CPP_PROJ=$(CPP_PROJ) -DBCC32_STATIC
80+
LIBRARIES= cw32mt.lib ..\..\interfaces\libpq\$(LIBPG_DIR)\blibpq.lib
81+
!ENDIF
82+
5283
.path.obj =$(INTDIR)
5384

54-
.c.obj:
55-
$(CPP) -o"$(INTDIR)\$&"$(CPP_PROJ)$<
85+
USERDEFINES = WIN32;_CONSOLE;_MBCS;HAVE_STRDUP
5686

5787
ALL : sql_help.h psqlscan.c "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
5888

@@ -86,68 +116,51 @@ CLEAN :
86116
-@erase"$(OUTDIR)\psql.exe"
87117
-@erase"$(INTDIR)\..\..\port\pg_config_paths.h"
88118

89-
"..\..\port\pg_config_paths.h": win32.mak
90-
echo#define PGBINDIR "" >$@
91-
echo#define PGSHAREDIR "" >>$@
92-
echo#define SYSCONFDIR "" >>$@
93-
echo#define INCLUDEDIR "" >>$@
94-
echo#define PKGINCLUDEDIR "" >>$@
95-
echo#define INCLUDEDIRSERVER "" >>$@
96-
echo#define LIBDIR "" >>$@
97-
echo#define PKGLIBDIR "" >>$@
98-
echo#define LOCALEDIR "" >>$@
99-
100-
"$(OUTDIR)" :
101-
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
102-
103-
USERDEFINES = WIN32;_CONSOLE;_MBCS;HAVE_STRDUP
104-
105-
# ---------------------------------------------------------------------------
106-
CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32\
107-
-c -D$(USERDEFINES) -DFRONTEND -tWM -tWC -q -5 -a8 -pc -X -w-use -w-par -w-pia\
108-
-w-csu -w-aus -w-ccc
119+
LINK32=ilink32.exe
120+
LINK32_FLAGS=-L$(BCB)\lib;.\$(LIBPG_DIR) -x -v
121+
LINK32_OBJS=\
122+
"$(INTDIR)\command.obj"\
123+
"$(INTDIR)\common.obj"\
124+
"$(INTDIR)\copy.obj"\
125+
"$(INTDIR)\describe.obj"\
126+
"$(INTDIR)\help.obj"\
127+
"$(INTDIR)\input.obj"\
128+
"$(INTDIR)\large_obj.obj"\
129+
"$(INTDIR)\mainloop.obj"\
130+
"$(INTDIR)\mbprint.obj"\
131+
"$(INTDIR)\print.obj"\
132+
"$(INTDIR)\prompt.obj"\
133+
"$(INTDIR)\psqlscan.obj"\
134+
"$(INTDIR)\startup.obj"\
135+
"$(INTDIR)\stringutils.obj"\
136+
"$(INTDIR)\tab-complete.obj"\
137+
"$(INTDIR)\variables.obj"\
138+
"$(INTDIR)\exec.obj"\
139+
"$(INTDIR)\getopt.obj"\
140+
"$(INTDIR)\getopt_long.obj"\
141+
"$(INTDIR)\path.obj"\
142+
"$(INTDIR)\pgstrcasecmp.obj"\
143+
"$(INTDIR)\sprompt.obj"
109144

110145
!IFDEF DEBUG
111-
CPP_PROJ =$(CPP_PROJ) -Od -r- -k -v -y -vi- -D_DEBUG
112-
LIBPG_DIR = Debug
146+
LINK32_OBJS=$(LINK32_OBJS) "..\..\interfaces\libpq\Debug\blibpqddll.lib"
113147
!ELSE
114-
CPP_PROJ=$(CPP_PROJ) -O -Oi -OS -DNDEBUG
115-
LIBPG_DIR = Release
148+
LINK32_OBJS=$(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib"
116149
!ENDIF
117150

118-
!IFDEF DLL_LIBS
119-
CPP_PROJ=$(CPP_PROJ) -D_RTLDLL
120-
LIBRARIES= cw32mti.lib ..\..\interfaces\libpq\$(LIBPG_DIR)\blibpqdll.lib
121-
!ELSE
122-
CPP_PROJ=$(CPP_PROJ) -DBCC32_STATIC
123-
LIBRARIES= cw32mt.lib ..\..\interfaces\libpq\$(LIBPG_DIR)\blibpq.lib
124-
!ENDIF
151+
"..\..\port\pg_config_paths.h": win32.mak
152+
echo\#define PGBINDIR"">$@
153+
echo\#define PGSHAREDIR"">>$@
154+
echo\#define SYSCONFDIR"">>$@
155+
echo\#define INCLUDEDIR"">>$@
156+
echo\#define PKGINCLUDEDIR"">>$@
157+
echo\#define INCLUDEDIRSERVER"">>$@
158+
echo\#define LIBDIR"">>$@
159+
echo\#define PKGLIBDIR"">>$@
160+
echo\#define LOCALEDIR"">>$@
125161

126-
LINK32=ilink32.exe
127-
LINK32_FLAGS=-L$(BCB)\lib;.\$(LIBPG_DIR) -x -v
128-
LINK32_OBJS=\
129-
command.obj\
130-
common.obj\
131-
copy.obj\
132-
describe.obj\
133-
help.obj\
134-
input.obj\
135-
large_obj.obj\
136-
mainloop.obj\
137-
mbprint.obj
138-
print.obj \
139-
prompt.obj \
140-
startup.obj \
141-
stringutils.obj \
142-
tab-complete.obj \
143-
variables.obj \
144-
exec.obj \
145-
getopt.obj \
146-
getopt_long.obj \
147-
path.obj \
148-
pgstrcasecmp.obj \
149-
sprompt.obj \
150-
162+
"$(OUTDIR)" :
163+
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
151164

152165
"$(OUTDIR)\psql.exe" : "$(OUTDIR)"$(LINK32_OBJS)
153166
$(LINK32) @&&!
@@ -157,15 +170,42 @@ LINK32_OBJS= \
157170
import32.lib$(LIBRARIES),,
158171
!
159172

160-
exec.obj : "$(OUTDIR)" ..\..\port\exec.c
161-
getopt.obj : "$(OUTDIR)" ..\..\port\getopt.c
162-
getopt_long.obj : "$(OUTDIR)" ..\..\port\getopt_long.c
163-
path.obj : "$(OUTDIR)" ..\..\port\path.c
164-
pgstrcasecmp.obj : "$(OUTDIR)" ..\..\port\pgstrcasecmp.c
165-
sprompt.obj : "$(OUTDIR)" ..\..\port\sprompt.c
173+
"$(INTDIR)\exec.obj" : ..\..\port\exec.c
174+
$(CPP) @<<
175+
$(CPP_PROJ) ..\..\port\exec.c
176+
<<
177+
178+
"$(INTDIR)\getopt.obj" : "$(INTDIR)" ..\..\port\getopt.c
179+
$(CPP) @<<
180+
$(CPP_PROJ) ..\..\port\getopt.c
181+
<<
182+
183+
"$(INTDIR)\getopt_long.obj" : "$(INTDIR)" ..\..\port\getopt_long.c
184+
$(CPP) @<<
185+
$(CPP_PROJ) ..\..\port\getopt_long.c
186+
<<
187+
188+
"$(INTDIR)\path.obj" : "$(INTDIR)" ..\..\port\path.c
189+
$(CPP) @<<
190+
$(CPP_PROJ) ..\..\port\path.c
191+
<<
192+
193+
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
194+
$(CPP) @<<
195+
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
196+
<<
197+
198+
"$(INTDIR)\sprompt.obj" : "$(INTDIR)" ..\..\port\sprompt.c
199+
$(CPP) @<<
200+
$(CPP_PROJ) ..\..\port\sprompt.c
201+
<<
166202

167203
"sql_help.h": create_help.pl
168204
$(PERL) create_help.pl $(REFDOCDIR) $@
169205

170206
psqlscan.c : psqlscan.l
171207
$(FLEX) -Cfe -opsqlscan.c psqlscan.l
208+
209+
.c.obj:
210+
$(CPP) -o"$(INTDIR)\$&"$(CPP_PROJ)$<
211+

‎src/bin/psql/command.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.142 2005/03/16 21:27:23 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.143 2005/04/29 13:42:20 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
1010

11+
#ifdefWIN32_CLIENT_ONLY/* needed for BCC */
12+
#undef mkdir
13+
#endif
14+
1115
#include<errno.h>
1216
#include<ctype.h>
1317
#ifdefHAVE_PWD_H

‎src/bin/psql/startup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.113 2005/02/22 04:40:58 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.114 2005/04/29 13:42:20 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -19,7 +19,7 @@
1919
#include"getopt_long.h"
2020

2121
#ifndefHAVE_INT_OPTRESET
22-
intoptreset;
22+
externintoptreset;
2323
#endif
2424

2525
#include<locale.h>

‎src/bin/psql/win32.mak

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ INTDIR=.\Release
2626

2727
REFDOCDIR= ../../../doc/src/sgml/ref
2828

29+
CPP_PROJ=/nologo$(OPT) /W3 /GX /D "WIN32"$(DEBUGDEF) /D "_CONSOLE" /D\
30+
"_MBCS" /Fp"$(INTDIR)\psql.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
31+
/I ..\..\include /I ..\..\interfaces\libpq /I ..\..\include\port\win32\
32+
/D "HAVE_STRDUP" /D "FRONTEND"
33+
34+
CPP_OBJS=$(INTDIR)/
35+
CPP_SBRS=.
36+
2937
ALL : sql_help.h psqlscan.c "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
3038

3139
CLEAN :
@@ -55,28 +63,6 @@ CLEAN :
5563
-@erase"$(OUTDIR)\psql.exe"
5664
-@erase"$(INTDIR)\..\..\port\pg_config_paths.h"
5765

58-
"..\..\port\pg_config_paths.h": win32.mak
59-
echo#define PGBINDIR "" >$@
60-
echo#define PGSHAREDIR "" >>$@
61-
echo#define SYSCONFDIR "" >>$@
62-
echo#define INCLUDEDIR "" >>$@
63-
echo#define PKGINCLUDEDIR "" >>$@
64-
echo#define INCLUDEDIRSERVER "" >>$@
65-
echo#define LIBDIR "" >>$@
66-
echo#define PKGLIBDIR "" >>$@
67-
echo#define LOCALEDIR "" >>$@
68-
69-
"$(OUTDIR)" :
70-
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
71-
72-
CPP_PROJ=/nologo$(OPT) /W3 /GX /D "WIN32"$(DEBUGDEF) /D "_CONSOLE" /D\
73-
"_MBCS" /Fp"$(INTDIR)\psql.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
74-
/I ..\..\include /I ..\..\interfaces\libpq /I ..\..\include\port\win32\
75-
/D "HAVE_STRDUP" /D "FRONTEND"
76-
77-
CPP_OBJS=$(INTDIR)/
78-
CPP_SBRS=.
79-
8066
LINK32=link.exe
8167
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
8268
advapi32.lib shfolder.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
@@ -104,13 +90,28 @@ LINK32_OBJS= \
10490
"$(INTDIR)\getopt_long.obj"\
10591
"$(INTDIR)\path.obj"\
10692
"$(INTDIR)\pgstrcasecmp.obj"\
107-
"$(INTDIR)\sprompt.obj"\
93+
"$(INTDIR)\sprompt.obj"
94+
10895
!IFDEF DEBUG
109-
"..\..\interfaces\libpq\Debug\libpqddll.lib"
96+
LINK32_OBJS=$(LINK32_OBJS)"..\..\interfaces\libpq\Debug\libpqddll.lib"
11097
!ELSE
111-
"..\..\interfaces\libpq\Release\libpqdll.lib"
98+
LINK32_OBJS=$(LINK32_OBJS)"..\..\interfaces\libpq\Release\libpqdll.lib"
11299
!ENDIF
113100

101+
"..\..\port\pg_config_paths.h": win32.mak
102+
echo\#define PGBINDIR"">$@
103+
echo\#define PGSHAREDIR"">>$@
104+
echo\#define SYSCONFDIR"">>$@
105+
echo\#define INCLUDEDIR"">>$@
106+
echo\#define PKGINCLUDEDIR"">>$@
107+
echo\#define INCLUDEDIRSERVER"">>$@
108+
echo\#define LIBDIR"">>$@
109+
echo\#define PKGLIBDIR"">>$@
110+
echo\#define LOCALEDIR"">>$@
111+
112+
"$(OUTDIR)" :
113+
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
114+
114115
"$(OUTDIR)\psql.exe" : "$(OUTDIR)"$(DEF_FILE)$(LINK32_OBJS)
115116
$(LINK32) @<<
116117
$(LINK32_FLAGS) $(LINK32_OBJS)
@@ -121,17 +122,17 @@ LINK32_OBJS= \
121122
$(CPP_PROJ) ..\..\port\exec.c
122123
<<
123124

124-
"$(OUTDIR)\getopt.obj" : "$(OUTDIR)" ..\..\port\getopt.c
125+
"$(INTDIR)\getopt.obj" : "$(INTDIR)" ..\..\port\getopt.c
125126
$(CPP) @<<
126127
$(CPP_PROJ) ..\..\port\getopt.c
127128
<<
128129

129-
"$(OUTDIR)\getopt_long.obj" : "$(OUTDIR)" ..\..\port\getopt_long.c
130+
"$(INTDIR)\getopt_long.obj" : "$(INTDIR)" ..\..\port\getopt_long.c
130131
$(CPP) @<<
131132
$(CPP_PROJ) ..\..\port\getopt_long.c
132133
<<
133134

134-
"$(OUTDIR)\path.obj" : "$(OUTDIR)" ..\..\port\path.c
135+
"$(INTDIR)\path.obj" : "$(INTDIR)" ..\..\port\path.c
135136
$(CPP) @<<
136137
$(CPP_PROJ) ..\..\port\path.c
137138
<<
@@ -141,23 +142,20 @@ LINK32_OBJS= \
141142
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
142143
<<
143144

144-
"$(OUTDIR)\sprompt.obj" : "$(OUTDIR)" ..\..\port\sprompt.c
145+
"$(INTDIR)\sprompt.obj" : "$(INTDIR)" ..\..\port\sprompt.c
145146
$(CPP) @<<
146147
$(CPP_PROJ) ..\..\port\sprompt.c
147148
<<
148149

150+
"sql_help.h" : create_help.pl
151+
$(PERL) create_help.pl $(REFDOCDIR) $@
152+
153+
psqlscan.c : psqlscan.l
154+
$(FLEX) -Cfe -opsqlscan.c psqlscan.l
155+
149156
.c{$(CPP_OBJS)}.obj::
150157
$(CPP) @<<
151158
$(CPP_PROJ) $<
152159
<<
153160

154-
.cpp{$(CPP_OBJS)}.obj::
155-
$(CPP) @<<
156-
$(CPP_PROJ) $<
157-
<<
158161

159-
sql_help.h : create_help.pl
160-
$(PERL) create_help.pl $(REFDOCDIR) $@
161-
162-
psqlscan.c: psqlscan.l
163-
$(FLEX) -Cfe -opsqlscan.c psqlscan.l

‎src/interfaces/libpq/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.131 2005/03/25 00:34:28 tgl Exp $
8+
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.132 2005/04/29 13:42:21 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -145,7 +145,8 @@ uninstall: uninstall-lib
145145
rm -f$(DESTDIR)$(includedir)/libpq-fe.h$(DESTDIR)$(includedir_internal)/libpq-int.h$(DESTDIR)$(includedir_internal)/pqexpbuffer.h
146146

147147
cleandistclean: clean-lib
148-
rm -f$(OBJS) crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c md5.c ip.c encnames.c wchar.c pthread.h
148+
# pg_config_paths.h might be left over from a Win32 client-only build
149+
rm -f$(OBJS) pg_config_paths.h crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c md5.c ip.c encnames.c wchar.c pthread.h
149150

150151
maintainer-clean: distclean
151152
rm -f$(srcdir)/libpqdll.def$(srcdir)/libpqddll.def$(srcdir)/blibpqdll.def$(srcdir)/libpq.rc

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp