#
# 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 $
#
#-------------------------------------------------------------------------
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
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) $< .
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
+++ /dev/null
-; 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