Skip to content

Commit 53cd7cd

Browse files
committed
Make a separate win32 debug DLL along with the non-debug version:
Currently, src/interfaces/libpq/win32.mak builds a statically-linked library "libpq.lib", a debug dll "libpq.dll", import library for the debug dll "libpqdll.lib", a release dll "libpq.dll", import library for the release dll "libpqdll.lib". To avoid naming clashes, I would make the debug dll and import libraries "libpqd.dll" and "libpqddll.lib". Basically, the debug build uses the cl flags: "/MDd /D _DEBUG", and the release build uses the cl flags "/MD /D NDEBUG". Usually the debug build has a "D" suffix on the file name, so for example: libpqd.dll libpq, debug build libpqd.lib libpq, debug build, import library libpq.dll libpq, release build libpq.lib libpq, release build, import library David Turner
1 parent f0f4e82 commit 53cd7cd

File tree

2 files changed

+133
-16
lines changed

2 files changed

+133
-16
lines changed

src/interfaces/libpq/libpqddll.def

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
; DEF file for MS VC++
2+
LIBRARY LIBPQD
3+
DESCRIPTION "PostgreSQL Client Library"
4+
EXPORTS
5+
PQconnectdb @ 1
6+
PQsetdbLogin @ 2
7+
PQconndefaults @ 3
8+
PQfinish @ 4
9+
PQreset @ 5
10+
PQrequestCancel @ 6
11+
PQdb @ 7
12+
PQuser @ 8
13+
PQpass @ 9
14+
PQhost @ 10
15+
PQport @ 11
16+
PQtty @ 12
17+
PQoptions @ 13
18+
PQstatus @ 14
19+
PQerrorMessage @ 15
20+
PQsocket @ 16
21+
PQbackendPID @ 17
22+
PQtrace @ 18
23+
PQuntrace @ 19
24+
PQsetNoticeProcessor @ 20
25+
PQexec @ 21
26+
PQnotifies @ 22
27+
PQsendQuery @ 23
28+
PQgetResult @ 24
29+
PQisBusy @ 25
30+
PQconsumeInput @ 26
31+
PQgetline @ 27
32+
PQputline @ 28
33+
PQgetlineAsync @ 29
34+
PQputnbytes @ 30
35+
PQendcopy @ 31
36+
PQfn @ 32
37+
PQresultStatus @ 33
38+
PQntuples @ 34
39+
PQnfields @ 35
40+
PQbinaryTuples @ 36
41+
PQfname @ 37
42+
PQfnumber @ 38
43+
PQftype @ 39
44+
PQfsize @ 40
45+
PQfmod @ 41
46+
PQcmdStatus @ 42
47+
PQoidStatus @ 43
48+
PQcmdTuples @ 44
49+
PQgetvalue @ 45
50+
PQgetlength @ 46
51+
PQgetisnull @ 47
52+
PQclear @ 48
53+
PQmakeEmptyPGresult @ 49
54+
PQprint @ 50
55+
PQdisplayTuples @ 51
56+
PQprintTuples @ 52
57+
lo_open @ 53
58+
lo_close @ 54
59+
lo_read @ 55
60+
lo_write @ 56
61+
lo_lseek @ 57
62+
lo_creat @ 58
63+
lo_tell @ 59
64+
lo_unlink @ 60
65+
lo_import @ 61
66+
lo_export @ 62
67+
pgresStatus @ 63
68+
PQmblen @ 64
69+
PQresultErrorMessage @ 65
70+
PQresStatus @ 66
71+
termPQExpBuffer @ 67
72+
appendPQExpBufferChar @ 68
73+
initPQExpBuffer @ 69
74+
resetPQExpBuffer @ 70
75+
PQoidValue @ 71
76+
PQclientEncoding @ 72
77+
PQenv2encoding @ 73
78+
appendBinaryPQExpBuffer @ 74
79+
appendPQExpBufferStr @ 75
80+
destroyPQExpBuffer @ 76
81+
createPQExpBuffer @ 77
82+
PQconninfoFree @ 78
83+
PQconnectPoll @ 79
84+
PQconnectStart @ 80
85+
PQflush @ 81
86+
PQisnonblocking @ 82
87+
PQresetPoll @ 83
88+
PQresetStart @ 84
89+
PQsetClientEncoding @ 85
90+
PQsetnonblocking @ 86
91+
PQfreeNotify @ 87
92+
PQescapeString @ 88
93+
PQescapeBytea @ 89
94+
printfPQExpBuffer @ 90
95+
appendPQExpBuffer @ 91
96+
pg_encoding_to_char @ 92
97+
pg_utf_mblen @ 93
98+
PQunescapeBytea @ 94
99+
PQfreemem @ 95
100+
PQtransactionStatus @ 96
101+
PQparameterStatus @ 97
102+
PQprotocolVersion @ 98
103+
PQsetErrorVerbosity @ 99
104+
PQsetNoticeReceiver @ 100
105+
PQexecParams @ 101
106+
PQsendQueryParams @ 102
107+
PQputCopyData @ 103
108+
PQputCopyEnd @ 104
109+
PQgetCopyData @ 105
110+
PQresultErrorField @ 106
111+
PQftable @ 107
112+
PQftablecol @ 108
113+
PQfformat @ 109
114+
PQexecPrepared @ 110
115+
PQsendQueryPrepared @ 111

src/interfaces/libpq/win32.mak

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Makefile for Microsoft Visual C++ 5.0 (or compat)
22

3-
# Will build a Win32 static library libpq.lib
4-
# and a Win32 dynamic library libpq.dll with import library libpqdll.lib
3+
# Will build a Win32 static library libpq(d).lib
4+
# and a Win32 dynamic library libpq(d).dll with import library libpq(d)dll.lib
55
# USE_SSL=1 will compile with OpenSSL
66
# DEBUG=1 compiles with debugging symbols
77

@@ -10,13 +10,15 @@
1010
!MESSAGE
1111

1212
!IFDEF DEBUG
13-
OPT=/Od /Zi
13+
OPT=/Od /Zi /MDd
1414
LOPT=/debug
1515
DEBUGDEF=/D _DEBUG
16+
OUTFILENAME=libpqd
1617
!ELSE
17-
OPT=/O2
18+
OPT=/O2 /MD
1819
LOPT=
1920
DEBUGDEF=/D NDEBUG
21+
OUTFILENAME=libpq
2022
!ENDIF
2123

2224
!IF "$(OS)" == "Windows_NT"
@@ -39,7 +41,7 @@ CPP_OBJS=.\Release/
3941
!ENDIF
4042

4143

42-
ALL : "$(OUTDIR)\libpq.lib" "$(OUTDIR)\libpq.dll"
44+
ALL : "$(OUTDIR)\$(OUTFILENAME).lib" "$(OUTDIR)\$(OUTFILENAME).dll"
4345

4446
CLEAN :
4547
-@erase "$(INTDIR)\getaddrinfo.obj"
@@ -62,20 +64,20 @@ CLEAN :
6264
-@erase "$(INTDIR)\pqexpbuffer.obj"
6365
-@erase "$(OUTDIR)\libpqdll.obj"
6466
-@erase "$(OUTDIR)\win32.obj"
65-
-@erase "$(OUTDIR)\libpq.lib"
66-
-@erase "$(OUTDIR)\libpq.dll"
67+
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
68+
-@erase "$(OUTDIR)\$(OUTFILENAME).dll"
6769
-@erase "$(OUTDIR)\libpq.res"
6870
-@erase "*.pch"
6971
-@erase "$(OUTDIR)\libpq.pch"
70-
-@erase "$(OUTDIR)\libpqdll.exp"
71-
-@erase "$(OUTDIR)\libpqdll.lib"
72+
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp"
73+
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
7274
-@erase "$(INTDIR)\wchar.obj"
7375
-@erase "$(INTDIR)\encnames.obj"
7476

7577
"$(OUTDIR)" :
7678
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
7779

78-
CPP_PROJ=/nologo /MD /W3 /GX $(OPT) /I "..\..\include" /D "FRONTEND" $(DEBUGDEF) /D\
80+
CPP_PROJ=/nologo /W3 /GX $(OPT) /I "..\..\include" /D "FRONTEND" $(DEBUGDEF) /D\
7981
"WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" /YX\
8082
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP"
8183

@@ -87,7 +89,7 @@ SSL_LIBS=ssleay32.lib libeay32.lib gdi32.lib
8789
CPP_SBRS=.
8890

8991
LIB32=link.exe -lib
90-
LIB32_FLAGS=$(LOPT) /nologo /out:"$(OUTDIR)\libpq.lib"
92+
LIB32_FLAGS=$(LOPT) /nologo /out:"$(OUTDIR)\$(OUTFILENAME).lib"
9193
LIB32_OBJS= \
9294
"$(INTDIR)\win32.obj" \
9395
"$(INTDIR)\getaddrinfo.obj" \
@@ -117,15 +119,15 @@ RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
117119
LINK32=link.exe
118120
LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib wsock32.lib $(SSL_LIBS) \
119121
/nologo /subsystem:windows /dll $(LOPT) /incremental:no\
120-
/pdb:"$(OUTDIR)\libpqdll.pdb" /machine:I386 /out:"$(OUTDIR)\libpq.dll"\
121-
/implib:"$(OUTDIR)\libpqdll.lib" /def:libpqdll.def
122+
/pdb:"$(OUTDIR)\libpqdll.pdb" /machine:I386 /out:"$(OUTDIR)\$(OUTFILENAME).dll"\
123+
/implib:"$(OUTDIR)\$(OUTFILENAME)dll.lib" /def:$(OUTFILENAME)dll.def
122124
LINK32_OBJS= \
123125
"$(INTDIR)\libpqdll.obj" \
124-
"$(OUTDIR)\libpq.lib" \
126+
"$(OUTDIR)\$(OUTFILENAME).lib" \
125127
"$(OUTDIR)\libpq.res"
126128

127129

128-
"$(OUTDIR)\libpq.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
130+
"$(OUTDIR)\$(OUTFILENAME).lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
129131
$(LIB32) @<<
130132
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
131133
<<
@@ -134,7 +136,7 @@ LINK32_OBJS= \
134136
$(RSC) $(RSC_PROJ) libpq.rc
135137

136138

137-
"$(OUTDIR)\libpq.dll" : "$(OUTDIR)" "$(OUTDIR)\libpqdll.obj" "$(INTDIR)\libpqdll.obj" "$(INTDIR)\libpq.res"
139+
"$(OUTDIR)\$(OUTFILENAME).dll" : "$(OUTDIR)" "$(OUTDIR)\libpqdll.obj" "$(INTDIR)\libpqdll.obj" "$(INTDIR)\libpq.res"
138140
$(LINK32) @<<
139141
$(LINK32_FLAGS) $(LINK32_OBJS)
140142
<<

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