Generate the various .def files for libpq DLLs from a single list of

exportable functions.  The .def files are removed from CVS, but will
still be present in distribution tarballs, since we can't assume that
Windows boxes will have sed.
This commit is contained in:
Tom Lane 2004-10-16 20:10:57 +00:00
parent f68d05d5ec
commit 2a63c1602d
6 changed files with 165 additions and 486 deletions

View File

@ -0,0 +1,3 @@
libpqdll.def
libpqddll.def
blibpqdll.def

View File

@ -2,9 +2,10 @@
#
# Makefile for src/interfaces/libpq library
#
# Copyright (c) 1994, Regents of the University of California
# Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.118 2004/10/16 03:26:43 momjian Exp $
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.119 2004/10/16 20:10:56 tgl Exp $
#
#-------------------------------------------------------------------------
@ -52,7 +53,7 @@ SHLIB_LINK += -lwsock32 -lws2_32 $(filter -leay32 -lssleay32, $(LIBS))
endif
all: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h all-lib
all: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h def-files all-lib
# Shared library stuff
include $(top_srcdir)/src/Makefile.shlib
@ -79,6 +80,42 @@ encnames.c wchar.c : % : $(backend_src)/utils/mb/%
rm -f $@ && $(LN_S) $< .
# We need several not-quite-identical variants of .DEF files to build libpq
# DLLs for Windows. These are made from the single source file exports.txt.
# Since we can't assume that Windows boxes will have sed, the .DEF files are
# always built and included in distribution tarballs.
distprep: def-files
.PHONY: def-files
def-files: $(srcdir)/libpqdll.def $(srcdir)/libpqddll.def $(srcdir)/blibpqdll.def
$(srcdir)/libpqdll.def: exports.txt
echo '; DEF file for MS VC++' > $@
echo 'LIBRARY LIBPQ' >> $@
echo 'DESCRIPTION "PostgreSQL Client Library"' >> $@
echo 'EXPORTS' >> $@
sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/ \1@ \2/' < $< >> $@
$(srcdir)/libpqddll.def: exports.txt
echo '; DEF file for MS VC++' > $@
echo 'LIBRARY LIBPQD' >> $@
echo 'DESCRIPTION "PostgreSQL Client Library"' >> $@
echo 'EXPORTS' >> $@
sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/ \1@ \2/' < $< >> $@
$(srcdir)/blibpqdll.def: exports.txt
echo '; DEF file for Borland C++ Builder' > $@
echo 'LIBRARY BLIBPQ' >> $@
echo 'DESCRIPTION "PostgreSQL Client Library"' >> $@
echo 'EXPORTS' >> $@
sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/ _\1@ \2/' < $< >> $@
echo '' >> $@
echo '; Aliases for MS compatible names' >> $@
sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/ \1= _\1/' < $< | sed 's/ *$$//' >> $@
ifneq ($(PTHREAD_H_WIN32), "")
pthread.h : % : $(top_srcdir)/src/interfaces/libpq/pthread.h.win
rm -f $@ && $(LN_S) $< .
@ -99,5 +136,8 @@ installdirs:
uninstall: uninstall-lib
rm -f $(DESTDIR)$(includedir)/libpq-fe.h $(DESTDIR)$(includedir_internal)/libpq-int.h $(DESTDIR)$(includedir_internal)/pqexpbuffer.h
clean distclean maintainer-clean: clean-lib
clean distclean: clean-lib
rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c dllist.c md5.c ip.c encnames.c wchar.c pthread.h
maintainer-clean: distclean
rm -f $(srcdir)/libpqdll.def $(srcdir)/libpqddll.def $(srcdir)/blibpqdll.def

View File

@ -1,240 +0,0 @@
; DEF file for Borland C++ Builder
LIBRARY BLIBPQ
DESCRIPTION "PostgreSQL Client Library"
EXPORTS
_PQconnectdb @ 1
_PQsetdbLogin @ 2
_PQconndefaults @ 3
_PQfinish @ 4
_PQreset @ 5
_PQrequestCancel @ 6
_PQdb @ 7
_PQuser @ 8
_PQpass @ 9
_PQhost @ 10
_PQport @ 11
_PQtty @ 12
_PQoptions @ 13
_PQstatus @ 14
_PQerrorMessage @ 15
_PQsocket @ 16
_PQbackendPID @ 17
_PQtrace @ 18
_PQuntrace @ 19
_PQsetNoticeProcessor @ 20
_PQexec @ 21
_PQnotifies @ 22
_PQsendQuery @ 23
_PQgetResult @ 24
_PQisBusy @ 25
_PQconsumeInput @ 26
_PQgetline @ 27
_PQputline @ 28
_PQgetlineAsync @ 29
_PQputnbytes @ 30
_PQendcopy @ 31
_PQfn @ 32
_PQresultStatus @ 33
_PQntuples @ 34
_PQnfields @ 35
_PQbinaryTuples @ 36
_PQfname @ 37
_PQfnumber @ 38
_PQftype @ 39
_PQfsize @ 40
_PQfmod @ 41
_PQcmdStatus @ 42
_PQoidStatus @ 43
_PQcmdTuples @ 44
_PQgetvalue @ 45
_PQgetlength @ 46
_PQgetisnull @ 47
_PQclear @ 48
_PQmakeEmptyPGresult @ 49
_PQprint @ 50
_PQdisplayTuples @ 51
_PQprintTuples @ 52
_lo_open @ 53
_lo_close @ 54
_lo_read @ 55
_lo_write @ 56
_lo_lseek @ 57
_lo_creat @ 58
_lo_tell @ 59
_lo_unlink @ 60
_lo_import @ 61
_lo_export @ 62
_pgresStatus @ 63
_PQmblen @ 64
_PQresultErrorMessage @ 65
_PQresStatus @ 66
_termPQExpBuffer @ 67
_appendPQExpBufferChar @ 68
_initPQExpBuffer @ 69
_resetPQExpBuffer @ 70
_PQoidValue @ 71
_PQclientEncoding @ 72
_PQenv2encoding @ 73
_appendBinaryPQExpBuffer @ 74
_appendPQExpBufferStr @ 75
_destroyPQExpBuffer @ 76
_createPQExpBuffer @ 77
_PQconninfoFree @ 78
_PQconnectPoll @ 79
_PQconnectStart @ 80
_PQflush @ 81
_PQisnonblocking @ 82
_PQresetPoll @ 83
_PQresetStart @ 84
_PQsetClientEncoding @ 85
_PQsetnonblocking @ 86
_PQfreeNotify @ 87
_PQescapeString @ 88
_PQescapeBytea @ 89
_printfPQExpBuffer @ 90
_appendPQExpBuffer @ 91
_pg_encoding_to_char @ 92
_pg_utf_mblen @ 93
_PQunescapeBytea @ 94
_PQfreemem @ 95
_PQtransactionStatus @ 96
_PQparameterStatus @ 97
_PQprotocolVersion @ 98
_PQsetErrorVerbosity @ 99
_PQsetNoticeReceiver @ 100
_PQexecParams @ 101
_PQsendQueryParams @ 102
_PQputCopyData @ 103
_PQputCopyEnd @ 104
_PQgetCopyData @ 105
_PQresultErrorField @ 106
_PQftable @ 107
_PQftablecol @ 108
_PQfformat @ 109
_PQexecPrepared @ 110
_PQsendQueryPrepared @ 111
_PQdsplen @ 112
_PQserverVersion @ 113
_PQgetssl @ 114
_pg_char_to_encoding @ 115
_pg_valid_server_encoding @ 116
_pqsignal @ 117
; Aliases for MS compatible names
PQconnectdb = _PQconnectdb
PQsetdbLogin = _PQsetdbLogin
PQconndefaults = _PQconndefaults
PQfinish = _PQfinish
PQreset = _PQreset
PQrequestCancel = _PQrequestCancel
PQdb = _PQdb
PQuser = _PQuser
PQpass = _PQpass
PQhost = _PQhost
PQport = _PQport
PQtty = _PQtty
PQoptions = _PQoptions
PQstatus = _PQstatus
PQerrorMessage = _PQerrorMessage
PQsocket = _PQsocket
PQbackendPID = _PQbackendPID
PQtrace = _PQtrace
PQuntrace = _PQuntrace
PQsetNoticeProcessor = _PQsetNoticeProcessor
PQexec = _PQexec
PQnotifies = _PQnotifies
PQsendQuery = _PQsendQuery
PQgetResult = _PQgetResult
PQisBusy = _PQisBusy
PQconsumeInput = _PQconsumeInput
PQgetline = _PQgetline
PQputline = _PQputline
PQgetlineAsync = _PQgetlineAsync
PQputnbytes = _PQputnbytes
PQendcopy = _PQendcopy
PQfn = _PQfn
PQresultStatus = _PQresultStatus
PQntuples = _PQntuples
PQnfields = _PQnfields
PQbinaryTuples = _PQbinaryTuples
PQfname = _PQfname
PQfnumber = _PQfnumber
PQftype = _PQftype
PQfsize = _PQfsize
PQfmod = _PQfmod
PQcmdStatus = _PQcmdStatus
PQoidStatus = _PQoidStatus
PQcmdTuples = _PQcmdTuples
PQgetvalue = _PQgetvalue
PQgetlength = _PQgetlength
PQgetisnull = _PQgetisnull
PQclear = _PQclear
PQmakeEmptyPGresult = _PQmakeEmptyPGresult
PQprint = _PQprint
PQdisplayTuples = _PQdisplayTuples
PQprintTuples = _PQprintTuples
lo_open = _lo_open
lo_close = _lo_close
lo_read = _lo_read
lo_write = _lo_write
lo_lseek = _lo_lseek
lo_creat = _lo_creat
lo_tell = _lo_tell
lo_unlink = _lo_unlink
lo_import = _lo_import
lo_export = _lo_export
pgresStatus = _pgresStatus
PQmblen = _PQmblen
PQresultErrorMessage = _PQresultErrorMessage
PQresStatus = _PQresStatus
termPQExpBuffer = _termPQExpBuffer
appendPQExpBufferChar = _appendPQExpBufferChar
initPQExpBuffer = _initPQExpBuffer
resetPQExpBuffer = _resetPQExpBuffer
PQoidValue = _PQoidValue
PQclientEncoding = _PQclientEncoding
PQenv2encoding = _PQenv2encoding
appendBinaryPQExpBuffer = _appendBinaryPQExpBuffer
appendPQExpBufferStr = _appendPQExpBufferStr
destroyPQExpBuffer = _destroyPQExpBuffer
createPQExpBuffer = _createPQExpBuffer
PQconninfoFree = _PQconninfoFree
PQconnectPoll = _PQconnectPoll
PQconnectStart = _PQconnectStart
PQflush = _PQflush
PQisnonblocking = _PQisnonblocking
PQresetPoll = _PQresetPoll
PQresetStart = _PQresetStart
PQsetClientEncoding = _PQsetClientEncoding
PQsetnonblocking = _PQsetnonblocking
PQfreeNotify = _PQfreeNotify
PQescapeString = _PQescapeString
PQescapeBytea = _PQescapeBytea
printfPQExpBuffer = _printfPQExpBuffer
appendPQExpBuffer = _appendPQExpBuffer
pg_encoding_to_char = _pg_encoding_to_char
pg_utf_mblen = _pg_utf_mblen
PQunescapeBytea = _PQunescapeBytea
PQfreemem = _PQfreemem
PQtransactionStatus = _PQtransactionStatus
PQparameterStatus = _PQparameterStatus
PQprotocolVersion = _PQprotocolVersion
PQsetErrorVerbosity = _PQsetErrorVerbosity
PQsetNoticeReceiver = _PQsetNoticeReceiver
PQexecParams = _PQexecParams
PQsendQueryParams = _PQsendQueryParams
PQputCopyData = _PQputCopyData
PQputCopyEnd = _PQputCopyEnd
PQgetCopyData = _PQgetCopyData
PQresultErrorField = _PQresultErrorField
PQftable = _PQftable
PQftablecol = _PQftablecol
PQfformat = _PQfformat
PQexecPrepared = _PQexecPrepared
PQsendQueryPrepared = _PQsendQueryPrepared
PQdsplen = _PQdsplen
PQserverVersion = _PQserverVersion
PQgetssl = _PQgetssl
pg_char_to_encoding = _pg_char_to_encoding
pg_valid_server_encoding = _pg_valid_server_encoding
pqsignal = _pqsignal

View File

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

View File

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

View File

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